dist/ember-spade.js in ember-source-1.6.0 vs dist/ember-spade.js in ember-source-1.6.1
- old
+ new
@@ -3,11 +3,11 @@
* @copyright Copyright 2011-2014 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
- * @version 1.6.0
+ * @version 1.6.1
*/
var define, requireModule, require, requirejs, Ember;
@@ -69,6 +69,6 @@
} else {
define = Ember.__loader.define;
requirejs = require = requireModule = Ember.__loader.require;
}
})();
-minispade.register('container', "(function() {define(\"container/container\",\n [\"container/inheriting_dict\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var InheritingDict = __dependency1__[\"default\"];\n\n // A lightweight container that helps to assemble and decouple components.\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 function Container(parent) {\n this.parent = parent;\n this.children = [];\n\n this.resolver = parent && parent.resolver || function() {};\n\n this.registry = new InheritingDict(parent && parent.registry);\n this.cache = new InheritingDict(parent && parent.cache);\n this.factoryCache = new InheritingDict(parent && parent.factoryCache);\n this.resolveCache = new InheritingDict(parent && parent.resolveCache);\n this.typeInjections = new InheritingDict(parent && parent.typeInjections);\n this.injections = {};\n\n this.factoryTypeInjections = new InheritingDict(parent && parent.factoryTypeInjections);\n this.factoryInjections = {};\n\n this._options = new InheritingDict(parent && parent._options);\n this._typeOptions = new InheritingDict(parent && parent._typeOptions);\n }\n\n Container.prototype = {\n\n /**\n @property parent\n @type Container\n @default null\n */\n parent: null,\n\n /**\n @property children\n @type Array\n @default []\n */\n children: null,\n\n /**\n @property resolver\n @type function\n */\n resolver: null,\n\n /**\n @property registry\n @type InheritingDict\n */\n registry: null,\n\n /**\n @property cache\n @type InheritingDict\n */\n cache: null,\n\n /**\n @property typeInjections\n @type InheritingDict\n */\n typeInjections: null,\n\n /**\n @property injections\n @type Object\n @default {}\n */\n injections: null,\n\n /**\n @private\n\n @property _options\n @type InheritingDict\n @default null\n */\n _options: null,\n\n /**\n @private\n\n @property _typeOptions\n @type InheritingDict\n */\n _typeOptions: null,\n\n /**\n Returns a new child of the current container. These children are configured\n to correctly inherit from the current container.\n\n @method child\n @return {Container}\n */\n child: function() {\n var container = new Container(this);\n this.children.push(container);\n return container;\n },\n\n /**\n Sets a key-value pair on the current container. If a parent container,\n has the same key, once set on a child, the parent and child will diverge\n as expected.\n\n @method set\n @param {Object} object\n @param {String} key\n @param {any} value\n */\n set: function(object, key, value) {\n object[key] = value;\n },\n\n /**\n Registers a factory for later injection.\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('model:user', Person, {singleton: false });\n container.register('fruit:favorite', Orange);\n container.register('communication:main', Email, {singleton: false});\n ```\n\n @method register\n @param {String} fullName\n @param {Function} factory\n @param {Object} options\n */\n register: function(fullName, factory, options) {\n validateFullName(fullName);\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.cache.has(normalizedName)) {\n throw new Error('Cannot re-register: `' + fullName +'`, as it has already been looked up.');\n }\n\n this.registry.set(normalizedName, factory);\n this._options.set(normalizedName, options || {});\n },\n\n /**\n Unregister a fullName\n\n ```javascript\n var container = new Container();\n container.register('model:user', User);\n\n container.lookup('model:user') instanceof User //=> true\n\n container.unregister('model:user')\n container.lookup('model:user') === undefined //=> true\n ```\n\n @method unregister\n @param {String} fullName\n */\n unregister: function(fullName) {\n validateFullName(fullName);\n\n var normalizedName = this.normalize(fullName);\n\n this.registry.remove(normalizedName);\n this.cache.remove(normalizedName);\n this.factoryCache.remove(normalizedName);\n this.resolveCache.remove(normalizedName);\n this._options.remove(normalizedName);\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n By default `resolve` will retrieve the factory from\n its container's registry.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n container.resolve('api:twitter') // => Twitter\n ```\n\n Optionally the container can be provided with a custom resolver.\n If provided, `resolve` will first provide the custom resolver\n the opportunity to resolve the fullName, otherwise it will fallback\n to the registry.\n\n ```javascript\n var container = new Container();\n container.resolver = function(fullName) {\n // lookup via the module system of choice\n };\n\n // the twitter factory is added to the module system\n container.resolve('api:twitter') // => Twitter\n ```\n\n @method resolve\n @param {String} fullName\n @return {Function} fullName's factory\n */\n resolve: function(fullName) {\n validateFullName(fullName);\n\n var normalizedName = this.normalize(fullName);\n var cached = this.resolveCache.get(normalizedName);\n\n if (cached) { return cached; }\n\n var resolved = this.resolver(normalizedName) || this.registry.get(normalizedName);\n\n this.resolveCache.set(normalizedName, resolved);\n\n return resolved;\n },\n\n /**\n A hook that can be used to describe how the resolver will\n attempt to find the factory.\n\n For example, the default Ember `.describe` returns the full\n class name (including namespace) where Ember's resolver expects\n to find the `fullName`.\n\n @method describe\n @param {String} fullName\n @return {string} described fullName\n */\n describe: function(fullName) {\n return fullName;\n },\n\n /**\n A hook to enable custom fullName normalization behaviour\n\n @method normalize\n @param {String} fullName\n @return {string} normalized fullName\n */\n normalize: function(fullName) {\n return fullName;\n },\n\n /**\n @method makeToString\n\n @param {any} factory\n @param {string} fullName\n @return {function} toString function\n */\n makeToString: function(factory, fullName) {\n return factory.toString();\n },\n\n /**\n Given a fullName return a corresponding instance.\n\n The default behaviour is for lookup to return a singleton instance.\n The singleton is scoped to the container, allowing multiple containers\n to all have their own locally scoped singletons.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter');\n\n twitter instanceof Twitter; // => true\n\n // by default the container will return singletons\n var twitter2 = container.lookup('api:twitter');\n twitter2 instanceof Twitter; // => true\n\n twitter === twitter2; //=> true\n ```\n\n If singletons are not wanted an optional flag can be provided at lookup.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter', { singleton: false });\n var twitter2 = container.lookup('api:twitter', { singleton: false });\n\n twitter === twitter2; //=> false\n ```\n\n @method lookup\n @param {String} fullName\n @param {Object} options\n @return {any}\n */\n lookup: function(fullName, options) {\n validateFullName(fullName);\n return lookup(this, this.normalize(fullName), options);\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n @method lookupFactory\n @param {String} fullName\n @return {any}\n */\n lookupFactory: function(fullName) {\n validateFullName(fullName);\n return factoryFor(this, this.normalize(fullName));\n },\n\n /**\n Given a fullName check if the container is aware of its factory\n or singleton instance.\n\n @method has\n @param {String} fullName\n @return {Boolean}\n */\n has: function(fullName) {\n validateFullName(fullName);\n return has(this, this.normalize(fullName));\n },\n\n /**\n Allow registering options for all factories of a type.\n\n ```javascript\n var container = new Container();\n\n // if all of type `connection` must not be singletons\n container.optionsForType('connection', { singleton: false });\n\n container.register('connection:twitter', TwitterConnection);\n container.register('connection:facebook', FacebookConnection);\n\n var twitter = container.lookup('connection:twitter');\n var twitter2 = container.lookup('connection:twitter');\n\n twitter === twitter2; // => false\n\n var facebook = container.lookup('connection:facebook');\n var facebook2 = container.lookup('connection:facebook');\n\n facebook === facebook2; // => false\n ```\n\n @method optionsForType\n @param {String} type\n @param {Object} options\n */\n optionsForType: function(type, options) {\n if (this.parent) { illegalChildOperation('optionsForType'); }\n\n this._typeOptions.set(type, options);\n },\n\n /**\n @method options\n @param {String} type\n @param {Object} options\n */\n options: function(type, options) {\n this.optionsForType(type, options);\n },\n\n /**\n Used only via `injection`.\n\n Provides a specialized form of injection, specifically enabling\n all objects of one type to be injected with a reference to another\n object.\n\n For example, provided each object of type `controller` needed a `router`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.register('router:main', Router);\n container.register('controller:user', UserController);\n container.register('controller:post', PostController);\n\n container.typeInjection('controller', 'router', 'router:main');\n\n var user = container.lookup('controller:user');\n var post = container.lookup('controller:post');\n\n user.router instanceof Router; //=> true\n post.router instanceof Router; //=> true\n\n // both controllers share the same router\n user.router === post.router; //=> true\n ```\n\n @private\n @method typeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n typeInjection: function(type, property, fullName) {\n validateFullName(fullName);\n if (this.parent) { illegalChildOperation('typeInjection'); }\n\n var fullNameType = fullName.split(':')[0];\n if(fullNameType === type) {\n throw new Error('Cannot inject a `' + fullName + '` on other ' + type + '(s). Register the `' + fullName + '` as a different type and perform the typeInjection.');\n }\n addTypeInjection(this.typeInjections, type, property, fullName);\n },\n\n /**\n Defines injection rules.\n\n These rules are used to inject dependencies onto objects when they\n are instantiated.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('source:main', Source);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another fullName\n // eg. each user model gets a post model\n container.injection('model:user', 'post', 'model:post');\n\n // injecting one fullName on another type\n container.injection('model', 'source', 'source:main');\n\n var user = container.lookup('model:user');\n var post = container.lookup('model:post');\n\n user.source instanceof Source; //=> true\n post.source instanceof Source; //=> true\n\n user.post instanceof Post; //=> true\n\n // and both models share the same source\n user.source === post.source; //=> true\n ```\n\n @method injection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\n */\n injection: function(fullName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n validateFullName(injectionName);\n var normalizedInjectionName = this.normalize(injectionName);\n\n if (fullName.indexOf(':') === -1) {\n return this.typeInjection(fullName, property, normalizedInjectionName);\n }\n\n validateFullName(fullName);\n var normalizedName = this.normalize(fullName);\n\n addInjection(this.injections, normalizedName, property, normalizedInjectionName);\n },\n\n\n /**\n Used only via `factoryInjection`.\n\n Provides a specialized form of injection, specifically enabling\n all factory of one type to be injected with a reference to another\n object.\n\n For example, provided each factory of type `model` needed a `store`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.register('store:main', SomeStore);\n\n container.factoryTypeInjection('model', 'store', 'store:main');\n\n var store = container.lookup('store:main');\n var UserFactory = container.lookupFactory('model:user');\n\n UserFactory.store instanceof SomeStore; //=> true\n ```\n\n @private\n @method factoryTypeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n factoryTypeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('factoryTypeInjection'); }\n\n addTypeInjection(this.factoryTypeInjections, type, property, this.normalize(fullName));\n },\n\n /**\n Defines factory injection rules.\n\n Similar to regular injection rules, but are run against factories, via\n `Container#lookupFactory`.\n\n These rules are used to inject objects onto factories when they\n are looked up.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('store:main', Store);\n container.register('store:secondary', OtherStore);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another type\n container.factoryInjection('model', 'store', 'store:main');\n\n // injecting one fullName on another fullName\n container.factoryInjection('model:post', 'secondaryStore', 'store:secondary');\n\n var UserFactory = container.lookupFactory('model:user');\n var PostFactory = container.lookupFactory('model:post');\n var store = container.lookup('store:main');\n\n UserFactory.store instanceof Store; //=> true\n UserFactory.secondaryStore instanceof OtherStore; //=> false\n\n PostFactory.store instanceof Store; //=> true\n PostFactory.secondaryStore instanceof OtherStore; //=> true\n\n // and both models share the same source instance\n UserFactory.store === PostFactory.store; //=> true\n ```\n\n @method factoryInjection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\n */\n factoryInjection: function(fullName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n var normalizedName = this.normalize(fullName);\n var normalizedInjectionName = this.normalize(injectionName);\n\n validateFullName(injectionName);\n\n if (fullName.indexOf(':') === -1) {\n return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName);\n }\n\n validateFullName(fullName);\n\n addInjection(this.factoryInjections, normalizedName, property, normalizedInjectionName);\n },\n\n /**\n A depth first traversal, destroying the container, its descendant containers and all\n their managed objects.\n\n @method destroy\n */\n destroy: function() {\n for (var i=0, l=this.children.length; i<l; i++) {\n this.children[i].destroy();\n }\n\n this.children = [];\n\n eachDestroyable(this, function(item) {\n item.destroy();\n });\n\n this.parent = undefined;\n this.isDestroyed = true;\n },\n\n /**\n @method reset\n */\n reset: function() {\n for (var i=0, l=this.children.length; i<l; i++) {\n resetCache(this.children[i]);\n }\n resetCache(this);\n }\n };\n\n function has(container, fullName){\n if (container.cache.has(fullName)) {\n return true;\n }\n\n return !!container.resolve(fullName);\n }\n\n function lookup(container, fullName, options) {\n options = options || {};\n\n if (container.cache.has(fullName) && options.singleton !== false) {\n return container.cache.get(fullName);\n }\n\n var value = instantiate(container, fullName);\n\n if (value === undefined) { return; }\n\n if (isSingleton(container, fullName) && options.singleton !== false) {\n container.cache.set(fullName, value);\n }\n\n return value;\n }\n\n function illegalChildOperation(operation) {\n throw new Error(operation + \" is not currently supported on child containers\");\n }\n\n function isSingleton(container, fullName) {\n var singleton = option(container, fullName, 'singleton');\n\n return singleton !== false;\n }\n\n function buildInjections(container, injections) {\n var hash = {};\n\n if (!injections) { return hash; }\n\n var injection, injectable;\n\n for (var i=0, l=injections.length; i<l; i++) {\n injection = injections[i];\n injectable = lookup(container, injection.fullName);\n\n if (injectable !== undefined) {\n hash[injection.property] = injectable;\n } else {\n throw new Error('Attempting to inject an unknown injection: `' + injection.fullName + '`');\n }\n }\n\n return hash;\n }\n\n function option(container, fullName, optionName) {\n var options = container._options.get(fullName);\n\n if (options && options[optionName] !== undefined) {\n return options[optionName];\n }\n\n var type = fullName.split(\":\")[0];\n options = container._typeOptions.get(type);\n\n if (options) {\n return options[optionName];\n }\n }\n\n function factoryFor(container, fullName) {\n var name = fullName;\n var factory = container.resolve(name);\n var injectedFactory;\n var cache = container.factoryCache;\n var type = fullName.split(\":\")[0];\n\n if (factory === undefined) { return; }\n\n if (cache.has(fullName)) {\n return cache.get(fullName);\n }\n\n if (!factory || typeof factory.extend !== 'function' || (!Ember.MODEL_FACTORY_INJECTIONS && type === 'model')) {\n // TODO: think about a 'safe' merge style extension\n // for now just fallback to create time injection\n return factory;\n } else {\n\n var injections = injectionsFor(container, fullName);\n var factoryInjections = factoryInjectionsFor(container, fullName);\n\n factoryInjections._toString = container.makeToString(factory, fullName);\n\n injectedFactory = factory.extend(injections);\n injectedFactory.reopenClass(factoryInjections);\n\n cache.set(fullName, injectedFactory);\n\n return injectedFactory;\n }\n }\n\n function injectionsFor(container, fullName) {\n var splitName = fullName.split(\":\"),\n type = splitName[0],\n injections = [];\n\n injections = injections.concat(container.typeInjections.get(type) || []);\n injections = injections.concat(container.injections[fullName] || []);\n\n injections = buildInjections(container, injections);\n injections._debugContainerKey = fullName;\n injections.container = container;\n\n return injections;\n }\n\n function factoryInjectionsFor(container, fullName) {\n var splitName = fullName.split(\":\"),\n type = splitName[0],\n factoryInjections = [];\n\n factoryInjections = factoryInjections.concat(container.factoryTypeInjections.get(type) || []);\n factoryInjections = factoryInjections.concat(container.factoryInjections[fullName] || []);\n\n factoryInjections = buildInjections(container, factoryInjections);\n factoryInjections._debugContainerKey = fullName;\n\n return factoryInjections;\n }\n\n function instantiate(container, fullName) {\n var factory = factoryFor(container, fullName);\n\n if (option(container, fullName, 'instantiate') === false) {\n return factory;\n }\n\n if (factory) {\n if (typeof factory.extend === 'function') {\n // assume the factory was extendable and is already injected\n return factory.create();\n } else {\n // assume the factory was extendable\n // to create time injections\n // TODO: support new'ing for instantiation and merge injections for pure JS Functions\n return factory.create(injectionsFor(container, fullName));\n }\n }\n }\n\n function eachDestroyable(container, callback) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n callback(value);\n });\n }\n\n function resetCache(container) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n value.destroy();\n });\n container.cache.dict = {};\n }\n\n function addTypeInjection(rules, type, property, fullName) {\n var injections = rules.get(type);\n\n if (!injections) {\n injections = [];\n rules.set(type, injections);\n }\n\n injections.push({\n property: property,\n fullName: fullName\n });\n }\n\n var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/;\n function validateFullName(fullName) {\n if (!VALID_FULL_NAME_REGEXP.test(fullName)) {\n throw new TypeError('Invalid Fullname, expected: `type:name` got: ' + fullName);\n }\n }\n\n function addInjection(rules, factoryName, property, injectionName) {\n var injections = rules[factoryName] = rules[factoryName] || [];\n injections.push({ property: property, fullName: injectionName });\n }\n\n __exports__[\"default\"] = Container;\n });\ndefine(\"container/inheriting_dict\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n // A safe and simple inheriting object.\n function InheritingDict(parent) {\n this.parent = parent;\n this.dict = {};\n }\n\n InheritingDict.prototype = {\n\n /**\n @property parent\n @type InheritingDict\n @default null\n */\n\n parent: null,\n\n /**\n Object used to store the current nodes data.\n\n @property dict\n @type Object\n @default Object\n */\n dict: null,\n\n /**\n Retrieve the value given a key, if the value is present at the current\n level use it, otherwise walk up the parent hierarchy and try again. If\n no matching key is found, return undefined.\n\n @method get\n @param {String} key\n @return {any}\n */\n get: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return dict[key];\n }\n\n if (this.parent) {\n return this.parent.get(key);\n }\n },\n\n /**\n Set the given value for the given key, at the current level.\n\n @method set\n @param {String} key\n @param {Any} value\n */\n set: function(key, value) {\n this.dict[key] = value;\n },\n\n /**\n Delete the given key\n\n @method remove\n @param {String} key\n */\n remove: function(key) {\n delete this.dict[key];\n },\n\n /**\n Check for the existence of given a key, if the key is present at the current\n level return true, otherwise walk up the parent hierarchy and try again. If\n no matching key is found, return false.\n\n @method has\n @param {String} key\n @return {Boolean}\n */\n has: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return true;\n }\n\n if (this.parent) {\n return this.parent.has(key);\n }\n\n return false;\n },\n\n /**\n Iterate and invoke a callback for each local key-value pair.\n\n @method eachLocal\n @param {Function} callback\n @param {Object} binding\n */\n eachLocal: function(callback, binding) {\n var dict = this.dict;\n\n for (var prop in dict) {\n if (dict.hasOwnProperty(prop)) {\n callback.call(binding, prop, dict[prop]);\n }\n }\n }\n };\n\n __exports__[\"default\"] = InheritingDict;\n });\ndefine(\"container\",\n [\"container/container\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\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 /*\n Flag to enable/disable model factory injections (disabled by default)\n If model factory injections are enabled, models should not be\n accessed globally (only through `container.lookupFactory('model:modelName'))`);\n */\n Ember.MODEL_FACTORY_INJECTIONS = false;\n\n if (Ember.ENV && typeof Ember.ENV.MODEL_FACTORY_INJECTIONS !== 'undefined') {\n Ember.MODEL_FACTORY_INJECTIONS = !!Ember.ENV.MODEL_FACTORY_INJECTIONS;\n }\n\n\n var Container = __dependency1__[\"default\"];\n\n __exports__[\"default\"] = Container;\n });\n})();\n//@ sourceURL=container");minispade.register('ember-application', "(function() {minispade.require(\"ember-routing\");\nminispade.require(\"ember-extension-support\");\ndefine(\"ember-application/ext/controller\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/error\",\"ember-metal/utils\",\"ember-metal/computed\",\"ember-runtime/controllers/controller\",\"ember-routing/system/controller_for\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-application\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EmberError = __dependency4__[\"default\"];\n var inspect = __dependency5__.inspect;\n var computed = __dependency6__.computed;\n var ControllerMixin = __dependency7__.ControllerMixin;\n var meta = __dependency5__.meta;\n var controllerFor = __dependency8__.controllerFor;\n var meta = __dependency5__.meta;\n\n function verifyNeedsDependencies(controller, container, needs) {\n var dependency, i, l, missing = [];\n\n for (i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n\n Ember.assert(inspect(controller) + \"#needs must not specify dependencies with periods in their names (\" + dependency + \")\", dependency.indexOf('.') === -1);\n\n if (dependency.indexOf(':') === -1) {\n dependency = \"controller:\" + dependency;\n }\n\n // Structure assert to still do verification but not string concat in production\n if (!container.has(dependency)) {\n missing.push(dependency);\n }\n }\n if (missing.length) {\n throw new EmberError(inspect(controller) + \" needs [ \" + missing.join(', ') + \" ] but \" + (missing.length > 1 ? 'they' : 'it') + \" could not be found\");\n }\n }\n\n var defaultControllersComputedProperty = computed(function() {\n var controller = this;\n\n return {\n needs: get(controller, 'needs'),\n container: get(controller, 'container'),\n unknownProperty: function(controllerName) {\n var needs = this.needs,\n dependency, i, l;\n for (i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency === controllerName) {\n return this.container.lookup('controller:' + controllerName);\n }\n }\n\n var errorMessage = inspect(controller) + '#needs does not include `' + controllerName + '`. To access the ' + controllerName + ' controller from ' + inspect(controller) + ', ' + inspect(controller) + ' should have a `needs` property that is an array of the controllers it has access to.';\n throw new ReferenceError(errorMessage);\n },\n setUnknownProperty: function (key, value) {\n throw new Error(\"You cannot overwrite the value of `controllers.\" + key + \"` of \" + inspect(controller));\n }\n };\n });\n\n /**\n @class ControllerMixin\n @namespace Ember\n */\n ControllerMixin.reopen({\n concatenatedProperties: ['needs'],\n\n /**\n An array of other controller objects available inside\n instances of this controller via the `controllers`\n property:\n\n For example, when you define a controller:\n\n ```javascript\n App.CommentsController = Ember.ArrayController.extend({\n needs: ['post']\n });\n ```\n\n The application's single instance of these other\n controllers are accessible by name through the\n `controllers` property:\n\n ```javascript\n this.get('controllers.post'); // instance of App.PostController\n ```\n\n Given that you have a nested controller (nested resource):\n\n ```javascript\n App.CommentsNewController = Ember.ObjectController.extend({\n });\n ```\n\n When you define a controller that requires access to a nested one:\n\n ```javascript\n App.IndexController = Ember.ObjectController.extend({\n needs: ['commentsNew']\n });\n ```\n\n You will be able to get access to it:\n\n ```javascript\n this.get('controllers.commentsNew'); // instance of App.CommentsNewController\n ```\n\n This is only available for singleton controllers.\n\n @property {Array} needs\n @default []\n */\n needs: [],\n\n init: function() {\n var needs = get(this, 'needs'),\n length = get(needs, 'length');\n\n if (length > 0) {\n Ember.assert(' `' + inspect(this) + ' specifies `needs`, but does ' +\n \"not have a container. Please ensure this controller was \" +\n \"instantiated with a container.\",\n this.container || meta(this, false).descs.controllers !== defaultControllersComputedProperty);\n\n if (this.container) {\n verifyNeedsDependencies(this, this.container, needs);\n }\n\n // if needs then initialize controllers proxy\n get(this, 'controllers');\n }\n\n this._super.apply(this, arguments);\n },\n\n /**\n @method controllerFor\n @see {Ember.Route#controllerFor}\n @deprecated Use `needs` instead\n */\n controllerFor: function(controllerName) {\n Ember.deprecate(\"Controller#controllerFor is deprecated, please use Controller#needs instead\");\n return controllerFor(get(this, 'container'), controllerName);\n },\n\n /**\n Stores the instances of other controllers available from within\n this controller. Any controller listed by name in the `needs`\n property will be accessible by name through this property.\n\n ```javascript\n App.CommentsController = Ember.ArrayController.extend({\n needs: ['post'],\n postTitle: function(){\n var currentPost = this.get('controllers.post'); // instance of App.PostController\n return currentPost.get('title');\n }.property('controllers.post.title')\n });\n ```\n\n @see {Ember.ControllerMixin#needs}\n @property {Object} controllers\n @default null\n */\n controllers: defaultControllersComputedProperty\n });\n\n __exports__[\"default\"] = ControllerMixin;\n });\ndefine(\"ember-application\",\n [\"ember-metal/core\",\"ember-runtime/system/lazy_load\",\"ember-application/system/dag\",\"ember-application/system/resolver\",\"ember-application/system/application\",\"ember-application/ext/controller\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var runLoadHooks = __dependency2__.runLoadHooks;\n\n /**\n Ember Application\n\n @module ember\n @submodule ember-application\n @requires ember-views, ember-routing\n */\n\n var DAG = __dependency3__[\"default\"];var Resolver = __dependency4__.Resolver;\n var DefaultResolver = __dependency4__.DefaultResolver;\n var Application = __dependency5__[\"default\"];\n // side effect of extending ControllerMixin\n\n Ember.Application = Application;\n Ember.DAG = DAG;\n Ember.Resolver = Resolver;\n Ember.DefaultResolver = DefaultResolver;\n\n runLoadHooks('Ember.Application', Application);\n });\ndefine(\"ember-application/system/application\",\n [\"ember-metal\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/lazy_load\",\"ember-application/system/dag\",\"ember-runtime/system/namespace\",\"ember-runtime/mixins/deferred\",\"ember-application/system/resolver\",\"ember-metal/platform\",\"ember-metal/run_loop\",\"ember-metal/utils\",\"container/container\",\"ember-runtime/controllers/controller\",\"ember-metal/enumerable_utils\",\"ember-runtime/controllers/object_controller\",\"ember-runtime/controllers/array_controller\",\"ember-views/system/event_dispatcher\",\"ember-extension-support/container_debug_adapter\",\"ember-views/system/jquery\",\"ember-routing/system/route\",\"ember-routing/system/router\",\"ember-routing/location/hash_location\",\"ember-routing/location/history_location\",\"ember-routing/location/auto_location\",\"ember-routing/location/none_location\",\"ember-handlebars-compiler\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-application\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.FEATURES, Ember.deprecate, Ember.assert, Ember.libraries, LOG_VERSION, Namespace, BOOTED\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var runLoadHooks = __dependency4__.runLoadHooks;\n var DAG = __dependency5__[\"default\"];var Namespace = __dependency6__[\"default\"];\n var DeferredMixin = __dependency7__[\"default\"];\n var DefaultResolver = __dependency8__.DefaultResolver;\n var create = __dependency9__.create;\n var run = __dependency10__[\"default\"];\n var canInvoke = __dependency11__.canInvoke;\n var Container = __dependency12__[\"default\"];\n var Controller = __dependency13__.Controller;\n var EnumerableUtils = __dependency14__[\"default\"];\n var ObjectController = __dependency15__[\"default\"];\n var ArrayController = __dependency16__[\"default\"];\n var EventDispatcher = __dependency17__[\"default\"];\n var ContainerDebugAdapter = __dependency18__[\"default\"];\n var jQuery = __dependency19__[\"default\"];\n var Route = __dependency20__[\"default\"];\n var Router = __dependency21__[\"default\"];\n var HashLocation = __dependency22__[\"default\"];\n var HistoryLocation = __dependency23__[\"default\"];\n var AutoLocation = __dependency24__[\"default\"];\n var NoneLocation = __dependency25__[\"default\"];\n\n var EmberHandlebars = __dependency26__[\"default\"];\n\n var K = Ember.K;\n\n function DeprecatedContainer(container) {\n this._container = container;\n }\n\n DeprecatedContainer.deprecate = function(method) {\n return function() {\n var container = this._container;\n\n Ember.deprecate('Using the defaultContainer is no longer supported. [defaultContainer#' + method + '] see: http://git.io/EKPpnA', false);\n return container[method].apply(container, arguments);\n };\n };\n\n DeprecatedContainer.prototype = {\n _container: null,\n lookup: DeprecatedContainer.deprecate('lookup'),\n resolve: DeprecatedContainer.deprecate('resolve'),\n register: DeprecatedContainer.deprecate('register')\n };\n\n /**\n An instance of `Ember.Application` is the starting point for every Ember\n application. It helps to instantiate, initialize and coordinate the many\n objects that make up your app.\n\n Each Ember app has one and only one `Ember.Application` object. In fact, the\n very first thing you should do in your application is create the instance:\n\n ```javascript\n window.App = Ember.Application.create();\n ```\n\n Typically, the application object is the only global variable. All other\n classes in your app should be properties on the `Ember.Application` instance,\n which highlights its first role: a global namespace.\n\n For example, if you define a view class, it might look like this:\n\n ```javascript\n App.MyView = Ember.View.extend();\n ```\n\n By default, calling `Ember.Application.create()` will automatically initialize\n your application by calling the `Ember.Application.initialize()` method. If\n you need to delay initialization, you can call your app's `deferReadiness()`\n method. When you are ready for your app to be initialized, call its\n `advanceReadiness()` method.\n\n You can define a `ready` method on the `Ember.Application` instance, which\n will be run by Ember when the application is initialized.\n\n Because `Ember.Application` inherits from `Ember.Namespace`, any classes\n you create will have useful string representations when calling `toString()`.\n See the `Ember.Namespace` documentation for more information.\n\n While you can think of your `Ember.Application` as a container that holds the\n other classes in your application, there are several other responsibilities\n going on under-the-hood that you may want to understand.\n\n ### Event Delegation\n\n Ember uses a technique called _event delegation_. This allows the framework\n to set up a global, shared event listener instead of requiring each view to\n do it manually. For example, instead of each view registering its own\n `mousedown` listener on its associated element, Ember sets up a `mousedown`\n listener on the `body`.\n\n If a `mousedown` event occurs, Ember will look at the target of the event and\n start walking up the DOM node tree, finding corresponding views and invoking\n their `mouseDown` method as it goes.\n\n `Ember.Application` has a number of default events that it listens for, as\n well as a mapping from lowercase events to camel-cased view method names. For\n example, the `keypress` event causes the `keyPress` method on the view to be\n called, the `dblclick` event causes `doubleClick` to be called, and so on.\n\n If there is a bubbling browser event that Ember does not listen for by\n default, you can specify custom events and their corresponding view method\n names by setting the application's `customEvents` property:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the paste event\n paste: \"paste\"\n }\n });\n ```\n\n By default, the application sets up these event listeners on the document\n body. However, in cases where you are embedding an Ember application inside\n an existing page, you may want it to set up the listeners on an element\n inside the body.\n\n For example, if only events inside a DOM element with the ID of `ember-app`\n should be delegated, set your application's `rootElement` property:\n\n ```javascript\n window.App = Ember.Application.create({\n rootElement: '#ember-app'\n });\n ```\n\n The `rootElement` can be either a DOM element or a jQuery-compatible selector\n string. Note that *views appended to the DOM outside the root element will\n not receive events.* If you specify a custom root element, make sure you only\n append views inside it!\n\n To learn more about the advantages of event delegation and the Ember view\n layer, and a list of the event listeners that are setup by default, visit the\n [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation).\n\n ### Initializers\n\n Libraries on top of Ember can add initializers, like so:\n\n ```javascript\n Ember.Application.initializer({\n name: 'api-adapter',\n\n initialize: function(container, application) {\n application.register('api-adapter:main', ApiAdapter);\n }\n });\n ```\n\n Initializers provide an opportunity to access the container, which\n organizes the different components of an Ember application. Additionally\n they provide a chance to access the instantiated application. Beyond\n being used for libraries, initializers are also a great way to organize\n dependency injection or setup in your own application.\n\n ### Routing\n\n In addition to creating your application's router, `Ember.Application` is\n also responsible for telling the router when to start routing. Transitions\n between routes can be logged with the `LOG_TRANSITIONS` flag, and more\n detailed intra-transition logging can be logged with\n the `LOG_TRANSITIONS_INTERNAL` flag:\n\n ```javascript\n window.App = Ember.Application.create({\n LOG_TRANSITIONS: true, // basic logging of successful transitions\n LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n });\n ```\n\n By default, the router will begin trying to translate the current URL into\n application state once the browser emits the `DOMContentReady` event. If you\n need to defer routing, you can call the application's `deferReadiness()`\n method. Once routing can begin, call the `advanceReadiness()` method.\n\n If there is any setup required before routing begins, you can implement a\n `ready()` method on your app that will be invoked immediately before routing\n begins.\n ```\n\n @class Application\n @namespace Ember\n @extends Ember.Namespace\n */\n\n var Application = Namespace.extend(DeferredMixin, {\n\n /**\n The root DOM element of the Application. This can be specified as an\n element or a\n [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).\n\n This is the element that will be passed to the Application's,\n `eventDispatcher`, which sets up the listeners for event delegation. Every\n view in your application should be a child of the element you specify here.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n The `Ember.EventDispatcher` responsible for delegating events to this\n application's views.\n\n The event dispatcher is created by the application at initialization time\n and sets up event listeners on the DOM element described by the\n application's `rootElement` property.\n\n See the documentation for `Ember.EventDispatcher` for more information.\n\n @property eventDispatcher\n @type Ember.EventDispatcher\n @default null\n */\n eventDispatcher: null,\n\n /**\n The DOM events for which the event dispatcher should listen.\n\n By default, the application's `Ember.EventDispatcher` listens\n for a set of standard DOM events, such as `mousedown` and\n `keyup`, and delegates them to your application's `Ember.View`\n instances.\n\n If you would like additional bubbling events to be delegated to your\n views, set your `Ember.Application`'s `customEvents` property\n to a hash containing the DOM event name as the key and the\n corresponding view method name as the value. For example:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the paste event\n paste: \"paste\"\n }\n });\n ```\n\n @property customEvents\n @type Object\n @default null\n */\n customEvents: null,\n\n // Start off the number of deferrals at 1. This will be\n // decremented by the Application's own `initialize` method.\n _readinessDeferrals: 1,\n\n init: function() {\n if (!this.$) { this.$ = jQuery; }\n this.__container__ = this.buildContainer();\n\n this.Router = this.defaultRouter();\n\n this._super();\n\n this.scheduleInitialize();\n\n Ember.libraries.registerCoreLibrary('Handlebars', EmberHandlebars.VERSION);\n Ember.libraries.registerCoreLibrary('jQuery', jQuery().jquery);\n\n if ( Ember.LOG_VERSION ) {\n Ember.LOG_VERSION = false; // we only need to see this once per Application#init\n\n var nameLengths = EnumerableUtils.map(Ember.libraries, function(item) {\n return get(item, \"name.length\");\n });\n\n var maxNameLength = Math.max.apply(this, nameLengths);\n\n Ember.debug('-------------------------------');\n Ember.libraries.each(function(name, version) {\n var spaces = new Array(maxNameLength - name.length + 1).join(\" \");\n Ember.debug([name, spaces, ' : ', version].join(\"\"));\n });\n Ember.debug('-------------------------------');\n }\n },\n\n /**\n Build the container for the current application.\n\n Also register a default application view in case the application\n itself does not.\n\n @private\n @method buildContainer\n @return {Ember.Container} the configured container\n */\n buildContainer: function() {\n var container = this.__container__ = Application.buildContainer(this);\n\n return container;\n },\n\n /**\n If the application has not opted out of routing and has not explicitly\n defined a router, supply a default router for the application author\n to configure.\n\n This allows application developers to do:\n\n ```javascript\n var App = Ember.Application.create();\n\n App.Router.map(function() {\n this.resource('posts');\n });\n ```\n\n @private\n @method defaultRouter\n @return {Ember.Router} the default router\n */\n\n defaultRouter: function() {\n if (this.Router === false) { return; }\n var container = this.__container__;\n\n if (this.Router) {\n container.unregister('router:main');\n container.register('router:main', this.Router);\n }\n\n return container.lookupFactory('router:main');\n },\n\n /**\n Automatically initialize the application once the DOM has\n become ready.\n\n The initialization itself is scheduled on the actions queue\n which ensures that application loading finishes before\n booting.\n\n If you are asynchronously loading code, you should call\n `deferReadiness()` to defer booting, and then call\n `advanceReadiness()` once all of your code has finished\n loading.\n\n @private\n @method scheduleInitialize\n */\n scheduleInitialize: function() {\n var self = this;\n\n if (!this.$ || this.$.isReady) {\n run.schedule('actions', self, '_initialize');\n } else {\n this.$().ready(function runInitialize() {\n run(self, '_initialize');\n });\n }\n },\n\n /**\n Use this to defer readiness until some condition is true.\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n App.deferReadiness();\n\n jQuery.getJSON(\"/auth-token\", function(token) {\n App.token = token;\n App.advanceReadiness();\n });\n ```\n\n This allows you to perform asynchronous setup logic and defer\n booting your application until the setup has finished.\n\n However, if the setup requires a loading UI, it might be better\n to use the router for this purpose.\n\n @method deferReadiness\n */\n deferReadiness: function() {\n Ember.assert(\"You must call deferReadiness on an instance of Ember.Application\", this instanceof Application);\n Ember.assert(\"You cannot defer readiness since the `ready()` hook has already been called.\", this._readinessDeferrals > 0);\n this._readinessDeferrals++;\n },\n\n /**\n Call `advanceReadiness` after any asynchronous setup logic has completed.\n Each call to `deferReadiness` must be matched by a call to `advanceReadiness`\n or the application will never become ready and routing will not begin.\n\n @method advanceReadiness\n @see {Ember.Application#deferReadiness}\n */\n advanceReadiness: function() {\n Ember.assert(\"You must call advanceReadiness on an instance of Ember.Application\", this instanceof Application);\n this._readinessDeferrals--;\n\n if (this._readinessDeferrals === 0) {\n run.once(this, this.didBecomeReady);\n }\n },\n\n /**\n Registers a factory that can be used for dependency injection (with\n `App.inject`) or for service lookup. Each factory is registered with\n a full name including two parts: `type:name`.\n\n A simple example:\n\n ```javascript\n var App = Ember.Application.create();\n App.Orange = Ember.Object.extend();\n App.register('fruit:favorite', App.Orange);\n ```\n\n Ember will resolve factories from the `App` namespace automatically.\n For example `App.CarsController` will be discovered and returned if\n an application requests `controller:cars`.\n\n An example of registering a controller with a non-standard name:\n\n ```javascript\n var App = Ember.Application.create(),\n Session = Ember.Controller.extend();\n\n App.register('controller:session', Session);\n\n // The Session controller can now be treated like a normal controller,\n // despite its non-standard name.\n App.ApplicationController = Ember.Controller.extend({\n needs: ['session']\n });\n ```\n\n Registered factories are **instantiated** by having `create`\n called on them. Additionally they are **singletons**, each time\n they are looked up they return the same instance.\n\n Some examples modifying that default behavior:\n\n ```javascript\n var App = Ember.Application.create();\n\n App.Person = Ember.Object.extend();\n App.Orange = Ember.Object.extend();\n App.Email = Ember.Object.extend();\n App.session = Ember.Object.create();\n\n App.register('model:user', App.Person, {singleton: false });\n App.register('fruit:favorite', App.Orange);\n App.register('communication:main', App.Email, {singleton: false});\n App.register('session', App.session, {instantiate: false});\n ```\n\n @method register\n @param fullName {String} type:name (e.g., 'model:user')\n @param factory {Function} (e.g., App.Person)\n @param options {Object} (optional) disable instantiation or singleton usage\n **/\n register: function() {\n var container = this.__container__;\n container.register.apply(container, arguments);\n },\n\n /**\n Define a dependency injection onto a specific factory or all factories\n of a type.\n\n When Ember instantiates a controller, view, or other framework component\n it can attach a dependency to that component. This is often used to\n provide services to a set of framework components.\n\n An example of providing a session object to all controllers:\n\n ```javascript\n var App = Ember.Application.create(),\n Session = Ember.Object.extend({ isAuthenticated: false });\n\n // A factory must be registered before it can be injected\n App.register('session:main', Session);\n\n // Inject 'session:main' onto all factories of the type 'controller'\n // with the name 'session'\n App.inject('controller', 'session', 'session:main');\n\n App.IndexController = Ember.Controller.extend({\n isLoggedIn: Ember.computed.alias('session.isAuthenticated')\n });\n ```\n\n Injections can also be performed on specific factories.\n\n ```javascript\n App.inject(<full_name or type>, <property name>, <full_name>)\n App.inject('route', 'source', 'source:main')\n App.inject('route:application', 'email', 'model:email')\n ```\n\n It is important to note that injections can only be performed on\n classes that are instantiated by Ember itself. Instantiating a class\n directly (via `create` or `new`) bypasses the dependency injection\n system.\n\n Ember-Data instantiates its models in a unique manner, and consequently\n injections onto models (or all models) will not work as expected. Injections\n on models can be enabled by setting `Ember.MODEL_FACTORY_INJECTIONS`\n to `true`.\n\n @method inject\n @param factoryNameOrType {String}\n @param property {String}\n @param injectionName {String}\n **/\n inject: function() {\n var container = this.__container__;\n container.injection.apply(container, arguments);\n },\n\n /**\n Calling initialize manually is not supported.\n\n Please see Ember.Application#advanceReadiness and\n Ember.Application#deferReadiness.\n\n @private\n @deprecated\n @method initialize\n **/\n initialize: function() {\n Ember.deprecate('Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and Ember.Application#deferReadiness');\n },\n\n /**\n Initialize the application. This happens automatically.\n\n Run any initializers and run the application load hook. These hooks may\n choose to defer readiness. For example, an authentication hook might want\n to defer readiness until the auth token has been retrieved.\n\n @private\n @method _initialize\n */\n _initialize: function() {\n if (this.isDestroyed) { return; }\n\n // At this point, the App.Router must already be assigned\n if (this.Router) {\n var container = this.__container__;\n container.unregister('router:main');\n container.register('router:main', this.Router);\n }\n\n this.runInitializers();\n runLoadHooks('application', this);\n\n // At this point, any initializers or load hooks that would have wanted\n // to defer readiness have fired. In general, advancing readiness here\n // will proceed to didBecomeReady.\n this.advanceReadiness();\n\n return this;\n },\n\n /**\n Reset the application. This is typically used only in tests. It cleans up\n the application in the following order:\n\n 1. Deactivate existing routes\n 2. Destroy all objects in the container\n 3. Create a new application container\n 4. Re-route to the existing url\n\n Typical Example:\n\n ```javascript\n\n var App;\n\n run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n App.reset();\n }\n });\n\n test(\"first test\", function() {\n // App is freshly reset\n });\n\n test(\"first test\", function() {\n // App is again freshly reset\n });\n ```\n\n Advanced Example:\n\n Occasionally you may want to prevent the app from initializing during\n setup. This could enable extra configuration, or enable asserting prior\n to the app becoming ready.\n\n ```javascript\n\n var App;\n\n run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n run(function() {\n App.reset();\n App.deferReadiness();\n });\n }\n });\n\n test(\"first test\", function() {\n ok(true, 'something before app is initialized');\n\n run(function() {\n App.advanceReadiness();\n });\n ok(true, 'something after app is initialized');\n });\n ```\n\n @method reset\n **/\n reset: function() {\n this._readinessDeferrals = 1;\n\n function handleReset() {\n var router = this.__container__.lookup('router:main');\n router.reset();\n\n run(this.__container__, 'destroy');\n\n this.buildContainer();\n\n run.schedule('actions', this, function() {\n this._initialize();\n });\n }\n\n run.join(this, handleReset);\n },\n\n /**\n @private\n @method runInitializers\n */\n runInitializers: function() {\n var initializers = get(this.constructor, 'initializers'),\n container = this.__container__,\n graph = new DAG(),\n namespace = this,\n name, initializer;\n\n for (name in initializers) {\n initializer = initializers[name];\n graph.addEdges(initializer.name, initializer.initialize, initializer.before, initializer.after);\n }\n\n graph.topsort(function (vertex) {\n var initializer = vertex.value;\n Ember.assert(\"No application initializer named '\"+vertex.name+\"'\", initializer);\n initializer(container, namespace);\n });\n },\n\n /**\n @private\n @method didBecomeReady\n */\n didBecomeReady: function() {\n this.setupEventDispatcher();\n this.ready(); // user hook\n this.startRouting();\n\n if (!Ember.testing) {\n // Eagerly name all classes that are already loaded\n Ember.Namespace.processAll();\n Ember.BOOTED = true;\n }\n\n this.resolve(this);\n },\n\n /**\n Setup up the event dispatcher to receive events on the\n application's `rootElement` with any registered\n `customEvents`.\n\n @private\n @method setupEventDispatcher\n */\n setupEventDispatcher: function() {\n var customEvents = get(this, 'customEvents'),\n rootElement = get(this, 'rootElement'),\n dispatcher = this.__container__.lookup('event_dispatcher:main');\n\n set(this, 'eventDispatcher', dispatcher);\n dispatcher.setup(customEvents, rootElement);\n },\n\n /**\n If the application has a router, use it to route to the current URL, and\n trigger a new call to `route` whenever the URL changes.\n\n @private\n @method startRouting\n @property router {Ember.Router}\n */\n startRouting: function() {\n var router = this.__container__.lookup('router:main');\n if (!router) { return; }\n\n router.startRouting();\n },\n\n handleURL: function(url) {\n var router = this.__container__.lookup('router:main');\n\n router.handleURL(url);\n },\n\n /**\n Called when the Application has become ready.\n The call will be delayed until the DOM has become ready.\n\n @event ready\n */\n ready: K,\n\n /**\n @deprecated Use 'Resolver' instead\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n\n @property resolver\n */\n resolver: null,\n\n /**\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n @property resolver\n */\n Resolver: null,\n\n willDestroy: function() {\n Ember.BOOTED = false;\n // Ensure deactivation of routes before objects are destroyed\n this.__container__.lookup('router:main').reset();\n\n this.__container__.destroy();\n },\n\n initializer: function(options) {\n this.constructor.initializer(options);\n }\n });\n\n Application.reopenClass({\n initializers: {},\n\n /**\n Initializer receives an object which has the following attributes:\n `name`, `before`, `after`, `initialize`. The only required attribute is\n `initialize, all others are optional.\n\n * `name` allows you to specify under which name the initializer is registered.\n This must be a unique name, as trying to register two initializers with the\n same name will result in an error.\n\n ```javascript\n Ember.Application.initializer({\n name: 'namedInitializer',\n initialize: function(container, application) {\n Ember.debug(\"Running namedInitializer!\");\n }\n });\n ```\n\n * `before` and `after` are used to ensure that this initializer is ran prior\n or after the one identified by the value. This value can be a single string\n or an array of strings, referencing the `name` of other initializers.\n\n An example of ordering initializers, we create an initializer named `first`:\n\n ```javascript\n Ember.Application.initializer({\n name: 'first',\n initialize: function(container, application) {\n Ember.debug(\"First initializer!\");\n }\n });\n\n // DEBUG: First initializer!\n ```\n\n We add another initializer named `second`, specifying that it should run\n after the initializer named `first`:\n\n ```javascript\n Ember.Application.initializer({\n name: 'second',\n after: 'first',\n\n initialize: function(container, application) {\n Ember.debug(\"Second initializer!\");\n }\n });\n\n // DEBUG: First initializer!\n // DEBUG: Second initializer!\n ```\n\n Afterwards we add a further initializer named `pre`, this time specifying\n that it should run before the initializer named `first`:\n\n ```javascript\n Ember.Application.initializer({\n name: 'pre',\n before: 'first',\n\n initialize: function(container, application) {\n Ember.debug(\"Pre initializer!\");\n }\n });\n\n // DEBUG: Pre initializer!\n // DEBUG: First initializer!\n // DEBUG: Second initializer!\n ```\n\n Finally we add an initializer named `post`, specifying it should run after\n both the `first` and the `second` initializers:\n\n ```javascript\n Ember.Application.initializer({\n name: 'post',\n after: ['first', 'second'],\n\n initialize: function(container, application) {\n Ember.debug(\"Post initializer!\");\n }\n });\n\n // DEBUG: Pre initializer!\n // DEBUG: First initializer!\n // DEBUG: Second initializer!\n // DEBUG: Post initializer!\n ```\n\n * `initialize` is a callback function that receives two arguments, `container`\n and `application` on which you can operate.\n\n Example of using `container` to preload data into the store:\n\n ```javascript\n Ember.Application.initializer({\n name: \"preload-data\",\n\n initialize: function(container, application) {\n var store = container.lookup('store:main');\n store.pushPayload(preloadedData);\n }\n });\n ```\n\n Example of using `application` to register an adapter:\n\n ```javascript\n Ember.Application.initializer({\n name: 'api-adapter',\n\n initialize: function(container, application) {\n application.register('api-adapter:main', ApiAdapter);\n }\n });\n ```\n\n @method initializer\n @param initializer {Object}\n */\n initializer: function(initializer) {\n // If this is the first initializer being added to a subclass, we are going to reopen the class\n // to make sure we have a new `initializers` object, which extends from the parent class' using\n // prototypal inheritance. Without this, attempting to add initializers to the subclass would\n // pollute the parent class as well as other subclasses.\n if (this.superclass.initializers !== undefined && this.superclass.initializers === this.initializers) {\n this.reopenClass({\n initializers: create(this.initializers)\n });\n }\n\n Ember.assert(\"The initializer '\" + initializer.name + \"' has already been registered\", !this.initializers[initializer.name]);\n Ember.assert(\"An initializer cannot be registered without an initialize function\", canInvoke(initializer, 'initialize'));\n\n this.initializers[initializer.name] = initializer;\n },\n\n /**\n This creates a container with the default Ember naming conventions.\n\n It also configures the container:\n\n * registered views are created every time they are looked up (they are\n not singletons)\n * registered templates are not factories; the registered value is\n returned directly.\n * the router receives the application as its `namespace` property\n * all controllers receive the router as their `target` and `controllers`\n properties\n * all controllers receive the application as their `namespace` property\n * the application view receives the application controller as its\n `controller` property\n * the application view receives the application template as its\n `defaultTemplate` property\n\n @private\n @method buildContainer\n @static\n @param {Ember.Application} namespace the application to build the\n container for.\n @return {Ember.Container} the built container\n */\n buildContainer: function(namespace) {\n var container = new Container();\n\n Container.defaultContainer = new DeprecatedContainer(container);\n\n container.set = set;\n container.resolver = resolverFor(namespace);\n container.normalize = container.resolver.normalize;\n container.describe = container.resolver.describe;\n container.makeToString = container.resolver.makeToString;\n\n container.optionsForType('component', { singleton: false });\n container.optionsForType('view', { singleton: false });\n container.optionsForType('template', { instantiate: false });\n container.optionsForType('helper', { instantiate: false });\n\n container.register('application:main', namespace, { instantiate: false });\n\n container.register('controller:basic', Controller, { instantiate: false });\n container.register('controller:object', ObjectController, { instantiate: false });\n container.register('controller:array', ArrayController, { instantiate: false });\n container.register('route:basic', Route, { instantiate: false });\n container.register('event_dispatcher:main', EventDispatcher);\n\n container.register('router:main', Router);\n container.injection('router:main', 'namespace', 'application:main');\n\n container.register('location:auto', AutoLocation);\n container.register('location:hash', HashLocation);\n container.register('location:history', HistoryLocation);\n container.register('location:none', NoneLocation);\n\n container.injection('controller', 'target', 'router:main');\n container.injection('controller', 'namespace', 'application:main');\n\n container.injection('route', 'router', 'router:main');\n container.injection('location', 'rootURL', '-location-setting:root-url');\n\n // DEBUGGING\n container.register('resolver-for-debugging:main', container.resolver.__resolver__, { instantiate: false });\n container.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main');\n container.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main');\n // Custom resolver authors may want to register their own ContainerDebugAdapter with this key\n\n // ES6TODO: resolve this via import once ember-application package is ES6'ed\n requireModule('ember-extension-support');\n container.register('container-debug-adapter:main', ContainerDebugAdapter);\n\n return container;\n }\n });\n\n /**\n This function defines the default lookup rules for container lookups:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after classifying the name.\n For example, `controller:post` looks up `App.PostController` by default.\n * if the default lookup fails, look for registered classes on the container\n\n This allows the application to register default injections in the container\n that could be overridden by the normal naming convention.\n\n @private\n @method resolverFor\n @param {Ember.Namespace} namespace the namespace to look for classes\n @return {*} the resolved value for a given lookup\n */\n function resolverFor(namespace) {\n if (namespace.get('resolver')) {\n Ember.deprecate('Application.resolver is deprecated in favor of Application.Resolver', false);\n }\n\n var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || DefaultResolver;\n var resolver = ResolverClass.create({\n namespace: namespace\n });\n\n function resolve(fullName) {\n return resolver.resolve(fullName);\n }\n\n resolve.describe = function(fullName) {\n return resolver.lookupDescription(fullName);\n };\n\n resolve.makeToString = function(factory, fullName) {\n return resolver.makeToString(factory, fullName);\n };\n\n resolve.normalize = function(fullName) {\n if (resolver.normalize) {\n return resolver.normalize(fullName);\n } else {\n Ember.deprecate('The Resolver should now provide a \\'normalize\\' function', false);\n return fullName;\n }\n };\n\n resolve.__resolver__ = resolver;\n\n return resolve;\n }\n\n __exports__[\"default\"] = Application;\n });\ndefine(\"ember-application/system/dag\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n function visit(vertex, fn, visited, path) {\n var name = vertex.name,\n vertices = vertex.incoming,\n names = vertex.incomingNames,\n len = names.length,\n i;\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n }\n\n function DAG() {\n this.names = [];\n this.vertices = {};\n }\n\n DAG.prototype.add = function(name) {\n if (!name) { return; }\n if (this.vertices.hasOwnProperty(name)) {\n return this.vertices[name];\n }\n var vertex = {\n name: name, incoming: {}, incomingNames: [], hasOutgoing: false, value: null\n };\n this.vertices[name] = vertex;\n this.names.push(name);\n return vertex;\n };\n\n DAG.prototype.map = function(name, value) {\n this.add(name).value = value;\n };\n\n DAG.prototype.addEdge = function(fromName, toName) {\n if (!fromName || !toName || fromName === toName) {\n return;\n }\n var from = this.add(fromName), to = this.add(toName);\n if (to.incoming.hasOwnProperty(fromName)) {\n return;\n }\n function checkCycle(vertex, path) {\n if (vertex.name === toName) {\n throw new EmberError(\"cycle detected: \" + toName + \" <- \" + path.join(\" <- \"));\n }\n }\n visit(from, checkCycle);\n from.hasOutgoing = true;\n to.incoming[fromName] = from;\n to.incomingNames.push(fromName);\n };\n\n DAG.prototype.topsort = function(fn) {\n var visited = {},\n vertices = this.vertices,\n names = this.names,\n len = names.length,\n i, vertex;\n for (i = 0; i < len; i++) {\n vertex = vertices[names[i]];\n if (!vertex.hasOutgoing) {\n visit(vertex, fn, visited);\n }\n }\n };\n\n DAG.prototype.addEdges = function(name, value, before, after) {\n var i;\n this.map(name, value);\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n for (i = 0; i < before.length; i++) {\n this.addEdge(name, before[i]);\n }\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n for (i = 0; i < after.length; i++) {\n this.addEdge(after[i], name);\n }\n }\n }\n };\n\n __exports__[\"default\"] = DAG;\n });\ndefine(\"ember-application/system/resolver\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/logger\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-runtime/system/namespace\",\"ember-handlebars\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-application\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.TEMPLATES, Ember.assert\n var get = __dependency2__.get;\n var Logger = __dependency3__[\"default\"];\n var classify = __dependency4__.classify;\n var capitalize = __dependency4__.capitalize;\n var decamelize = __dependency4__.decamelize;\n var EmberObject = __dependency5__[\"default\"];\n var Namespace = __dependency6__[\"default\"];\n var EmberHandlebars = __dependency7__[\"default\"];\n\n var Resolver = EmberObject.extend({\n /**\n This will be set to the Application instance when it is\n created.\n\n @property namespace\n */\n namespace: null,\n normalize: function(fullName) {\n throw new Error(\"Invalid call to `resolver.normalize(fullName)`. Please override the 'normalize' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n resolve: function(fullName) {\n throw new Error(\"Invalid call to `resolver.resolve(parsedName)`. Please override the 'resolve' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n parseName: function(parsedName) {\n throw new Error(\"Invalid call to `resolver.resolveByType(parsedName)`. Please override the 'resolveByType' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n lookupDescription: function(fullName) {\n throw new Error(\"Invalid call to `resolver.lookupDescription(fullName)`. Please override the 'lookupDescription' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n makeToString: function(factory, fullName) {\n throw new Error(\"Invalid call to `resolver.makeToString(factory, fullName)`. Please override the 'makeToString' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n resolveOther: function(parsedName) {\n throw new Error(\"Invalid call to `resolver.resolveOther(parsedName)`. Please override the 'resolveOther' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n _logLookup: function(found, parsedName) {\n throw new Error(\"Invalid call to `resolver._logLookup(found, parsedName)`. Please override the '_logLookup' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n }\n });\n\n\n\n /**\n The DefaultResolver defines the default lookup rules to resolve\n container lookups before consulting the container for registered\n items:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after converting\n the name. For example, `controller:post` looks up\n `App.PostController` by default.\n * there are some nuances (see examples below)\n\n ### How Resolving Works\n\n The container calls this object's `resolve` method with the\n `fullName` argument.\n\n It first parses the fullName into an object using `parseName`.\n\n Then it checks for the presence of a type-specific instance\n method of the form `resolve[Type]` and calls it if it exists.\n For example if it was resolving 'template:post', it would call\n the `resolveTemplate` method.\n\n Its last resort is to call the `resolveOther` method.\n\n The methods of this object are designed to be easy to override\n in a subclass. For example, you could enhance how a template\n is resolved like so:\n\n ```javascript\n App = Ember.Application.create({\n Resolver: Ember.DefaultResolver.extend({\n resolveTemplate: function(parsedName) {\n var resolvedTemplate = this._super(parsedName);\n if (resolvedTemplate) { return resolvedTemplate; }\n return Ember.TEMPLATES['not_found'];\n }\n })\n });\n ```\n\n Some examples of how names are resolved:\n\n ```\n 'template:post' //=> Ember.TEMPLATES['post']\n 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:blogPost' //=> Ember.TEMPLATES['blogPost']\n // OR\n // Ember.TEMPLATES['blog_post']\n 'controller:post' //=> App.PostController\n 'controller:posts.index' //=> App.PostsIndexController\n 'controller:blog/post' //=> Blog.PostController\n 'controller:basic' //=> Ember.Controller\n 'route:post' //=> App.PostRoute\n 'route:posts.index' //=> App.PostsIndexRoute\n 'route:blog/post' //=> Blog.PostRoute\n 'route:basic' //=> Ember.Route\n 'view:post' //=> App.PostView\n 'view:posts.index' //=> App.PostsIndexView\n 'view:blog/post' //=> Blog.PostView\n 'view:basic' //=> Ember.View\n 'foo:post' //=> App.PostFoo\n 'model:post' //=> App.Post\n ```\n\n @class DefaultResolver\n @namespace Ember\n @extends Ember.Object\n */\n var DefaultResolver = EmberObject.extend({\n /**\n This will be set to the Application instance when it is\n created.\n\n @property namespace\n */\n namespace: null,\n\n normalize: function(fullName) {\n var split = fullName.split(':', 2),\n type = split[0],\n name = split[1];\n\n Ember.assert(\"Tried to normalize a container name without a colon (:) in it. You probably tried to lookup a name that did not contain a type, a colon, and a name. A proper lookup name would be `view:post`.\", split.length === 2);\n\n if (type !== 'template') {\n var result = name;\n\n if (result.indexOf('.') > -1) {\n result = result.replace(/\\.(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n if (name.indexOf('_') > -1) {\n result = result.replace(/_(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n return type + ':' + result;\n } else {\n return fullName;\n }\n },\n\n\n /**\n This method is called via the container's resolver method.\n It parses the provided `fullName` and then looks up and\n returns the appropriate template or class.\n\n @method resolve\n @param {String} fullName the lookup string\n @return {Object} the resolved factory\n */\n resolve: function(fullName) {\n var parsedName = this.parseName(fullName),\n resolveMethodName = parsedName.resolveMethodName,\n resolved;\n\n if (!(parsedName.name && parsedName.type)) {\n throw new TypeError(\"Invalid fullName: `\" + fullName + \"`, must be of the form `type:name` \");\n }\n\n if (this[resolveMethodName]) {\n resolved = this[resolveMethodName](parsedName);\n }\n\n if (!resolved) {\n resolved = this.resolveOther(parsedName);\n }\n\n if (parsedName.root && parsedName.root.LOG_RESOLVER) {\n this._logLookup(resolved, parsedName);\n }\n\n return resolved;\n },\n /**\n Convert the string name of the form \"type:name\" to\n a Javascript object with the parsed aspects of the name\n broken out.\n\n @protected\n @param {String} fullName the lookup string\n @method parseName\n */\n parseName: function(fullName) {\n var nameParts = fullName.split(\":\"),\n type = nameParts[0], fullNameWithoutType = nameParts[1],\n name = fullNameWithoutType,\n namespace = get(this, 'namespace'),\n root = namespace;\n\n if (type !== 'template' && name.indexOf('/') !== -1) {\n var parts = name.split('/');\n name = parts[parts.length - 1];\n var namespaceName = capitalize(parts.slice(0, -1).join('.'));\n root = Namespace.byName(namespaceName);\n\n Ember.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root);\n }\n\n return {\n fullName: fullName,\n type: type,\n fullNameWithoutType: fullNameWithoutType,\n name: name,\n root: root,\n resolveMethodName: \"resolve\" + classify(type)\n };\n },\n\n /**\n Returns a human-readable description for a fullName. Used by the\n Application namespace in assertions to describe the\n precise name of the class that Ember is looking for, rather than\n container keys.\n\n @protected\n @param {String} fullName the lookup string\n @method lookupDescription\n */\n lookupDescription: function(fullName) {\n var parsedName = this.parseName(fullName);\n\n if (parsedName.type === 'template') {\n return \"template at \" + parsedName.fullNameWithoutType.replace(/\\./g, '/');\n }\n\n var description = parsedName.root + \".\" + classify(parsedName.name);\n if (parsedName.type !== 'model') { description += classify(parsedName.type); }\n\n return description;\n },\n\n makeToString: function(factory, fullName) {\n return factory.toString();\n },\n /**\n Given a parseName object (output from `parseName`), apply\n the conventions expected by `Ember.Router`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method useRouterNaming\n */\n useRouterNaming: function(parsedName) {\n parsedName.name = parsedName.name.replace(/\\./g, '_');\n if (parsedName.name === 'basic') {\n parsedName.name = '';\n }\n },\n /**\n Look up the template in Ember.TEMPLATES\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveTemplate\n */\n resolveTemplate: function(parsedName) {\n var templateName = parsedName.fullNameWithoutType.replace(/\\./g, '/');\n\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n\n templateName = decamelize(templateName);\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n },\n /**\n Lookup the view using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveView\n */\n resolveView: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the controller using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveController\n */\n resolveController: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the route using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveRoute\n */\n resolveRoute: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n\n /**\n Lookup the model on the Application namespace\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveModel\n */\n resolveModel: function(parsedName) {\n var className = classify(parsedName.name),\n factory = get(parsedName.root, className);\n\n if (factory) { return factory; }\n },\n /**\n Look up the specified object (from parsedName) on the appropriate\n namespace (usually on the Application)\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveHelper\n */\n resolveHelper: function(parsedName) {\n return this.resolveOther(parsedName) || EmberHandlebars.helpers[parsedName.fullNameWithoutType];\n },\n /**\n Look up the specified object (from parsedName) on the appropriate\n namespace (usually on the Application)\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveOther\n */\n resolveOther: function(parsedName) {\n var className = classify(parsedName.name) + classify(parsedName.type),\n factory = get(parsedName.root, className);\n if (factory) { return factory; }\n },\n\n /**\n @method _logLookup\n @param {Boolean} found\n @param {Object} parsedName\n @private\n */\n _logLookup: function(found, parsedName) {\n var symbol, padding;\n\n if (found) { symbol = '[✓]'; }\n else { symbol = '[ ]'; }\n\n if (parsedName.fullName.length > 60) {\n padding = '.';\n } else {\n padding = new Array(60 - parsedName.fullName.length).join('.');\n }\n\n Logger.info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName));\n }\n });\n\n __exports__.Resolver = Resolver;\n __exports__.DefaultResolver = DefaultResolver;\n });\n})();\n//@ sourceURL=ember-application");minispade.register('ember-debug', "(function() {define(\"ember-debug\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/logger\"],\n function(__dependency1__, __dependency2__, __dependency3__) {\n \"use strict\";\n /*global __fail__*/\n\n var Ember = __dependency1__[\"default\"];\n var EmberError = __dependency2__[\"default\"];\n var Logger = __dependency3__[\"default\"];\n\n /**\n Ember Debug\n\n @module ember\n @submodule ember-debug\n */\n\n /**\n @class Ember\n */\n\n /**\n Define an assertion that will throw an exception if the condition is not\n met. Ember build tools will remove any calls to `Ember.assert()` when\n doing a production build. Example:\n\n ```javascript\n // Test for truthiness\n Ember.assert('Must pass a valid object', obj);\n\n // Fail unconditionally\n Ember.assert('This code path should never be run');\n ```\n\n @method assert\n @param {String} desc A description of the assertion. This will become\n the text of the Error thrown if the assertion fails.\n @param {Boolean} test Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.\n */\n Ember.assert = function(desc, test) {\n if (!test) {\n throw new EmberError(\"Assertion Failed: \" + desc);\n }\n };\n\n\n /**\n Display a warning with the provided message. Ember build tools will\n remove any calls to `Ember.warn()` when doing a production build.\n\n @method warn\n @param {String} message A warning to display.\n @param {Boolean} test An optional boolean. If falsy, the warning\n will be displayed.\n */\n Ember.warn = function(message, test) {\n if (!test) {\n Logger.warn(\"WARNING: \"+message);\n if ('trace' in Logger) Logger.trace();\n }\n };\n\n /**\n Display a debug notice. Ember build tools will remove any calls to\n `Ember.debug()` when doing a production build.\n\n ```javascript\n Ember.debug('I\\'m a debug notice!');\n ```\n\n @method debug\n @param {String} message A debug message to display.\n */\n Ember.debug = function(message) {\n Logger.debug(\"DEBUG: \"+message);\n };\n\n /**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only). Ember build tools will remove any calls to\n `Ember.deprecate()` when doing a production build.\n\n @method deprecate\n @param {String} message A description of the deprecation.\n @param {Boolean} test An optional boolean. If falsy, the deprecation\n will be displayed.\n */\n Ember.deprecate = function(message, test) {\n if (test) { return; }\n\n if (Ember.ENV.RAISE_ON_DEPRECATION) { throw new EmberError(message); }\n\n var error;\n\n // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome\n try { __fail__.fail(); } catch (e) { error = e; }\n\n if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {\n var stack, stackStr = '';\n if (error['arguments']) {\n // Chrome\n stack = error.stack.replace(/^\\s+at\\s+/gm, '').\n replace(/^([^\\(]+?)([\\n$])/gm, '{anonymous}($1)$2').\n replace(/^Object.<anonymous>\\s*\\(([^\\)]+)\\)/gm, '{anonymous}($1)').split('\\n');\n stack.shift();\n } else {\n // Firefox\n stack = error.stack.replace(/(?:\\n@:0)?\\s+$/m, '').\n replace(/^\\(/gm, '{anonymous}(').split('\\n');\n }\n\n stackStr = \"\\n \" + stack.slice(2).join(\"\\n \");\n message = message + stackStr;\n }\n\n Logger.warn(\"DEPRECATION: \"+message);\n };\n\n\n\n /**\n Alias an old, deprecated method with its new counterpart.\n\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only) when the assigned method is called.\n\n Ember build tools will not remove calls to `Ember.deprecateFunc()`, though\n no warnings will be shown in production.\n\n ```javascript\n Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);\n ```\n\n @method deprecateFunc\n @param {String} message A description of the deprecation.\n @param {Function} func The new function called to replace its deprecated counterpart.\n @return {Function} a new function that wrapped the original function with a deprecation warning\n */\n Ember.deprecateFunc = function(message, func) {\n return function() {\n Ember.deprecate(message);\n return func.apply(this, arguments);\n };\n };\n\n\n /**\n Run a function meant for debugging. Ember build tools will remove any calls to\n `Ember.runInDebug()` when doing a production build.\n\n ```javascript\n Ember.runInDebug(function() {\n Ember.Handlebars.EachView.reopen({\n didInsertElement: function() {\n console.log('I\\'m happy');\n }\n });\n });\n ```\n\n @method runInDebug\n @param {Function} func The function to be executed.\n @since 1.5.0\n */\n Ember.runInDebug = function(func) {\n func()\n };\n\n // Inform the developer about the Ember Inspector if not installed.\n if (!Ember.testing) {\n var isFirefox = typeof InstallTrigger !== 'undefined';\n var isChrome = !!window.chrome && !window.opera;\n\n if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) {\n window.addEventListener(\"load\", function() {\n if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) {\n var downloadURL;\n\n if(isChrome) {\n downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi';\n } else if(isFirefox) {\n downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';\n }\n\n Ember.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL);\n }\n }, false);\n }\n }\n });\n})();\n//@ sourceURL=ember-debug");minispade.register('ember-extension-support', "(function() {minispade.require(\"ember-application\");\ndefine(\"ember-extension-support/container_debug_adapter\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-runtime/system/string\",\"ember-runtime/system/namespace\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var typeOf = __dependency2__.typeOf;\n var dasherize = __dependency3__.dasherize;\n var classify = __dependency3__.classify;\n var Namespace = __dependency4__[\"default\"];\n var EmberObject = __dependency5__[\"default\"];\n\n /**\n @module ember\n @submodule ember-extension-support\n */\n\n /**\n The `ContainerDebugAdapter` helps the container and resolver interface\n with tools that debug Ember such as the\n [Ember Extension](https://github.com/tildeio/ember-extension)\n for Chrome and Firefox.\n\n This class can be extended by a custom resolver implementer\n to override some of the methods with library-specific code.\n\n The methods likely to be overridden are:\n\n * `canCatalogEntriesByType`\n * `catalogEntriesByType`\n\n The adapter will need to be registered\n in the application's container as `container-debug-adapter:main`\n\n Example:\n\n ```javascript\n Application.initializer({\n name: \"containerDebugAdapter\",\n\n initialize: function(container, application) {\n application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n }\n });\n ```\n\n @class ContainerDebugAdapter\n @namespace Ember\n @extends EmberObject\n @since 1.5.0\n */\n var ContainerDebugAdapter = EmberObject.extend({\n /**\n The container of the application being debugged.\n This property will be injected\n on creation.\n\n @property container\n @default null\n */\n container: null,\n\n /**\n The resolver instance of the application\n being debugged. This property will be injected\n on creation.\n\n @property resolver\n @default null\n */\n resolver: null,\n\n /**\n Returns true if it is possible to catalog a list of available\n classes in the resolver for a given type.\n\n @method canCatalogEntriesByType\n @param {string} type The type. e.g. \"model\", \"controller\", \"route\"\n @return {boolean} whether a list is available for this type.\n */\n canCatalogEntriesByType: function(type) {\n if (type === 'model' || type === 'template') return false;\n return true;\n },\n\n /**\n Returns the available classes a given type.\n\n @method catalogEntriesByType\n @param {string} type The type. e.g. \"model\", \"controller\", \"route\"\n @return {Array} An array of strings.\n */\n catalogEntriesByType: function(type) {\n var namespaces = Ember.A(Namespace.NAMESPACES), types = Ember.A(), self = this;\n var typeSuffixRegex = new RegExp(classify(type) + \"$\");\n\n namespaces.forEach(function(namespace) {\n if (namespace !== Ember) {\n for (var key in namespace) {\n if (!namespace.hasOwnProperty(key)) { continue; }\n if (typeSuffixRegex.test(key)) {\n var klass = namespace[key];\n if (typeOf(klass) === 'class') {\n types.push(dasherize(key.replace(typeSuffixRegex, '')));\n }\n }\n }\n }\n });\n return types;\n }\n });\n\n __exports__[\"default\"] = ContainerDebugAdapter;\n });\ndefine(\"ember-extension-support/data_adapter\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/run_loop\",\"ember-runtime/system/string\",\"ember-runtime/system/namespace\",\"ember-runtime/system/object\",\"ember-runtime/system/native_array\",\"ember-application/system/application\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var run = __dependency3__[\"default\"];\n var dasherize = __dependency4__.dasherize;\n var Namespace = __dependency5__[\"default\"];\n var EmberObject = __dependency6__[\"default\"];\n var A = __dependency7__.A;\n var Application = __dependency8__[\"default\"];\n\n /**\n @module ember\n @submodule ember-extension-support\n */\n\n /**\n The `DataAdapter` helps a data persistence library\n interface with tools that debug Ember such\n as the [Ember Extension](https://github.com/tildeio/ember-extension)\n for Chrome and Firefox.\n\n This class will be extended by a persistence library\n which will override some of the methods with\n library-specific code.\n\n The methods likely to be overridden are:\n\n * `getFilters`\n * `detect`\n * `columnsForType`\n * `getRecords`\n * `getRecordColumnValues`\n * `getRecordKeywords`\n * `getRecordFilterValues`\n * `getRecordColor`\n * `observeRecord`\n\n The adapter will need to be registered\n in the application's container as `dataAdapter:main`\n\n Example:\n\n ```javascript\n Application.initializer({\n name: \"data-adapter\",\n\n initialize: function(container, application) {\n application.register('data-adapter:main', DS.DataAdapter);\n }\n });\n ```\n\n @class DataAdapter\n @namespace Ember\n @extends EmberObject\n */\n var DataAdapter = EmberObject.extend({\n init: function() {\n this._super();\n this.releaseMethods = A();\n },\n\n /**\n The container of the application being debugged.\n This property will be injected\n on creation.\n\n @property container\n @default null\n @since 1.3.0\n */\n container: null,\n\n\n /**\n The container-debug-adapter which is used\n to list all models.\n\n @property containerDebugAdapter\n @default undefined\n @since 1.5.0\n **/\n containerDebugAdapter: undefined,\n\n /**\n Number of attributes to send\n as columns. (Enough to make the record\n identifiable).\n\n @private\n @property attributeLimit\n @default 3\n @since 1.3.0\n */\n attributeLimit: 3,\n\n /**\n Stores all methods that clear observers.\n These methods will be called on destruction.\n\n @private\n @property releaseMethods\n @since 1.3.0\n */\n releaseMethods: A(),\n\n /**\n Specifies how records can be filtered.\n Records returned will need to have a `filterValues`\n property with a key for every name in the returned array.\n\n @public\n @method getFilters\n @return {Array} List of objects defining filters.\n The object should have a `name` and `desc` property.\n */\n getFilters: function() {\n return A();\n },\n\n /**\n Fetch the model types and observe them for changes.\n\n @public\n @method watchModelTypes\n\n @param {Function} typesAdded Callback to call to add types.\n Takes an array of objects containing wrapped types (returned from `wrapModelType`).\n\n @param {Function} typesUpdated Callback to call when a type has changed.\n Takes an array of objects containing wrapped types.\n\n @return {Function} Method to call to remove all observers\n */\n watchModelTypes: function(typesAdded, typesUpdated) {\n var modelTypes = this.getModelTypes(),\n self = this, typesToSend, releaseMethods = A();\n\n typesToSend = modelTypes.map(function(type) {\n var klass = type.klass;\n var wrapped = self.wrapModelType(klass, type.name);\n releaseMethods.push(self.observeModelType(klass, typesUpdated));\n return wrapped;\n });\n\n typesAdded(typesToSend);\n\n var release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n self.releaseMethods.removeObject(release);\n };\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n _nameToClass: function(type) {\n if (typeof type === 'string') {\n type = this.container.lookupFactory('model:' + type);\n }\n return type;\n },\n\n /**\n Fetch the records of a given type and observe them for changes.\n\n @public\n @method watchRecords\n\n @param {Function} recordsAdded Callback to call to add records.\n Takes an array of objects containing wrapped records.\n The object should have the following properties:\n columnValues: {Object} key and value of a table cell\n object: {Object} the actual record object\n\n @param {Function} recordsUpdated Callback to call when a record has changed.\n Takes an array of objects containing wrapped records.\n\n @param {Function} recordsRemoved Callback to call when a record has removed.\n Takes the following parameters:\n index: the array index where the records were removed\n count: the number of records removed\n\n @return {Function} Method to call to remove all observers\n */\n watchRecords: function(type, recordsAdded, recordsUpdated, recordsRemoved) {\n var self = this, releaseMethods = A(), records = this.getRecords(type), release;\n\n var recordUpdated = function(updatedRecord) {\n recordsUpdated([updatedRecord]);\n };\n\n var recordsToSend = records.map(function(record) {\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n return self.wrapRecord(record);\n });\n\n\n var contentDidChange = function(array, idx, removedCount, addedCount) {\n for (var i = idx; i < idx + addedCount; i++) {\n var record = array.objectAt(i);\n var wrapped = self.wrapRecord(record);\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n recordsAdded([wrapped]);\n }\n\n if (removedCount) {\n recordsRemoved(idx, removedCount);\n }\n };\n\n var observer = { didChange: contentDidChange, willChange: Ember.K };\n records.addArrayObserver(self, observer);\n\n release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n records.removeArrayObserver(self, observer);\n self.releaseMethods.removeObject(release);\n };\n\n recordsAdded(recordsToSend);\n\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n /**\n Clear all observers before destruction\n @private\n @method willDestroy\n */\n willDestroy: function() {\n this._super();\n this.releaseMethods.forEach(function(fn) {\n fn();\n });\n },\n\n /**\n Detect whether a class is a model.\n\n Test that against the model class\n of your persistence library\n\n @private\n @method detect\n @param {Class} klass The class to test\n @return boolean Whether the class is a model class or not\n */\n detect: function(klass) {\n return false;\n },\n\n /**\n Get the columns for a given model type.\n\n @private\n @method columnsForType\n @param {Class} type The model type\n @return {Array} An array of columns of the following format:\n name: {String} name of the column\n desc: {String} Humanized description (what would show in a table column name)\n */\n columnsForType: function(type) {\n return A();\n },\n\n /**\n Adds observers to a model type class.\n\n @private\n @method observeModelType\n @param {Class} type The model type class\n @param {Function} typesUpdated Called when a type is modified.\n @return {Function} The function to call to remove observers\n */\n\n observeModelType: function(type, typesUpdated) {\n var self = this, records = this.getRecords(type);\n\n var onChange = function() {\n typesUpdated([self.wrapModelType(type)]);\n };\n var observer = {\n didChange: function() {\n run.scheduleOnce('actions', this, onChange);\n },\n willChange: Ember.K\n };\n\n records.addArrayObserver(this, observer);\n\n var release = function() {\n records.removeArrayObserver(self, observer);\n };\n\n return release;\n },\n\n\n /**\n Wraps a given model type and observes changes to it.\n\n @private\n @method wrapModelType\n @param {Class} type A model class\n @param {String} Optional name of the class\n @return {Object} contains the wrapped type and the function to remove observers\n Format:\n type: {Object} the wrapped type\n The wrapped type has the following format:\n name: {String} name of the type\n count: {Integer} number of records available\n columns: {Columns} array of columns to describe the record\n object: {Class} the actual Model type class\n release: {Function} The function to remove observers\n */\n wrapModelType: function(type, name) {\n var release, records = this.getRecords(type),\n typeToSend, self = this;\n\n typeToSend = {\n name: name || type.toString(),\n count: get(records, 'length'),\n columns: this.columnsForType(type),\n object: type\n };\n\n\n return typeToSend;\n },\n\n\n /**\n Fetches all models defined in the application.\n\n @private\n @method getModelTypes\n @return {Array} Array of model types\n */\n getModelTypes: function() {\n var types, self = this,\n containerDebugAdapter = this.get('containerDebugAdapter');\n\n if (containerDebugAdapter.canCatalogEntriesByType('model')) {\n types = containerDebugAdapter.catalogEntriesByType('model');\n } else {\n types = this._getObjectsOnNamespaces();\n }\n\n // New adapters return strings instead of classes\n types = A(types).map(function(name) {\n return {\n klass: self._nameToClass(name),\n name: name\n };\n });\n types = A(types).filter(function(type) {\n return self.detect(type.klass);\n });\n\n return A(types);\n },\n\n /**\n Loops over all namespaces and all objects\n attached to them\n\n @private\n @method _getObjectsOnNamespaces\n @return {Array} Array of model type strings\n */\n _getObjectsOnNamespaces: function() {\n var namespaces = A(Namespace.NAMESPACES),\n types = A(),\n self = this;\n\n namespaces.forEach(function(namespace) {\n for (var key in namespace) {\n if (!namespace.hasOwnProperty(key)) { continue; }\n // Even though we will filter again in `getModelTypes`,\n // we should not call `lookupContainer` on non-models\n // (especially when `Ember.MODEL_FACTORY_INJECTIONS` is `true`)\n if (!self.detect(namespace[key])) { continue; }\n var name = dasherize(key);\n if (!(namespace instanceof Application) && namespace.toString()) {\n name = namespace + '/' + name;\n }\n types.push(name);\n }\n });\n return types;\n },\n\n /**\n Fetches all loaded records for a given type.\n\n @private\n @method getRecords\n @return {Array} An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.\n */\n getRecords: function(type) {\n return A();\n },\n\n /**\n Wraps a record and observers changes to it.\n\n @private\n @method wrapRecord\n @param {Object} record The record instance.\n @return {Object} The wrapped record. Format:\n columnValues: {Array}\n searchKeywords: {Array}\n */\n wrapRecord: function(record) {\n var recordToSend = { object: record }, columnValues = {}, self = this;\n\n recordToSend.columnValues = this.getRecordColumnValues(record);\n recordToSend.searchKeywords = this.getRecordKeywords(record);\n recordToSend.filterValues = this.getRecordFilterValues(record);\n recordToSend.color = this.getRecordColor(record);\n\n return recordToSend;\n },\n\n /**\n Gets the values for each column.\n\n @private\n @method getRecordColumnValues\n @return {Object} Keys should match column names defined\n by the model type.\n */\n getRecordColumnValues: function(record) {\n return {};\n },\n\n /**\n Returns keywords to match when searching records.\n\n @private\n @method getRecordKeywords\n @return {Array} Relevant keywords for search.\n */\n getRecordKeywords: function(record) {\n return A();\n },\n\n /**\n Returns the values of filters defined by `getFilters`.\n\n @private\n @method getRecordFilterValues\n @param {Object} record The record instance\n @return {Object} The filter values\n */\n getRecordFilterValues: function(record) {\n return {};\n },\n\n /**\n Each record can have a color that represents its state.\n\n @private\n @method getRecordColor\n @param {Object} record The record instance\n @return {String} The record's color\n Possible options: black, red, blue, green\n */\n getRecordColor: function(record) {\n return null;\n },\n\n /**\n Observes all relevant properties and re-sends the wrapped record\n when a change occurs.\n\n @private\n @method observerRecord\n @param {Object} record The record instance\n @param {Function} recordUpdated The callback to call when a record is updated.\n @return {Function} The function to call to remove all observers.\n */\n observeRecord: function(record, recordUpdated) {\n return function(){};\n }\n\n });\n\n __exports__[\"default\"] = DataAdapter;\n });\ndefine(\"ember-extension-support/initializers\",\n [],\n function() {\n \"use strict\";\n\n });\ndefine(\"ember-extension-support\",\n [\"ember-metal/core\",\"ember-extension-support/data_adapter\",\"ember-extension-support/container_debug_adapter\"],\n function(__dependency1__, __dependency2__, __dependency3__) {\n \"use strict\";\n /**\n Ember Extension Support\n\n @module ember\n @submodule ember-extension-support\n @requires ember-application\n */\n\n var Ember = __dependency1__[\"default\"];\n var DataAdapter = __dependency2__[\"default\"];\n var ContainerDebugAdapter = __dependency3__[\"default\"];\n\n Ember.DataAdapter = DataAdapter;\n Ember.ContainerDebugAdapter = ContainerDebugAdapter;\n });\n})();\n//@ sourceURL=ember-extension-support");minispade.register('ember-handlebars-compiler', "(function() {minispade.require(\"ember-views\");\ndefine(\"ember-handlebars-compiler\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars-compiler\n */\n\n var Ember = __dependency1__[\"default\"];\n\n // ES6Todo: you'll need to import debugger once debugger is es6'd.\n if (typeof Ember.assert === 'undefined') { Ember.assert = function(){}; };\n if (typeof Ember.FEATURES === 'undefined') { Ember.FEATURES = { isEnabled: function(){} }; };\n\n var objectCreate = Object.create || function(parent) {\n function F() {}\n F.prototype = parent;\n return new F();\n };\n\n // set up for circular references later\n var View, Component;\n\n // ES6Todo: when ember-debug is es6'ed import this.\n // var emberAssert = Ember.assert;\n var Handlebars = (Ember.imports && Ember.imports.Handlebars) || (this && this.Handlebars);\n if (!Handlebars && typeof require === 'function') {\n Handlebars = require('handlebars');\n }\n\n Ember.assert(\"Ember Handlebars requires Handlebars version 1.0 or 1.1. Include \" +\n \"a SCRIPT tag in the HTML HEAD linking to the Handlebars file \" +\n \"before you link to Ember.\", Handlebars);\n\n Ember.assert(\"Ember Handlebars requires Handlebars version 1.0 or 1.1, \" +\n \"COMPILER_REVISION expected: 4, got: \" + Handlebars.COMPILER_REVISION +\n \" - Please note: Builds of master may have other COMPILER_REVISION values.\",\n Handlebars.COMPILER_REVISION === 4);\n\n /**\n Prepares the Handlebars templating library for use inside Ember's view\n system.\n\n The `Ember.Handlebars` object is the standard Handlebars library, extended to\n use Ember's `get()` method instead of direct property access, which allows\n computed properties to be used inside templates.\n\n To create an `Ember.Handlebars` template, call `Ember.Handlebars.compile()`.\n This will return a function that can be used by `Ember.View` for rendering.\n\n @class Handlebars\n @namespace Ember\n */\n var EmberHandlebars = Ember.Handlebars = objectCreate(Handlebars);\n\n /**\n Register a bound helper or custom view helper.\n\n ## Simple bound helper example\n\n ```javascript\n Ember.Handlebars.helper('capitalize', function(value) {\n return value.toUpperCase();\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n For more examples of bound helpers, see documentation for\n `Ember.Handlebars.registerBoundHelper`.\n\n ## Custom view helper example\n\n Assuming a view subclass named `App.CalendarView` were defined, a helper\n for rendering instances of this view could be registered as follows:\n\n ```javascript\n Ember.Handlebars.helper('calendar', App.CalendarView):\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{calendar}}\n ```\n\n Which is functionally equivalent to:\n\n ```handlebars\n {{view App.CalendarView}}\n ```\n\n Options in the helper will be passed to the view in exactly the same\n manner as with the `view` helper.\n\n @method helper\n @for Ember.Handlebars\n @param {String} name\n @param {Function|Ember.View} function or view class constructor\n @param {String} dependentKeys*\n */\n EmberHandlebars.helper = function(name, value) {\n if (!View) { View = requireModule('ember-views/views/view')['View']; } // ES6TODO: stupid circular dep\n if (!Component) { Component = requireModule('ember-views/views/component')['default']; } // ES6TODO: stupid circular dep\n\n Ember.assert(\"You tried to register a component named '\" + name + \"', but component names must include a '-'\", !Component.detect(value) || name.match(/-/));\n\n if (View.detect(value)) {\n EmberHandlebars.registerHelper(name, EmberHandlebars.makeViewHelper(value));\n } else {\n EmberHandlebars.registerBoundHelper.apply(null, arguments);\n }\n };\n\n /**\n Returns a helper function that renders the provided ViewClass.\n\n Used internally by Ember.Handlebars.helper and other methods\n involving helper/component registration.\n\n @private\n @method makeViewHelper\n @for Ember.Handlebars\n @param {Function} ViewClass view class constructor\n @since 1.2.0\n */\n EmberHandlebars.makeViewHelper = function(ViewClass) {\n return function(options) {\n Ember.assert(\"You can only pass attributes (such as name=value) not bare values to a helper for a View found in '\" + ViewClass.toString() + \"'\", arguments.length < 2);\n return EmberHandlebars.helpers.view.call(this, ViewClass, options);\n };\n };\n\n /**\n @class helpers\n @namespace Ember.Handlebars\n */\n EmberHandlebars.helpers = objectCreate(Handlebars.helpers);\n\n /**\n Override the the opcode compiler and JavaScript compiler for Handlebars.\n\n @class Compiler\n @namespace Ember.Handlebars\n @private\n @constructor\n */\n EmberHandlebars.Compiler = function() {};\n\n // Handlebars.Compiler doesn't exist in runtime-only\n if (Handlebars.Compiler) {\n EmberHandlebars.Compiler.prototype = objectCreate(Handlebars.Compiler.prototype);\n }\n\n EmberHandlebars.Compiler.prototype.compiler = EmberHandlebars.Compiler;\n\n /**\n @class JavaScriptCompiler\n @namespace Ember.Handlebars\n @private\n @constructor\n */\n EmberHandlebars.JavaScriptCompiler = function() {};\n\n // Handlebars.JavaScriptCompiler doesn't exist in runtime-only\n if (Handlebars.JavaScriptCompiler) {\n EmberHandlebars.JavaScriptCompiler.prototype = objectCreate(Handlebars.JavaScriptCompiler.prototype);\n EmberHandlebars.JavaScriptCompiler.prototype.compiler = EmberHandlebars.JavaScriptCompiler;\n }\n\n\n EmberHandlebars.JavaScriptCompiler.prototype.namespace = \"Ember.Handlebars\";\n\n EmberHandlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {\n return \"''\";\n };\n\n /**\n Override the default buffer for Ember Handlebars. By default, Handlebars\n creates an empty String at the beginning of each invocation and appends to\n it. Ember's Handlebars overrides this to append to a single shared buffer.\n\n @private\n @method appendToBuffer\n @param string {String}\n */\n EmberHandlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {\n return \"data.buffer.push(\"+string+\");\";\n };\n\n // Hacks ahead:\n // Handlebars presently has a bug where the `blockHelperMissing` hook\n // doesn't get passed the name of the missing helper name, but rather\n // gets passed the value of that missing helper evaluated on the current\n // context, which is most likely `undefined` and totally useless.\n //\n // So we alter the compiled template function to pass the name of the helper\n // instead, as expected.\n //\n // This can go away once the following is closed:\n // https://github.com/wycats/handlebars.js/issues/634\n\n var DOT_LOOKUP_REGEX = /helpers\\.(.*?)\\)/,\n BRACKET_STRING_LOOKUP_REGEX = /helpers\\['(.*?)'/,\n INVOCATION_SPLITTING_REGEX = /(.*blockHelperMissing\\.call\\(.*)(stack[0-9]+)(,.*)/;\n\n EmberHandlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation = function(source) {\n var helperInvocation = source[source.length - 1],\n helperName = (DOT_LOOKUP_REGEX.exec(helperInvocation) || BRACKET_STRING_LOOKUP_REGEX.exec(helperInvocation))[1],\n matches = INVOCATION_SPLITTING_REGEX.exec(helperInvocation);\n\n source[source.length - 1] = matches[1] + \"'\" + helperName + \"'\" + matches[3];\n };\n\n var stringifyBlockHelperMissing = EmberHandlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation;\n\n var originalBlockValue = EmberHandlebars.JavaScriptCompiler.prototype.blockValue;\n EmberHandlebars.JavaScriptCompiler.prototype.blockValue = function() {\n originalBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\n };\n\n var originalAmbiguousBlockValue = EmberHandlebars.JavaScriptCompiler.prototype.ambiguousBlockValue;\n EmberHandlebars.JavaScriptCompiler.prototype.ambiguousBlockValue = function() {\n originalAmbiguousBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\n };\n\n /**\n Rewrite simple mustaches from `{{foo}}` to `{{bind \"foo\"}}`. This means that\n all simple mustaches in Ember's Handlebars will also set up an observer to\n keep the DOM up to date when the underlying property changes.\n\n @private\n @method mustache\n @for Ember.Handlebars.Compiler\n @param mustache\n */\n EmberHandlebars.Compiler.prototype.mustache = function(mustache) {\n if (!(mustache.params.length || mustache.hash)) {\n var id = new Handlebars.AST.IdNode([{ part: '_triageMustache' }]);\n\n // Update the mustache node to include a hash value indicating whether the original node\n // was escaped. This will allow us to properly escape values when the underlying value\n // changes and we need to re-render the value.\n if (!mustache.escaped) {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"unescaped\", new Handlebars.AST.StringNode(\"true\")]);\n }\n mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);\n }\n\n return Handlebars.Compiler.prototype.mustache.call(this, mustache);\n };\n\n /**\n Used for precompilation of Ember Handlebars templates. This will not be used\n during normal app execution.\n\n @method precompile\n @for Ember.Handlebars\n @static\n @param {String} string The template to precompile\n @param {Boolean} asObject optional parameter, defaulting to true, of whether or not the\n compiled template should be returned as an Object or a String\n */\n EmberHandlebars.precompile = function(string, asObject) {\n var ast = Handlebars.parse(string);\n\n var options = {\n knownHelpers: {\n action: true,\n unbound: true,\n 'bind-attr': true,\n template: true,\n view: true,\n _triageMustache: true\n },\n data: true,\n stringParams: true\n };\n\n asObject = asObject === undefined ? true : asObject;\n\n var environment = new EmberHandlebars.Compiler().compile(ast, options);\n return new EmberHandlebars.JavaScriptCompiler().compile(environment, options, undefined, asObject);\n };\n\n // We don't support this for Handlebars runtime-only\n if (Handlebars.compile) {\n /**\n The entry point for Ember Handlebars. This replaces the default\n `Handlebars.compile` and turns on template-local data and String\n parameters.\n\n @method compile\n @for Ember.Handlebars\n @static\n @param {String} string The template to compile\n @return {Function}\n */\n EmberHandlebars.compile = function(string) {\n var ast = Handlebars.parse(string);\n var options = { data: true, stringParams: true };\n var environment = new EmberHandlebars.Compiler().compile(ast, options);\n var templateSpec = new EmberHandlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n\n var template = EmberHandlebars.template(templateSpec);\n template.isMethod = false; //Make sure we don't wrap templates with ._super\n\n return template;\n };\n }\n\n __exports__[\"default\"] = EmberHandlebars;\n });\n})();\n//@ sourceURL=ember-handlebars-compiler");minispade.register('ember-handlebars', "(function() {minispade.require(\"ember-handlebars-compiler\");\nminispade.require(\"ember-views\");\nminispade.require(\"metamorph\");\ndefine(\"ember-handlebars/component_lookup\",\n [\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var EmberObject = __dependency1__[\"default\"];\n\n var ComponentLookup = EmberObject.extend({\n lookupFactory: function(name, container) {\n\n container = container || this.container;\n\n var fullName = 'component:' + name,\n templateFullName = 'template:components/' + name,\n templateRegistered = container && container.has(templateFullName);\n\n if (templateRegistered) {\n container.injection(fullName, 'layout', templateFullName);\n }\n\n var Component = container.lookupFactory(fullName);\n\n // Only treat as a component if either the component\n // or a template has been registered.\n if (templateRegistered || Component) {\n if (!Component) {\n container.register(fullName, Ember.Component);\n Component = container.lookupFactory(fullName);\n }\n return Component;\n }\n }\n });\n\n __exports__[\"default\"] = ComponentLookup;\n });\ndefine(\"ember-handlebars/controls\",\n [\"ember-handlebars/controls/checkbox\",\"ember-handlebars/controls/text_field\",\"ember-handlebars/controls/text_area\",\"ember-metal/core\",\"ember-handlebars-compiler\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Checkbox = __dependency1__[\"default\"];\n var TextField = __dependency2__[\"default\"];\n var TextArea = __dependency3__[\"default\"];\n\n var Ember = __dependency4__[\"default\"];\n // Ember.assert\n // var emberAssert = Ember.assert;\n\n var EmberHandlebars = __dependency5__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n /**\n @module ember\n @submodule ember-handlebars-compiler\n */\n\n /**\n\n The `{{input}}` helper inserts an HTML `<input>` tag into the template,\n with a `type` value of either `text` or `checkbox`. If no `type` is provided,\n `text` will be the default value applied. The attributes of `{{input}}`\n match those of the native HTML tag as closely as possible for these two types.\n\n ## Use as text field\n An `{{input}}` with no `type` or a `type` of `text` will render an HTML text input.\n The following HTML attributes can be set via the helper:\n\n <table>\n <tr><td>`readonly`</td><td>`required`</td><td>`autofocus`</td></tr>\n <tr><td>`value`</td><td>`placeholder`</td><td>`disabled`</td></tr>\n <tr><td>`size`</td><td>`tabindex`</td><td>`maxlength`</td></tr>\n <tr><td>`name`</td><td>`min`</td><td>`max`</td></tr>\n <tr><td>`pattern`</td><td>`accept`</td><td>`autocomplete`</td></tr>\n <tr><td>`autosave`</td><td>`formaction`</td><td>`formenctype`</td></tr>\n <tr><td>`formmethod`</td><td>`formnovalidate`</td><td>`formtarget`</td></tr>\n <tr><td>`height`</td><td>`inputmode`</td><td>`multiple`</td></tr>\n <tr><td>`step`</td><td>`width`</td><td>`form`</td></tr>\n <tr><td>`selectionDirection`</td><td>`spellcheck`</td><td> </td></tr>\n </table>\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input value=\"http://www.facebook.com\"}}\n ```\n\n\n ```html\n <input type=\"text\" value=\"http://www.facebook.com\"/>\n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n firstName: \"Stanley\",\n entryNotAllowed: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"text\" value=firstName disabled=entryNotAllowed size=\"50\"}}\n ```\n\n\n ```html\n <input type=\"text\" value=\"Stanley\" disabled=\"disabled\" size=\"50\"/>\n ```\n\n ## Extension\n\n Internally, `{{input type=\"text\"}}` creates an instance of `Ember.TextField`, passing\n arguments from the helper to `Ember.TextField`'s `create` method. You can extend the\n capabilities of text inputs in your applications by reopening this class. For example,\n if you are building a Bootstrap project where `data-*` attributes are used, you\n can add one to the `TextField`'s `attributeBindings` property:\n\n\n ```javascript\n Ember.TextField.reopen({\n attributeBindings: ['data-error']\n });\n ```\n\n Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n\n ## Use as checkbox\n\n An `{{input}}` with a `type` of `checkbox` will render an HTML checkbox input.\n The following HTML attributes can be set via the helper:\n\n * `checked`\n * `disabled`\n * `tabindex`\n * `indeterminate`\n * `name`\n * `autofocus`\n * `form`\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input type=\"checkbox\" name=\"isAdmin\"}}\n ```\n\n ```html\n <input type=\"checkbox\" name=\"isAdmin\" />\n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n isAdmin: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"checkbox\" checked=isAdmin }}\n ```\n\n\n ```html\n <input type=\"checkbox\" checked=\"checked\" />\n ```\n\n ## Extension\n\n Internally, `{{input type=\"checkbox\"}}` creates an instance of `Ember.Checkbox`, passing\n arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the\n capablilties of checkbox inputs in your applications by reopening this class. For example,\n if you wanted to add a css class to all checkboxes in your application:\n\n\n ```javascript\n Ember.Checkbox.reopen({\n classNames: ['my-app-checkbox']\n });\n ```\n\n\n @method input\n @for Ember.Handlebars.helpers\n @param {Hash} options\n */\n function inputHelper(options) {\n Ember.assert('You can only pass attributes to the `input` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes,\n inputType = hash.type,\n onEvent = hash.on;\n\n delete hash.type;\n delete hash.on;\n\n if (inputType === 'checkbox') {\n Ember.assert(\"{{input type='checkbox'}} does not support setting `value=someBooleanValue`; you must use `checked=someBooleanValue` instead.\", options.hashTypes.value !== 'ID');\n return helpers.view.call(this, Checkbox, options);\n } else {\n if (inputType) { hash.type = inputType; }\n hash.onEvent = onEvent || 'enter';\n return helpers.view.call(this, TextField, options);\n }\n }\n\n /**\n `{{textarea}}` inserts a new instance of `<textarea>` tag into the template.\n The attributes of `{{textarea}}` match those of the native HTML tags as\n closely as possible.\n\n The following HTML attributes can be set:\n\n * `value`\n * `name`\n * `rows`\n * `cols`\n * `placeholder`\n * `disabled`\n * `maxlength`\n * `tabindex`\n * `selectionEnd`\n * `selectionStart`\n * `selectionDirection`\n * `wrap`\n * `readonly`\n * `autofocus`\n * `form`\n * `spellcheck`\n * `required`\n\n When set to a quoted string, these value will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n Unbound:\n\n ```handlebars\n {{textarea value=\"Lots of static text that ISN'T bound\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of static text that ISN'T bound\n </textarea>\n ```\n\n Bound:\n\n In the following example, the `writtenWords` property on `App.ApplicationController`\n will be updated live as the user types 'Lots of text that IS bound' into\n the text area of their browser's window.\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\"\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n ```\n\n If you wanted a one way binding between the text area and a div tag\n somewhere else on your screen, you could use `Ember.computed.oneWay`:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n outputWrittenWords: Ember.computed.oneWay(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n\n <div>\n {{outputWrittenWords}}\n </div>\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n\n <-- the following div will be updated in real time as you type -->\n\n <div>\n Lots of text that IS bound\n </div>\n ```\n\n Finally, this example really shows the power and ease of Ember when two\n properties are bound to eachother via `Ember.computed.alias`. Type into\n either text area box and they'll both stay in sync. Note that\n `Ember.computed.alias` costs more in terms of performance, so only use it when\n your really binding in both directions:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n twoWayWrittenWords: Ember.computed.alias(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n {{textarea value=twoWayWrittenWords}}\n ```\n\n ```html\n <textarea id=\"ember1\" class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n\n <-- both updated in real time -->\n\n <textarea id=\"ember2\" class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n ```\n\n ## Extension\n\n Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing\n arguments from the helper to `Ember.TextArea`'s `create` method. You can\n extend the capabilities of text areas in your application by reopening this\n class. For example, if you are building a Bootstrap project where `data-*` \n attributes are used, you can globally add support for a `data-*` attribute\n on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or\n `Ember.TextSupport` and adding it to the `attributeBindings` concatenated\n property:\n\n ```javascript\n Ember.TextArea.reopen({\n attributeBindings: ['data-error']\n });\n ```\n\n Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n @method textarea\n @for Ember.Handlebars.helpers\n @param {Hash} options\n */\n function textareaHelper(options) {\n Ember.assert('You can only pass attributes to the `textarea` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes;\n\n return helpers.view.call(this, TextArea, options);\n }\n\n __exports__.inputHelper = inputHelper;\n __exports__.textareaHelper = textareaHelper;\n });\ndefine(\"ember-handlebars/controls/checkbox\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var View = __dependency3__.View;\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n /**\n The internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `checkbox`.\n\n See [handlebars.helpers.input](/api/classes/Ember.Handlebars.helpers.html#method_input) for usage details.\n\n ## Direct manipulation of `checked`\n\n The `checked` attribute of an `Ember.Checkbox` object should always be set\n through the Ember object or by interacting with its rendered element\n representation via the mouse, keyboard, or touch. Updating the value of the\n checkbox via jQuery will result in the checked value of the object and its\n element losing synchronization.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class Checkbox\n @namespace Ember\n @extends Ember.View\n */\n var Checkbox = View.extend({\n instrumentDisplay: '{{input type=\"checkbox\"}}',\n\n classNames: ['ember-checkbox'],\n\n tagName: 'input',\n\n attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name',\n 'autofocus', 'required', 'form'],\n\n type: \"checkbox\",\n checked: false,\n disabled: false,\n indeterminate: false,\n\n init: function() {\n this._super();\n this.on(\"change\", this, this._updateElementValue);\n },\n\n didInsertElement: function() {\n this._super();\n get(this, 'element').indeterminate = !!get(this, 'indeterminate');\n },\n\n _updateElementValue: function() {\n set(this, 'checked', this.$().prop('checked'));\n }\n });\n\n __exports__[\"default\"] = Checkbox;\n });\ndefine(\"ember-handlebars/controls/select\",\n [\"ember-handlebars-compiler\",\"ember-metal/enumerable_utils\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/view\",\"ember-views/views/collection_view\",\"ember-metal/utils\",\"ember-metal/is_none\",\"ember-metal/computed\",\"ember-runtime/system/native_array\",\"ember-metal/mixin\",\"ember-metal/properties\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n /*jshint eqeqeq:false newcap:false */\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var EmberHandlebars = __dependency1__[\"default\"];\n var EnumerableUtils = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var View = __dependency5__.View;\n var CollectionView = __dependency6__[\"default\"];\n var isArray = __dependency7__.isArray;\n var isNone = __dependency8__[\"default\"];\n var computed = __dependency9__.computed;\n var A = __dependency10__.A;\n var observer = __dependency11__.observer;\n var defineProperty = __dependency12__.defineProperty;\n\n var indexOf = EnumerableUtils.indexOf,\n indexesOf = EnumerableUtils.indexesOf,\n forEach = EnumerableUtils.forEach,\n replace = EnumerableUtils.replace,\n precompileTemplate = EmberHandlebars.compile;\n\n var SelectOption = View.extend({\n instrumentDisplay: 'Ember.SelectOption',\n\n tagName: 'option',\n attributeBindings: ['value', 'selected'],\n\n defaultTemplate: function(context, options) {\n options = { data: options.data, hash: {} };\n EmberHandlebars.helpers.bind.call(context, \"view.label\", options);\n },\n\n init: function() {\n this.labelPathDidChange();\n this.valuePathDidChange();\n\n this._super();\n },\n\n selected: computed(function() {\n var content = get(this, 'content'),\n selection = get(this, 'parentView.selection');\n if (get(this, 'parentView.multiple')) {\n return selection && indexOf(selection, content.valueOf()) > -1;\n } else {\n // Primitives get passed through bindings as objects... since\n // `new Number(4) !== 4`, we use `==` below\n return content == selection;\n }\n }).property('content', 'parentView.selection'),\n\n labelPathDidChange: observer('parentView.optionLabelPath', function() {\n var labelPath = get(this, 'parentView.optionLabelPath');\n\n if (!labelPath) { return; }\n\n defineProperty(this, 'label', computed(function() {\n return get(this, labelPath);\n }).property(labelPath));\n }),\n\n valuePathDidChange: observer('parentView.optionValuePath', function() {\n var valuePath = get(this, 'parentView.optionValuePath');\n\n if (!valuePath) { return; }\n\n defineProperty(this, 'value', computed(function() {\n return get(this, valuePath);\n }).property(valuePath));\n })\n });\n\n var SelectOptgroup = CollectionView.extend({\n instrumentDisplay: 'Ember.SelectOptgroup',\n\n tagName: 'optgroup',\n attributeBindings: ['label'],\n\n selectionBinding: 'parentView.selection',\n multipleBinding: 'parentView.multiple',\n optionLabelPathBinding: 'parentView.optionLabelPath',\n optionValuePathBinding: 'parentView.optionValuePath',\n\n itemViewClassBinding: 'parentView.optionView'\n });\n\n /**\n The `Ember.Select` view class renders a\n [select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,\n allowing the user to choose from a list of options.\n\n The text and `value` property of each `<option>` element within the\n `<select>` element are populated from the objects in the `Element.Select`'s\n `content` property. The underlying data object of the selected `<option>` is\n stored in the `Element.Select`'s `value` property.\n\n ## The Content Property (array of strings)\n\n The simplest version of an `Ember.Select` takes an array of strings as its\n `content` property. The string will be used as both the `value` property and\n the inner text of each `<option>` element inside the rendered `<select>`.\n\n Example:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n names: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select content=names}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n You can control which `<option>` is selected through the `Ember.Select`'s\n `value` property:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n selectedName: 'Tom',\n names: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=names\n value=selectedName\n }}\n ```\n\n Would result in the following HTML with the `<option>` for 'Tom' selected:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n A user interacting with the rendered `<select>` to choose \"Yehuda\" would\n update the value of `selectedName` to \"Yehuda\".\n\n ## The Content Property (array of Objects)\n\n An `Ember.Select` can also take an array of JavaScript or Ember objects as\n its `content` property.\n\n When using objects you need to tell the `Ember.Select` which property should\n be accessed on each object to supply the `value` attribute of the `<option>`\n and which property should be used to supply the element text.\n\n The `optionValuePath` option is used to specify the path on each object to\n the desired property for the `value` attribute. The `optionLabelPath`\n specifies the path on each object to the desired property for the\n element's text. Both paths must reference each object itself as `content`:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\">Tom</option>\n </select>\n ```\n\n The `value` attribute of the selected `<option>` within an `Ember.Select`\n can be bound to a property on another object:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ],\n currentProgrammer: {\n id: 2\n }\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n value=currentProgrammer.id}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `id` of `currentProgrammer`\n to match the `value` property of the newly selected `<option>`.\n\n Alternatively, you can control selection through the underlying objects\n used to render each object by binding the `selection` option. When the selected\n `<option>` is changed, the property path provided to `selection`\n will be updated to match the content object of the rendered `<option>`\n element:\n\n ```javascript\n\n var yehuda = {firstName: \"Yehuda\", id: 1, bff4eva: 'tom'}\n var tom = {firstName: \"Tom\", id: 2, bff4eva: 'yehuda'};\n\n App.ApplicationController = Ember.ObjectController.extend({\n selectedPerson: tom,\n programmers: [\n yehuda,\n tom\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n selection=selectedPerson}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `selectedPerson` to match the object of\n the newly selected `<option>`. In this case it is the first object\n in the `programmers`\n\n ## Supplying a Prompt\n\n A `null` value for the `Ember.Select`'s `value` or `selection` property\n results in there being no `<option>` with a `selected` attribute:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n selectedProgrammer: null,\n programmers: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ``` handlebars\n {{view Ember.Select\n content=programmers\n value=selectedProgrammer\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n Although `selectedProgrammer` is `null` and no `<option>`\n has a `selected` attribute the rendered HTML will display the\n first item as though it were selected. You can supply a string\n value for the `Ember.Select` to display when there is no selection\n with the `prompt` option:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n selectedProgrammer: null,\n programmers: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n value=selectedProgrammer\n prompt=\"Please select a name\"\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option>Please select a name</option>\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n @class Select\n @namespace Ember\n @extends Ember.View\n */\n var Select = View.extend({\n instrumentDisplay: 'Ember.Select',\n\n tagName: 'select',\n classNames: ['ember-select'],\n defaultTemplate: precompileTemplate('{{#if view.prompt}}<option value=\"\">{{view.prompt}}</option>{{/if}}{{#if view.optionGroupPath}}{{#each view.groupedContent}}{{view view.groupView content=content label=label}}{{/each}}{{else}}{{#each view.content}}{{view view.optionView content=this}}{{/each}}{{/if}}'),\n attributeBindings: ['multiple', 'disabled', 'tabindex', 'name', 'required', 'autofocus',\n 'form', 'size'],\n\n /**\n The `multiple` attribute of the select element. Indicates whether multiple\n options can be selected.\n\n @property multiple\n @type Boolean\n @default false\n */\n multiple: false,\n\n /**\n The `disabled` attribute of the select element. Indicates whether\n the element is disabled from interactions.\n\n @property disabled\n @type Boolean\n @default false\n */\n disabled: false,\n\n /**\n The `required` attribute of the select element. Indicates whether\n a selected option is required for form validation.\n\n @property required\n @type Boolean\n @default false\n @since 1.5.0\n */\n required: false,\n\n /**\n The list of options.\n\n If `optionLabelPath` and `optionValuePath` are not overridden, this should\n be a list of strings, which will serve simultaneously as labels and values.\n\n Otherwise, this should be a list of objects. For instance:\n\n ```javascript\n Ember.Select.create({\n content: A([\n { id: 1, firstName: 'Yehuda' },\n { id: 2, firstName: 'Tom' }\n ]),\n optionLabelPath: 'content.firstName',\n optionValuePath: 'content.id'\n });\n ```\n\n @property content\n @type Array\n @default null\n */\n content: null,\n\n /**\n When `multiple` is `false`, the element of `content` that is currently\n selected, if any.\n\n When `multiple` is `true`, an array of such elements.\n\n @property selection\n @type Object or Array\n @default null\n */\n selection: null,\n\n /**\n In single selection mode (when `multiple` is `false`), value can be used to\n get the current selection's value or set the selection by it's value.\n\n It is not currently supported in multiple selection mode.\n\n @property value\n @type String\n @default null\n */\n value: computed(function(key, value) {\n if (arguments.length === 2) { return value; }\n var valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, '');\n return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection');\n }).property('selection'),\n\n /**\n If given, a top-most dummy option will be rendered to serve as a user\n prompt.\n\n @property prompt\n @type String\n @default null\n */\n prompt: null,\n\n /**\n The path of the option labels. See [content](/api/classes/Ember.Select.html#property_content).\n\n @property optionLabelPath\n @type String\n @default 'content'\n */\n optionLabelPath: 'content',\n\n /**\n The path of the option values. See [content](/api/classes/Ember.Select.html#property_content).\n\n @property optionValuePath\n @type String\n @default 'content'\n */\n optionValuePath: 'content',\n\n /**\n The path of the option group.\n When this property is used, `content` should be sorted by `optionGroupPath`.\n\n @property optionGroupPath\n @type String\n @default null\n */\n optionGroupPath: null,\n\n /**\n The view class for optgroup.\n\n @property groupView\n @type Ember.View\n @default Ember.SelectOptgroup\n */\n groupView: SelectOptgroup,\n\n groupedContent: computed(function() {\n var groupPath = get(this, 'optionGroupPath');\n var groupedContent = A();\n var content = get(this, 'content') || [];\n\n forEach(content, function(item) {\n var label = get(item, groupPath);\n\n if (get(groupedContent, 'lastObject.label') !== label) {\n groupedContent.pushObject({\n label: label,\n content: A()\n });\n }\n\n get(groupedContent, 'lastObject.content').push(item);\n });\n\n return groupedContent;\n }).property('optionGroupPath', 'content.@each'),\n\n /**\n The view class for option.\n\n @property optionView\n @type Ember.View\n @default Ember.SelectOption\n */\n optionView: SelectOption,\n\n _change: function() {\n if (get(this, 'multiple')) {\n this._changeMultiple();\n } else {\n this._changeSingle();\n }\n },\n\n selectionDidChange: observer('selection.@each', function() {\n var selection = get(this, 'selection');\n if (get(this, 'multiple')) {\n if (!isArray(selection)) {\n set(this, 'selection', A([selection]));\n return;\n }\n this._selectionDidChangeMultiple();\n } else {\n this._selectionDidChangeSingle();\n }\n }),\n\n valueDidChange: observer('value', function() {\n var content = get(this, 'content'),\n value = get(this, 'value'),\n valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, ''),\n selectedValue = (valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection')),\n selection;\n\n if (value !== selectedValue) {\n selection = content ? content.find(function(obj) {\n return value === (valuePath ? get(obj, valuePath) : obj);\n }) : null;\n\n this.set('selection', selection);\n }\n }),\n\n\n _triggerChange: function() {\n var selection = get(this, 'selection');\n var value = get(this, 'value');\n\n if (!isNone(selection)) { this.selectionDidChange(); }\n if (!isNone(value)) { this.valueDidChange(); }\n\n this._change();\n },\n\n _changeSingle: function() {\n var selectedIndex = this.$()[0].selectedIndex,\n content = get(this, 'content'),\n prompt = get(this, 'prompt');\n\n if (!content || !get(content, 'length')) { return; }\n if (prompt && selectedIndex === 0) { set(this, 'selection', null); return; }\n\n if (prompt) { selectedIndex -= 1; }\n set(this, 'selection', content.objectAt(selectedIndex));\n },\n\n\n _changeMultiple: function() {\n var options = this.$('option:selected'),\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n content = get(this, 'content'),\n selection = get(this, 'selection');\n\n if (!content) { return; }\n if (options) {\n var selectedIndexes = options.map(function() {\n return this.index - offset;\n }).toArray();\n var newSelection = content.objectsAt(selectedIndexes);\n\n if (isArray(selection)) {\n replace(selection, 0, get(selection, 'length'), newSelection);\n } else {\n set(this, 'selection', newSelection);\n }\n }\n },\n\n _selectionDidChangeSingle: function() {\n var el = this.get('element');\n if (!el) { return; }\n\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectionIndex = content ? indexOf(content, selection) : -1,\n prompt = get(this, 'prompt');\n\n if (prompt) { selectionIndex += 1; }\n if (el) { el.selectedIndex = selectionIndex; }\n },\n\n _selectionDidChangeMultiple: function() {\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectedIndexes = content ? indexesOf(content, selection) : [-1],\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n options = this.$('option'),\n adjusted;\n\n if (options) {\n options.each(function() {\n adjusted = this.index > -1 ? this.index - offset : -1;\n this.selected = indexOf(selectedIndexes, adjusted) > -1;\n });\n }\n },\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._triggerChange);\n this.on(\"change\", this, this._change);\n }\n });\n\n __exports__[\"default\"] = Select\n __exports__.Select = Select;\n __exports__.SelectOption = SelectOption;\n __exports__.SelectOptgroup = SelectOptgroup;\n });\ndefine(\"ember-handlebars/controls/text_area\",\n [\"ember-metal/property_get\",\"ember-views/views/component\",\"ember-handlebars/controls/text_support\",\"ember-metal/mixin\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n var get = __dependency1__.get;\n var Component = __dependency2__[\"default\"];\n var TextSupport = __dependency3__[\"default\"];\n var observer = __dependency4__.observer;\n\n /**\n The internal class used to create textarea element when the `{{textarea}}`\n helper is used.\n\n See [handlebars.helpers.textarea](/api/classes/Ember.Handlebars.helpers.html#method_textarea) for usage details.\n\n ## Layout and LayoutName properties\n\n Because HTML `textarea` elements do not contain inner HTML the `layout` and\n `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextArea\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n */\n var TextArea = Component.extend(TextSupport, {\n instrumentDisplay: '{{textarea}}',\n\n classNames: ['ember-text-area'],\n\n tagName: \"textarea\",\n attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap'],\n rows: null,\n cols: null,\n\n _updateElementValue: observer('value', function() {\n // We do this check so cursor position doesn't get affected in IE\n var value = get(this, 'value'),\n $el = this.$();\n if ($el && value !== $el.val()) {\n $el.val(value);\n }\n }),\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._updateElementValue);\n }\n\n });\n\n __exports__[\"default\"] = TextArea;\n });\ndefine(\"ember-handlebars/controls/text_field\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/component\",\"ember-handlebars/controls/text_support\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var Component = __dependency3__[\"default\"];\n var TextSupport = __dependency4__[\"default\"];\n\n /**\n\n The internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `text`.\n\n See [Handlebars.helpers.input](/api/classes/Ember.Handlebars.helpers.html#method_input) for usage details.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextField\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n */\n var TextField = Component.extend(TextSupport, {\n instrumentDisplay: '{{input type=\"text\"}}',\n\n classNames: ['ember-text-field'],\n tagName: \"input\",\n attributeBindings: ['type', 'value', 'size', 'pattern', 'name', 'min', 'max',\n 'accept', 'autocomplete', 'autosave', 'formaction',\n 'formenctype', 'formmethod', 'formnovalidate', 'formtarget',\n 'height', 'inputmode', 'list', 'multiple', 'pattern', 'step',\n 'width'],\n\n /**\n The `value` attribute of the input element. As the user inputs text, this\n property is updated live.\n\n @property value\n @type String\n @default \"\"\n */\n value: \"\",\n\n /**\n The `type` attribute of the input element.\n\n @property type\n @type String\n @default \"text\"\n */\n type: \"text\",\n\n /**\n The `size` of the text field in characters.\n\n @property size\n @type String\n @default null\n */\n size: null,\n\n /**\n The `pattern` attribute of input element.\n\n @property pattern\n @type String\n @default null\n */\n pattern: null,\n\n /**\n The `min` attribute of input element used with `type=\"number\"` or `type=\"range\"`.\n\n @property min\n @type String\n @default null\n @since 1.4.0\n */\n min: null,\n\n /**\n The `max` attribute of input element used with `type=\"number\"` or `type=\"range\"`.\n\n @property max\n @type String\n @default null\n @since 1.4.0\n */\n max: null\n });\n\n __exports__[\"default\"] = TextField;\n });\ndefine(\"ember-handlebars/controls/text_support\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/mixin\",\"ember-runtime/mixins/target_action_support\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var Mixin = __dependency3__.Mixin;\n var TargetActionSupport = __dependency4__[\"default\"];\n\n /**\n Shared mixin used by `Ember.TextField` and `Ember.TextArea`.\n\n @class TextSupport\n @namespace Ember\n @uses Ember.TargetActionSupport\n @extends Ember.Mixin\n @private\n */\n var TextSupport = Mixin.create(TargetActionSupport, {\n value: \"\",\n\n attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex', 'readonly',\n 'autofocus', 'form', 'selectionDirection', 'spellcheck', 'required',\n 'title', 'autocapitalize', 'autocorrect'],\n placeholder: null,\n disabled: false,\n maxlength: null,\n\n init: function() {\n this._super();\n this.on(\"focusOut\", this, this._elementValueDidChange);\n this.on(\"change\", this, this._elementValueDidChange);\n this.on(\"paste\", this, this._elementValueDidChange);\n this.on(\"cut\", this, this._elementValueDidChange);\n this.on(\"input\", this, this._elementValueDidChange);\n this.on(\"keyUp\", this, this.interpretKeyEvents);\n },\n\n /**\n The action to be sent when the user presses the return key.\n\n This is similar to the `{{action}}` helper, but is fired when\n the user presses the return key when editing a text field, and sends\n the value of the field as the context.\n\n @property action\n @type String\n @default null\n */\n action: null,\n\n /**\n The event that should send the action.\n\n Options are:\n\n * `enter`: the user pressed enter\n * `keyPress`: the user pressed a key\n\n @property onEvent\n @type String\n @default enter\n */\n onEvent: 'enter',\n\n /**\n Whether they `keyUp` event that triggers an `action` to be sent continues\n propagating to other views.\n\n By default, when the user presses the return key on their keyboard and\n the text field has an `action` set, the action will be sent to the view's\n controller and the key event will stop propagating.\n\n If you would like parent views to receive the `keyUp` event even after an\n action has been dispatched, set `bubbles` to true.\n\n @property bubbles\n @type Boolean\n @default false\n */\n bubbles: false,\n\n interpretKeyEvents: function(event) {\n var map = TextSupport.KEY_EVENTS;\n var method = map[event.keyCode];\n\n this._elementValueDidChange();\n if (method) { return this[method](event); }\n },\n\n _elementValueDidChange: function() {\n set(this, 'value', this.$().val());\n },\n\n /**\n The action to be sent when the user inserts a new line.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 13.\n Uses sendAction to send the `enter` action to the controller.\n\n @method insertNewline\n @param {Event} event\n */\n insertNewline: function(event) {\n sendAction('enter', this, event);\n sendAction('insert-newline', this, event);\n },\n\n /**\n Called when the user hits escape.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 27.\n Uses sendAction to send the `escape-press` action to the controller.\n\n @method cancel\n @param {Event} event\n */\n cancel: function(event) {\n sendAction('escape-press', this, event);\n },\n\n /**\n Called when the text area is focused.\n\n @method focusIn\n @param {Event} event\n */\n focusIn: function(event) {\n sendAction('focus-in', this, event);\n },\n\n /**\n Called when the text area is blurred.\n\n @method focusOut\n @param {Event} event\n */\n focusOut: function(event) {\n sendAction('focus-out', this, event);\n },\n\n /**\n The action to be sent when the user presses a key. Enabled by setting\n the `onEvent` property to `keyPress`.\n\n Uses sendAction to send the `keyPress` action to the controller.\n\n @method keyPress\n @param {Event} event\n */\n keyPress: function(event) {\n sendAction('key-press', this, event);\n }\n\n });\n\n TextSupport.KEY_EVENTS = {\n 13: 'insertNewline',\n 27: 'cancel'\n };\n\n // In principle, this shouldn't be necessary, but the legacy\n // sendAction semantics for TextField are different from\n // the component semantics so this method normalizes them.\n function sendAction(eventName, view, event) {\n var action = get(view, eventName),\n on = get(view, 'onEvent'),\n value = get(view, 'value');\n\n // back-compat support for keyPress as an event name even though\n // it's also a method name that consumes the event (and therefore\n // incompatible with sendAction semantics).\n if (on === eventName || (on === 'keyPress' && eventName === 'key-press')) {\n view.sendAction('action', value);\n }\n\n view.sendAction(eventName, value);\n\n if (action || on === eventName) {\n if(!get(view, 'bubbles')) {\n event.stopPropagation();\n }\n }\n }\n\n __exports__[\"default\"] = TextSupport;\n });\ndefine(\"ember-handlebars/ext\",\n [\"ember-metal/core\",\"ember-runtime/system/string\",\"ember-handlebars-compiler\",\"ember-metal/property_get\",\"ember-metal/binding\",\"ember-metal/error\",\"ember-metal/mixin\",\"ember-metal/is_empty\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.FEATURES, Ember.assert, Ember.Handlebars, Ember.lookup\n // var emberAssert = Ember.assert;\n\n var fmt = __dependency2__.fmt;\n\n var EmberHandlebars = __dependency3__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n\n var get = __dependency4__.get;\n var isGlobalPath = __dependency5__.isGlobalPath;\n var EmberError = __dependency6__[\"default\"];\n var IS_BINDING = __dependency7__.IS_BINDING;\n\n // late bound via requireModule because of circular dependencies.\n var resolveHelper,\n SimpleHandlebarsView;\n\n var isEmpty = __dependency8__[\"default\"];\n\n var slice = [].slice, originalTemplate = EmberHandlebars.template;\n\n /**\n If a path starts with a reserved keyword, returns the root\n that should be used.\n\n @private\n @method normalizePath\n @for Ember\n @param root {Object}\n @param path {String}\n @param data {Hash}\n */\n function normalizePath(root, path, data) {\n var keywords = (data && data.keywords) || {},\n keyword, isKeyword;\n\n // Get the first segment of the path. For example, if the\n // path is \"foo.bar.baz\", returns \"foo\".\n keyword = path.split('.', 1)[0];\n\n // Test to see if the first path is a keyword that has been\n // passed along in the view's data hash. If so, we will treat\n // that object as the new root.\n if (keywords.hasOwnProperty(keyword)) {\n // Look up the value in the template's data hash.\n root = keywords[keyword];\n isKeyword = true;\n\n // Handle cases where the entire path is the reserved\n // word. In that case, return the object itself.\n if (path === keyword) {\n path = '';\n } else {\n // Strip the keyword from the path and look up\n // the remainder from the newly found root.\n path = path.substr(keyword.length+1);\n }\n }\n\n return { root: root, path: path, isKeyword: isKeyword };\n };\n\n\n /**\n Lookup both on root and on window. If the path starts with\n a keyword, the corresponding object will be looked up in the\n template's data hash and used to resolve the path.\n\n @method get\n @for Ember.Handlebars\n @param {Object} root The object to look up the property on\n @param {String} path The path to be lookedup\n @param {Object} options The template's option hash\n */\n function handlebarsGet(root, path, options) {\n var data = options && options.data,\n normalizedPath = normalizePath(root, path, data),\n value;\n\n if (Ember.FEATURES.isEnabled(\"ember-handlebars-caps-lookup\")) {\n\n // If the path starts with a capital letter, look it up on Ember.lookup,\n // which defaults to the `window` object in browsers.\n if (isGlobalPath(path)) {\n value = get(Ember.lookup, path);\n } else {\n\n // In cases where the path begins with a keyword, change the\n // root to the value represented by that keyword, and ensure\n // the path is relative to it.\n value = get(normalizedPath.root, normalizedPath.path);\n }\n\n } else {\n root = normalizedPath.root;\n path = normalizedPath.path;\n\n value = get(root, path);\n\n if (value === undefined && root !== Ember.lookup && isGlobalPath(path)) {\n value = get(Ember.lookup, path);\n }\n }\n\n return value;\n }\n\n /**\n This method uses `Ember.Handlebars.get` to lookup a value, then ensures\n that the value is escaped properly.\n\n If `unescaped` is a truthy value then the escaping will not be performed.\n\n @method getEscaped\n @for Ember.Handlebars\n @param {Object} root The object to look up the property on\n @param {String} path The path to be lookedup\n @param {Object} options The template's option hash\n @since 1.4.0\n */\n function getEscaped(root, path, options) {\n var result = handlebarsGet(root, path, options);\n\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n if (!options.hash.unescaped){\n result = Handlebars.Utils.escapeExpression(result);\n }\n\n return result;\n };\n\n function resolveParams(context, params, options) {\n var resolvedParams = [], types = options.types, param, type;\n\n for (var i=0, l=params.length; i<l; i++) {\n param = params[i];\n type = types[i];\n\n if (type === 'ID') {\n resolvedParams.push(handlebarsGet(context, param, options));\n } else {\n resolvedParams.push(param);\n }\n }\n\n return resolvedParams;\n };\n\n function resolveHash(context, hash, options) {\n var resolvedHash = {}, types = options.hashTypes, type;\n\n for (var key in hash) {\n if (!hash.hasOwnProperty(key)) { continue; }\n\n type = types[key];\n\n if (type === 'ID') {\n resolvedHash[key] = handlebarsGet(context, hash[key], options);\n } else {\n resolvedHash[key] = hash[key];\n }\n }\n\n return resolvedHash;\n };\n\n /**\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @private\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n */\n function helperMissingHelper(path) {\n if (!resolveHelper) { resolveHelper = requireModule('ember-handlebars/helpers/binding')['resolveHelper']; } // ES6TODO: stupid circular dep\n\n var error, view = \"\";\n\n var options = arguments[arguments.length - 1];\n\n var helper = resolveHelper(options.data.view.container, path);\n\n if (helper) {\n return helper.apply(this, slice.call(arguments, 1));\n }\n\n error = \"%@ Handlebars error: Could not find property '%@' on object %@.\";\n if (options.data) {\n view = options.data.view;\n }\n throw new EmberError(fmt(error, [view, path, this]));\n }\n\n /**\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @private\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n */\n function blockHelperMissingHelper(path) {\n if (!resolveHelper) { resolveHelper = requireModule('ember-handlebars/helpers/binding')['resolveHelper']; } // ES6TODO: stupid circular dep\n\n var options = arguments[arguments.length - 1];\n\n Ember.assert(\"`blockHelperMissing` was invoked without a helper name, which \" +\n \"is most likely due to a mismatch between the version of \" +\n \"Ember.js you're running now and the one used to precompile your \" +\n \"templates. Please make sure the version of \" +\n \"`ember-handlebars-compiler` you're using is up to date.\", path);\n\n var helper = resolveHelper(options.data.view.container, path);\n\n if (helper) {\n return helper.apply(this, slice.call(arguments, 1));\n } else {\n return helpers.helperMissing.call(this, path);\n }\n }\n\n /**\n Register a bound handlebars helper. Bound helpers behave similarly to regular\n handlebars helpers, with the added ability to re-render when the underlying data\n changes.\n\n ## Simple example\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalize', function(value) {\n return Ember.String.capitalize(value);\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n ## Example with options\n\n Like normal handlebars helpers, bound helpers have access to the options\n passed into the helper call.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('repeat', function(value, options) {\n var count = options.hash.count;\n var a = [];\n while(a.length < count) {\n a.push(value);\n }\n return a.join('');\n });\n ```\n\n This helper could be used in a template as follows:\n\n ```handlebars\n {{repeat text count=3}}\n ```\n\n ## Example with bound options\n\n Bound hash options are also supported. Example:\n\n ```handlebars\n {{repeat text count=numRepeats}}\n ```\n\n In this example, count will be bound to the value of\n the `numRepeats` property on the context. If that property\n changes, the helper will be re-rendered.\n\n ## Example with extra dependencies\n\n The `Ember.Handlebars.registerBoundHelper` method takes a variable length\n third parameter which indicates extra dependencies on the passed in value.\n This allows the handlebars helper to update when these dependencies change.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalizeName', function(value) {\n return value.get('name').toUpperCase();\n }, 'name');\n ```\n\n ## Example with multiple bound properties\n\n `Ember.Handlebars.registerBoundHelper` supports binding to\n multiple properties, e.g.:\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('concatenate', function() {\n var values = Array.prototype.slice.call(arguments, 0, -1);\n return values.join('||');\n });\n ```\n\n Which allows for template syntax such as `{{concatenate prop1 prop2}}` or\n `{{concatenate prop1 prop2 prop3}}`. If any of the properties change,\n the helper will re-render. Note that dependency keys cannot be\n using in conjunction with multi-property helpers, since it is ambiguous\n which property the dependent keys would belong to.\n\n ## Use with unbound helper\n\n The `{{unbound}}` helper can be used with bound helper invocations\n to render them in their unbound form, e.g.\n\n ```handlebars\n {{unbound capitalize name}}\n ```\n\n In this example, if the name property changes, the helper\n will not re-render.\n\n ## Use with blocks not supported\n\n Bound helpers do not support use with Handlebars blocks or\n the addition of child views of any kind.\n\n @method registerBoundHelper\n @for Ember.Handlebars\n @param {String} name\n @param {Function} function\n @param {String} dependentKeys*\n */\n function registerBoundHelper(name, fn) {\n var boundHelperArgs = slice.call(arguments, 1),\n boundFn = makeBoundHelper.apply(this, boundHelperArgs);\n EmberHandlebars.registerHelper(name, boundFn);\n };\n\n /**\n A helper function used by `registerBoundHelper`. Takes the\n provided Handlebars helper function fn and returns it in wrapped\n bound helper form.\n\n The main use case for using this outside of `registerBoundHelper`\n is for registering helpers on the container:\n\n ```js\n var boundHelperFn = Ember.Handlebars.makeBoundHelper(function(word) {\n return word.toUpperCase();\n });\n\n container.register('helper:my-bound-helper', boundHelperFn);\n ```\n\n In the above example, if the helper function hadn't been wrapped in\n `makeBoundHelper`, the registered helper would be unbound.\n\n @method makeBoundHelper\n @for Ember.Handlebars\n @param {Function} function\n @param {String} dependentKeys*\n @since 1.2.0\n */\n function makeBoundHelper(fn) {\n if (!SimpleHandlebarsView) { SimpleHandlebarsView = requireModule('ember-handlebars/views/handlebars_bound_view')['SimpleHandlebarsView']; } // ES6TODO: stupid circular dep\n\n var dependentKeys = slice.call(arguments, 1);\n\n function helper() {\n var properties = slice.call(arguments, 0, -1),\n numProperties = properties.length,\n options = arguments[arguments.length - 1],\n normalizedProperties = [],\n data = options.data,\n types = data.isUnbound ? slice.call(options.types, 1) : options.types,\n hash = options.hash,\n view = data.view,\n contexts = options.contexts,\n currentContext = (contexts && contexts.length) ? contexts[0] : this,\n prefixPathForDependentKeys = '',\n loc, len, hashOption,\n boundOption, property,\n normalizedValue = SimpleHandlebarsView.prototype.normalizedValue;\n\n Ember.assert(\"registerBoundHelper-generated helpers do not support use with Handlebars blocks.\", !options.fn);\n\n // Detect bound options (e.g. countBinding=\"otherCount\")\n var boundOptions = hash.boundOptions = {};\n for (hashOption in hash) {\n if (IS_BINDING.test(hashOption)) {\n // Lop off 'Binding' suffix.\n boundOptions[hashOption.slice(0, -7)] = hash[hashOption];\n }\n }\n\n // Expose property names on data.properties object.\n var watchedProperties = [];\n data.properties = [];\n for (loc = 0; loc < numProperties; ++loc) {\n data.properties.push(properties[loc]);\n if (types[loc] === 'ID') {\n var normalizedProp = normalizePath(currentContext, properties[loc], data);\n normalizedProperties.push(normalizedProp);\n watchedProperties.push(normalizedProp);\n } else {\n if(data.isUnbound) {\n normalizedProperties.push({path: properties[loc]});\n }else {\n normalizedProperties.push(null);\n }\n }\n }\n\n // Handle case when helper invocation is preceded by `unbound`, e.g.\n // {{unbound myHelper foo}}\n if (data.isUnbound) {\n return evaluateUnboundHelper(this, fn, normalizedProperties, options);\n }\n\n var bindView = new SimpleHandlebarsView(null, null, !options.hash.unescaped, options.data);\n\n // Override SimpleHandlebarsView's method for generating the view's content.\n bindView.normalizedValue = function() {\n var args = [], boundOption;\n\n // Copy over bound hash options.\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n property = normalizePath(currentContext, boundOptions[boundOption], data);\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n hash[boundOption] = normalizedValue.call(bindView);\n }\n\n for (loc = 0; loc < numProperties; ++loc) {\n property = normalizedProperties[loc];\n if (property) {\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n args.push(normalizedValue.call(bindView));\n } else {\n args.push(properties[loc]);\n }\n }\n args.push(options);\n\n // Run the supplied helper function.\n return fn.apply(currentContext, args);\n };\n\n view.appendChild(bindView);\n\n // Assemble list of watched properties that'll re-render this helper.\n for (boundOption in boundOptions) {\n if (boundOptions.hasOwnProperty(boundOption)) {\n watchedProperties.push(normalizePath(currentContext, boundOptions[boundOption], data));\n }\n }\n\n // Observe each property.\n for (loc = 0, len = watchedProperties.length; loc < len; ++loc) {\n property = watchedProperties[loc];\n view.registerObserver(property.root, property.path, bindView, bindView.rerender);\n }\n\n if (types[0] !== 'ID' || normalizedProperties.length === 0) {\n return;\n }\n\n // Add dependent key observers to the first param\n var normalized = normalizedProperties[0],\n pathRoot = normalized.root,\n path = normalized.path;\n\n if(!isEmpty(path)) {\n prefixPathForDependentKeys = path + '.';\n }\n for (var i=0, l=dependentKeys.length; i<l; i++) {\n view.registerObserver(pathRoot, prefixPathForDependentKeys + dependentKeys[i], bindView, bindView.rerender);\n }\n }\n\n helper._rawFunction = fn;\n return helper;\n };\n\n /**\n Renders the unbound form of an otherwise bound helper function.\n\n @private\n @method evaluateUnboundHelper\n @param {Function} fn\n @param {Object} context\n @param {Array} normalizedProperties\n @param {String} options\n */\n function evaluateUnboundHelper(context, fn, normalizedProperties, options) {\n var args = [],\n hash = options.hash,\n boundOptions = hash.boundOptions,\n types = slice.call(options.types, 1),\n loc,\n len,\n property,\n propertyType,\n boundOption;\n\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n hash[boundOption] = handlebarsGet(context, boundOptions[boundOption], options);\n }\n\n for(loc = 0, len = normalizedProperties.length; loc < len; ++loc) {\n property = normalizedProperties[loc];\n propertyType = types[loc];\n if(propertyType === \"ID\") {\n args.push(handlebarsGet(property.root, property.path, options));\n } else {\n args.push(property.path);\n }\n }\n args.push(options);\n return fn.apply(context, args);\n }\n\n /**\n Overrides Handlebars.template so that we can distinguish\n user-created, top-level templates from inner contexts.\n\n @private\n @method template\n @for Ember.Handlebars\n @param {String} spec\n */\n function template(spec) {\n var t = originalTemplate(spec);\n t.isTop = true;\n return t;\n };\n\n __exports__.normalizePath = normalizePath;\n __exports__.template = template;\n __exports__.makeBoundHelper = makeBoundHelper;\n __exports__.registerBoundHelper = registerBoundHelper;\n __exports__.resolveHash = resolveHash;\n __exports__.resolveParams = resolveParams;\n __exports__.handlebarsGet = handlebarsGet;\n __exports__.getEscaped = getEscaped;\n __exports__.evaluateUnboundHelper = evaluateUnboundHelper;\n __exports__.helperMissingHelper = helperMissingHelper;\n __exports__.blockHelperMissingHelper = blockHelperMissingHelper;\n });\ndefine(\"ember-handlebars/helpers/binding\",\n [\"ember-metal/core\",\"ember-handlebars-compiler\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/string\",\"ember-metal/utils\",\"ember-metal/platform\",\"ember-metal/is_none\",\"ember-metal/enumerable_utils\",\"ember-metal/array\",\"ember-views/views/view\",\"ember-metal/run_loop\",\"ember-handlebars/views/handlebars_bound_view\",\"ember-metal/observer\",\"ember-metal/binding\",\"ember-views/system/jquery\",\"ember-handlebars/ext\",\"ember-runtime/keys\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.warn, uuid\n // var emberAssert = Ember.assert, Ember.warn = Ember.warn;\n\n var EmberHandlebars = __dependency2__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n var SafeString = EmberHandlebars.SafeString;\n\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var fmt = __dependency5__.fmt;\n var apply = __dependency6__.apply;\n var o_create = __dependency7__.create;\n var isNone = __dependency8__[\"default\"];\n var EnumerableUtils = __dependency9__[\"default\"];\n var forEach = __dependency10__.forEach;\n var View = __dependency11__.View;\n var run = __dependency12__[\"default\"];\n var _HandlebarsBoundView = __dependency13__._HandlebarsBoundView;\n var SimpleHandlebarsView = __dependency13__.SimpleHandlebarsView;\n var removeObserver = __dependency14__.removeObserver;\n var isGlobalPath = __dependency15__.isGlobalPath;\n var emberBind = __dependency15__.bind;\n var guidFor = __dependency6__.guidFor;\n var typeOf = __dependency6__.typeOf;\n var jQuery = __dependency16__[\"default\"];\n var isArray = __dependency6__.isArray;\n var normalizePath = __dependency17__.normalizePath;\n var handlebarsGet = __dependency17__.handlebarsGet;\n var getEscaped = __dependency17__.getEscaped;\n var handlebarsGetEscaped = __dependency17__.getEscaped;\n var keys = __dependency18__[\"default\"];\n\n function exists(value) {\n return !isNone(value);\n }\n\n var WithView = _HandlebarsBoundView.extend({\n init: function() {\n var controller;\n\n apply(this, this._super, arguments);\n\n var keywords = this.templateData.keywords;\n var keywordName = this.templateHash.keywordName;\n var keywordPath = this.templateHash.keywordPath;\n var controllerName = this.templateHash.controller;\n var preserveContext = this.preserveContext;\n\n if (controllerName) {\n var previousContext = this.previousContext;\n controller = this.container.lookupFactory('controller:'+controllerName).create({\n parentController: previousContext,\n target: previousContext\n });\n\n this._generatedController = controller;\n\n if (!preserveContext) {\n this.set('controller', controller);\n\n this.valueNormalizerFunc = function(result) {\n controller.set('model', result);\n return controller;\n };\n } else {\n var controllerPath = jQuery.expando + guidFor(controller);\n keywords[controllerPath] = controller;\n emberBind(keywords, controllerPath + '.model', keywordPath);\n keywordPath = controllerPath;\n }\n }\n\n if (preserveContext) {\n emberBind(keywords, keywordName, keywordPath);\n }\n\n },\n willDestroy: function() {\n this._super();\n\n if (this._generatedController) {\n this._generatedController.destroy();\n }\n }\n });\n\n // Binds a property into the DOM. This will create a hook in DOM that the\n // KVO system will look for and update if the property changes.\n function bind(property, options, preserveContext, shouldDisplay, valueNormalizer, childProperties) {\n var data = options.data,\n fn = options.fn,\n inverse = options.inverse,\n view = data.view,\n normalized, observer, i;\n\n // we relied on the behavior of calling without\n // context to mean this === window, but when running\n // \"use strict\", it's possible for this to === undefined;\n var currentContext = this || window;\n\n normalized = normalizePath(currentContext, property, data);\n\n // Set up observers for observable objects\n if ('object' === typeof this) {\n if (data.insideGroup) {\n observer = function() {\n run.once(view, 'rerender');\n };\n\n var template, context, result = handlebarsGet(currentContext, property, options);\n\n result = valueNormalizer ? valueNormalizer(result) : result;\n\n context = preserveContext ? currentContext : result;\n if (shouldDisplay(result)) {\n template = fn;\n } else if (inverse) {\n template = inverse;\n }\n\n template(context, { data: options.data });\n } else {\n var viewClass = _HandlebarsBoundView;\n var viewOptions = {\n preserveContext: preserveContext,\n shouldDisplayFunc: shouldDisplay,\n valueNormalizerFunc: valueNormalizer,\n displayTemplate: fn,\n inverseTemplate: inverse,\n path: property,\n pathRoot: currentContext,\n previousContext: currentContext,\n isEscaped: !options.hash.unescaped,\n templateData: options.data,\n templateHash: options.hash,\n helperName: options.helperName\n };\n\n if (options.isWithHelper) {\n viewClass = WithView;\n }\n\n // Create the view that will wrap the output of this template/property\n // and add it to the nearest view's childViews array.\n // See the documentation of Ember._HandlebarsBoundView for more.\n var bindView = view.createChildView(viewClass, viewOptions);\n\n view.appendChild(bindView);\n\n observer = function() {\n run.scheduleOnce('render', bindView, 'rerenderIfNeeded');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n if (childProperties) {\n for (i=0; i<childProperties.length; i++) {\n view.registerObserver(normalized.root, normalized.path+'.'+childProperties[i], observer);\n }\n }\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n data.buffer.push(handlebarsGetEscaped(currentContext, property, options));\n }\n }\n\n function simpleBind(currentContext, property, options) {\n var data = options.data,\n view = data.view,\n normalized, observer, pathRoot, output;\n\n normalized = normalizePath(currentContext, property, data);\n pathRoot = normalized.root;\n\n // Set up observers for observable objects\n if (pathRoot && ('object' === typeof pathRoot)) {\n if (data.insideGroup) {\n observer = function() {\n run.once(view, 'rerender');\n };\n\n output = handlebarsGetEscaped(currentContext, property, options);\n\n data.buffer.push(output);\n } else {\n var bindView = new SimpleHandlebarsView(\n property, currentContext, !options.hash.unescaped, options.data\n );\n\n bindView._parentView = view;\n view.appendChild(bindView);\n\n observer = function() {\n run.scheduleOnce('render', bindView, 'rerender');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n output = handlebarsGetEscaped(currentContext, property, options);\n data.buffer.push(output);\n }\n }\n\n function shouldDisplayIfHelperContent(result) {\n var truthy = result && get(result, 'isTruthy');\n if (typeof truthy === 'boolean') { return truthy; }\n\n if (isArray(result)) {\n return get(result, 'length') !== 0;\n } else {\n return !!result;\n }\n }\n\n /**\n '_triageMustache' is used internally select between a binding, helper, or component for\n the given context. Until this point, it would be hard to determine if the\n mustache is a property reference or a regular helper reference. This triage\n helper resolves that.\n\n This would not be typically invoked by directly.\n\n @private\n @method _triageMustache\n @for Ember.Handlebars.helpers\n @param {String} property Property/helperID to triage\n @param {Object} options hash of template/rendering options\n @return {String} HTML string\n */\n function _triageMustacheHelper(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the _triageMustache helper\", arguments.length <= 2);\n\n var helper = EmberHandlebars.resolveHelper(options.data.view.container, property);\n if (helper) {\n return helper.call(this, options);\n }\n\n return helpers.bind.call(this, property, options);\n }\n\n /**\n Used to lookup/resolve handlebars helpers. The lookup order is:\n\n * Look for a registered helper\n * If a dash exists in the name:\n * Look for a helper registed in the container\n * Use Ember.ComponentLookup to find an Ember.Component that resolves\n to the given name\n\n @private\n @method resolveHelper\n @param {Container} container\n @param {String} name the name of the helper to lookup\n @return {Handlebars Helper}\n */\n function resolveHelper(container, name) {\n if (helpers[name]) {\n return helpers[name];\n }\n\n if (!container || name.indexOf('-') === -1) {\n return;\n }\n\n var helper = container.lookup('helper:' + name);\n if (!helper) {\n var componentLookup = container.lookup('component-lookup:main');\n Ember.assert(\"Could not find 'component-lookup:main' on the provided container, which is necessary for performing component lookups\", componentLookup);\n\n var Component = componentLookup.lookupFactory(name, container);\n if (Component) {\n helper = EmberHandlebars.makeViewHelper(Component);\n container.register('helper:' + name, helper);\n }\n }\n return helper;\n }\n\n\n /**\n `bind` can be used to display a value, then update that value if it\n changes. For example, if you wanted to print the `title` property of\n `content`:\n\n ```handlebars\n {{bind \"content.title\"}}\n ```\n\n This will return the `title` property as a string, then create a new observer\n at the specified path. If it changes, it will update the value in DOM. Note\n that if you need to support IE7 and IE8 you must modify the model objects\n properties using `Ember.get()` and `Ember.set()` for this to work as it\n relies on Ember's KVO system. For all other browsers this will be handled for\n you automatically.\n\n @private\n @method bind\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n */\n function bindHelper(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the bind helper\", arguments.length <= 2);\n\n var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this;\n\n if (!options.fn) {\n return simpleBind(context, property, options);\n }\n\n options.helperName = 'bind';\n\n return bind.call(context, property, options, false, exists);\n }\n\n /**\n Use the `boundIf` helper to create a conditional that re-evaluates\n whenever the truthiness of the bound value changes.\n\n ```handlebars\n {{#boundIf \"content.shouldDisplayTitle\"}}\n {{content.title}}\n {{/boundIf}}\n ```\n\n @private\n @method boundIf\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n */\n function boundIfHelper(property, fn) {\n var context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : this;\n\n fn.helperName = fn.helperName || 'boundIf';\n\n return bind.call(context, property, fn, true, shouldDisplayIfHelperContent, shouldDisplayIfHelperContent, ['isTruthy', 'length']);\n }\n\n\n /**\n @private\n\n Use the `unboundIf` helper to create a conditional that evaluates once.\n\n ```handlebars\n {{#unboundIf \"content.shouldDisplayTitle\"}}\n {{content.title}}\n {{/unboundIf}}\n ```\n\n @method unboundIf\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n @since 1.4.0\n */\n function unboundIfHelper(property, fn) {\n var context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : this,\n data = fn.data,\n template = fn.fn,\n inverse = fn.inverse,\n normalized, propertyValue, result;\n\n normalized = normalizePath(context, property, data);\n propertyValue = handlebarsGet(context, property, fn);\n\n if (!shouldDisplayIfHelperContent(propertyValue)) {\n template = inverse;\n }\n\n template(context, { data: data });\n }\n\n /**\n Use the `{{with}}` helper when you want to scope context. Take the following code as an example:\n\n ```handlebars\n <h5>{{user.name}}</h5>\n\n <div class=\"role\">\n <h6>{{user.role.label}}</h6>\n <span class=\"role-id\">{{user.role.id}}</span>\n\n <p class=\"role-desc\">{{user.role.description}}</p>\n </div>\n ```\n\n `{{with}}` can be our best friend in these cases,\n instead of writing `user.role.*` over and over, we use `{{#with user.role}}`.\n Now the context within the `{{#with}} .. {{/with}}` block is `user.role` so you can do the following:\n\n ```handlebars\n <h5>{{user.name}}</h5>\n\n <div class=\"role\">\n {{#with user.role}}\n <h6>{{label}}</h6>\n <span class=\"role-id\">{{id}}</span>\n\n <p class=\"role-desc\">{{description}}</p>\n {{/with}}\n </div>\n ```\n\n ### `as` operator\n\n This operator aliases the scope to a new name. It's helpful for semantic clarity and to retain\n default scope or to reference from another `{{with}}` block.\n\n ```handlebars\n // posts might not be\n {{#with user.posts as blogPosts}}\n <div class=\"notice\">\n There are {{blogPosts.length}} blog posts written by {{user.name}}.\n </div>\n\n {{#each post in blogPosts}}\n <li>{{post.title}}</li>\n {{/each}}\n {{/with}}\n ```\n\n Without the `as` operator, it would be impossible to reference `user.name` in the example above.\n\n NOTE: The alias should not reuse a name from the bound property path.\n For example: `{{#with foo.bar as foo}}` is not supported because it attempts to alias using\n the first part of the property path, `foo`. Instead, use `{{#with foo.bar as baz}}`.\n\n ### `controller` option\n\n Adding `controller='something'` instructs the `{{with}}` helper to create and use an instance of\n the specified controller with the new context as its content.\n\n This is very similar to using an `itemController` option with the `{{each}}` helper.\n\n ```handlebars\n {{#with users.posts controller='userBlogPosts'}}\n {{!- The current context is wrapped in our controller instance }}\n {{/with}}\n ```\n\n In the above example, the template provided to the `{{with}}` block is now wrapped in the\n `userBlogPost` controller, which provides a very elegant way to decorate the context with custom\n functions/properties.\n\n @method with\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n */\n function withHelper(context, options) {\n var bindContext, preserveContext, controller, helperName = 'with';\n\n if (arguments.length === 4) {\n var keywordName, path, rootPath, normalized, contextPath;\n\n Ember.assert(\"If you pass more than one argument to the with helper, it must be in the form #with foo as bar\", arguments[1] === \"as\");\n options = arguments[3];\n keywordName = arguments[2];\n path = arguments[0];\n\n if (path) {\n helperName += ' ' + path + ' as ' + keywordName;\n }\n\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n var localizedOptions = o_create(options);\n localizedOptions.data = o_create(options.data);\n localizedOptions.data.keywords = o_create(options.data.keywords || {});\n\n if (isGlobalPath(path)) {\n contextPath = path;\n } else {\n normalized = normalizePath(this, path, options.data);\n path = normalized.path;\n rootPath = normalized.root;\n\n // This is a workaround for the fact that you cannot bind separate objects\n // together. When we implement that functionality, we should use it here.\n var contextKey = jQuery.expando + guidFor(rootPath);\n localizedOptions.data.keywords[contextKey] = rootPath;\n // if the path is '' (\"this\"), just bind directly to the current context\n contextPath = path ? contextKey + '.' + path : contextKey;\n }\n\n localizedOptions.hash.keywordName = keywordName;\n localizedOptions.hash.keywordPath = contextPath;\n\n bindContext = this;\n context = path;\n options = localizedOptions;\n preserveContext = true;\n } else {\n Ember.assert(\"You must pass exactly one argument to the with helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n helperName += ' ' + context;\n bindContext = options.contexts[0];\n preserveContext = false;\n }\n\n options.helperName = helperName;\n options.isWithHelper = true;\n\n return bind.call(bindContext, context, options, preserveContext, exists);\n }\n /**\n See [boundIf](/api/classes/Ember.Handlebars.helpers.html#method_boundIf)\n and [unboundIf](/api/classes/Ember.Handlebars.helpers.html#method_unboundIf)\n\n @method if\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n */\n function ifHelper(context, options) {\n Ember.assert(\"You must pass exactly one argument to the if helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the if helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n options.helperName = options.helperName || ('if ' + context);\n\n if (options.data.isUnbound) {\n return helpers.unboundIf.call(options.contexts[0], context, options);\n } else {\n return helpers.boundIf.call(options.contexts[0], context, options);\n }\n }\n\n /**\n @method unless\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n */\n function unlessHelper(context, options) {\n Ember.assert(\"You must pass exactly one argument to the unless helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the unless helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n var fn = options.fn, inverse = options.inverse, helperName = 'unless';\n\n if (context) {\n helperName += ' ' + context;\n }\n\n options.fn = inverse;\n options.inverse = fn;\n\n options.helperName = options.helperName || helperName;\n\n if (options.data.isUnbound) {\n return helpers.unboundIf.call(options.contexts[0], context, options);\n } else {\n return helpers.boundIf.call(options.contexts[0], context, options);\n }\n }\n\n /**\n `bind-attr` allows you to create a binding between DOM element attributes and\n Ember objects. For example:\n\n ```handlebars\n <img {{bind-attr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n The above handlebars template will fill the `<img>`'s `src` attribute will\n the value of the property referenced with `\"imageUrl\"` and its `alt`\n attribute with the value of the property referenced with `\"imageTitle\"`.\n\n If the rendering context of this template is the following object:\n\n ```javascript\n {\n imageUrl: 'http://lolcats.info/haz-a-funny',\n imageTitle: 'A humorous image of a cat'\n }\n ```\n\n The resulting HTML output will be:\n\n ```html\n <img src=\"http://lolcats.info/haz-a-funny\" alt=\"A humorous image of a cat\">\n ```\n\n `bind-attr` cannot redeclare existing DOM element attributes. The use of `src`\n in the following `bind-attr` example will be ignored and the hard coded value\n of `src=\"/failwhale.gif\"` will take precedence:\n\n ```handlebars\n <img src=\"/failwhale.gif\" {{bind-attr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n ### `bind-attr` and the `class` attribute\n\n `bind-attr` supports a special syntax for handling a number of cases unique\n to the `class` DOM element attribute. The `class` attribute combines\n multiple discrete values into a single attribute as a space-delimited\n list of strings. Each string can be:\n\n * a string return value of an object's property.\n * a boolean return value of an object's property\n * a hard-coded value\n\n A string return value works identically to other uses of `bind-attr`. The\n return value of the property will become the value of the attribute. For\n example, the following view and template:\n\n ```javascript\n AView = View.extend({\n someProperty: function() {\n return \"aValue\";\n }.property()\n })\n ```\n\n ```handlebars\n <img {{bind-attr class=\"view.someProperty}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"aValue\">\n ```\n\n A boolean return value will insert a specified class name if the property\n returns `true` and remove the class name if the property returns `false`.\n\n A class name is provided via the syntax\n `somePropertyName:class-name-if-true`.\n\n ```javascript\n AView = View.extend({\n someBool: true\n })\n ```\n\n ```handlebars\n <img {{bind-attr class=\"view.someBool:class-name-if-true\"}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"class-name-if-true\">\n ```\n\n An additional section of the binding can be provided if you want to\n replace the existing class instead of removing it when the boolean\n value changes:\n\n ```handlebars\n <img {{bind-attr class=\"view.someBool:class-name-if-true:class-name-if-false\"}}>\n ```\n\n A hard-coded value can be used by prepending `:` to the desired\n class name: `:class-name-to-always-apply`.\n\n ```handlebars\n <img {{bind-attr class=\":class-name-to-always-apply\"}}>\n ```\n\n Results in the following rendered output:\n\n ```html\n <img class=\"class-name-to-always-apply\">\n ```\n\n All three strategies - string return value, boolean return value, and\n hard-coded value – can be combined in a single declaration:\n\n ```handlebars\n <img {{bind-attr class=\":class-name-to-always-apply view.someBool:class-name-if-true view.someProperty\"}}>\n ```\n\n @method bind-attr\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n */\n function bindAttrHelper(options) {\n var attrs = options.hash;\n\n Ember.assert(\"You must specify at least one hash argument to bind-attr\", !!keys(attrs).length);\n\n var view = options.data.view;\n var ret = [];\n\n // we relied on the behavior of calling without\n // context to mean this === window, but when running\n // \"use strict\", it's possible for this to === undefined;\n var ctx = this || window;\n\n // Generate a unique id for this element. This will be added as a\n // data attribute to the element so it can be looked up when\n // the bound property changes.\n var dataId = ++Ember.uuid;\n\n // Handle classes differently, as we can bind multiple classes\n var classBindings = attrs['class'];\n if (classBindings != null) {\n var classResults = bindClasses(ctx, classBindings, view, dataId, options);\n\n ret.push('class=\"' + Handlebars.Utils.escapeExpression(classResults.join(' ')) + '\"');\n delete attrs['class'];\n }\n\n var attrKeys = keys(attrs);\n\n // For each attribute passed, create an observer and emit the\n // current value of the property as an attribute.\n forEach.call(attrKeys, function(attr) {\n var path = attrs[attr],\n normalized;\n\n Ember.assert(fmt(\"You must provide an expression as the value of bound attribute. You specified: %@=%@\", [attr, path]), typeof path === 'string');\n\n normalized = normalizePath(ctx, path, options.data);\n\n var value = (path === 'this') ? normalized.root : handlebarsGet(ctx, path, options),\n type = typeOf(value);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [value]), value === null || value === undefined || type === 'number' || type === 'string' || type === 'boolean');\n\n var observer, invoker;\n\n observer = function observer() {\n var result = handlebarsGet(ctx, path, options);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [result]),\n result === null || result === undefined || typeof result === 'number' ||\n typeof result === 'string' || typeof result === 'boolean');\n\n var elem = view.$(\"[data-bindattr-\" + dataId + \"='\" + dataId + \"']\");\n\n // If we aren't able to find the element, it means the element\n // to which we were bound has been removed from the view.\n // In that case, we can assume the template has been re-rendered\n // and we need to clean up the observer.\n if (!elem || elem.length === 0) {\n removeObserver(normalized.root, normalized.path, invoker);\n return;\n }\n\n View.applyAttributeBindings(elem, attr, result);\n };\n\n // Add an observer to the view for when the property changes.\n // When the observer fires, find the element using the\n // unique data id and update the attribute to the new value.\n // Note: don't add observer when path is 'this' or path\n // is whole keyword e.g. {{#each x in list}} ... {{bind-attr attr=\"x\"}}\n if (path !== 'this' && !(normalized.isKeyword && normalized.path === '' )) {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n\n // if this changes, also change the logic in ember-views/lib/views/view.js\n if ((type === 'string' || (type === 'number' && !isNaN(value)))) {\n ret.push(attr + '=\"' + Handlebars.Utils.escapeExpression(value) + '\"');\n } else if (value && type === 'boolean') {\n // The developer controls the attr name, so it should always be safe\n ret.push(attr + '=\"' + attr + '\"');\n }\n }, this);\n\n // Add the unique identifier\n // NOTE: We use all lower-case since Firefox has problems with mixed case in SVG\n ret.push('data-bindattr-' + dataId + '=\"' + dataId + '\"');\n return new SafeString(ret.join(' '));\n }\n\n /**\n See `bind-attr`\n\n @method bindAttr\n @for Ember.Handlebars.helpers\n @deprecated\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n */\n function bindAttrHelperDeprecated() {\n Ember.warn(\"The 'bindAttr' view helper is deprecated in favor of 'bind-attr'\");\n return helpers['bind-attr'].apply(this, arguments);\n }\n\n /**\n Helper that, given a space-separated string of property paths and a context,\n returns an array of class names. Calling this method also has the side\n effect of setting up observers at those property paths, such that if they\n change, the correct class name will be reapplied to the DOM element.\n\n For example, if you pass the string \"fooBar\", it will first look up the\n \"fooBar\" value of the context. If that value is true, it will add the\n \"foo-bar\" class to the current element (i.e., the dasherized form of\n \"fooBar\"). If the value is a string, it will add that string as the class.\n Otherwise, it will not add any new class name.\n\n @private\n @method bindClasses\n @for Ember.Handlebars\n @param {Ember.Object} context The context from which to lookup properties\n @param {String} classBindings A string, space-separated, of class bindings\n to use\n @param {View} view The view in which observers should look for the\n element to update\n @param {Srting} bindAttrId Optional bindAttr id used to lookup elements\n @return {Array} An array of class names to add\n */\n function bindClasses(context, classBindings, view, bindAttrId, options) {\n var ret = [], newClass, value, elem;\n\n // Helper method to retrieve the property from the context and\n // determine which class string to return, based on whether it is\n // a Boolean or not.\n var classStringForPath = function(root, parsedPath, options) {\n var val,\n path = parsedPath.path;\n\n if (path === 'this') {\n val = root;\n } else if (path === '') {\n val = true;\n } else {\n val = handlebarsGet(root, path, options);\n }\n\n return View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n };\n\n // For each property passed, loop through and setup\n // an observer.\n forEach.call(classBindings.split(' '), function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n\n var observer, invoker;\n\n var parsedPath = View._parsePropertyPath(binding),\n path = parsedPath.path,\n pathRoot = context,\n normalized;\n\n if (path !== '' && path !== 'this') {\n normalized = normalizePath(context, path, options.data);\n\n pathRoot = normalized.root;\n path = normalized.path;\n }\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n observer = function() {\n // Get the current value of the property\n newClass = classStringForPath(context, parsedPath, options);\n elem = bindAttrId ? view.$(\"[data-bindattr-\" + bindAttrId + \"='\" + bindAttrId + \"']\") : view.$();\n\n // If we can't find the element anymore, a parent template has been\n // re-rendered and we've been nuked. Remove the observer.\n if (!elem || elem.length === 0) {\n removeObserver(pathRoot, path, invoker);\n } else {\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n }\n };\n\n if (path !== '' && path !== 'this') {\n view.registerObserver(pathRoot, path, observer);\n }\n\n // We've already setup the observer; now we just need to figure out the\n // correct behavior right now on the first pass through.\n value = classStringForPath(context, parsedPath, options);\n\n if (value) {\n ret.push(value);\n\n // Make sure we save the current value so that it can be removed if the\n // observer fires.\n oldClass = value;\n }\n });\n\n return ret;\n };\n\n __exports__.bind = bind;\n __exports__._triageMustacheHelper = _triageMustacheHelper;\n __exports__.resolveHelper = resolveHelper;\n __exports__.bindHelper = bindHelper;\n __exports__.boundIfHelper = boundIfHelper;\n __exports__.unboundIfHelper = unboundIfHelper;\n __exports__.withHelper = withHelper;\n __exports__.ifHelper = ifHelper;\n __exports__.unlessHelper = unlessHelper;\n __exports__.bindAttrHelper = bindAttrHelper;\n __exports__.bindAttrHelperDeprecated = bindAttrHelperDeprecated;\n __exports__.bindClasses = bindClasses;\n });\ndefine(\"ember-handlebars/helpers/collection\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-handlebars-compiler\",\"ember-runtime/system/string\",\"ember-metal/property_get\",\"ember-handlebars/ext\",\"ember-handlebars/helpers/view\",\"ember-metal/computed\",\"ember-views/views/collection_view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.deprecate\n var inspect = __dependency2__.inspect;\n\n // var emberAssert = Ember.assert;\n // emberDeprecate = Ember.deprecate;\n\n var EmberHandlebars = __dependency3__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n\n var fmt = __dependency4__.fmt;\n var get = __dependency5__.get;\n var handlebarsGet = __dependency6__.handlebarsGet;\n var ViewHelper = __dependency7__.ViewHelper;\n var computed = __dependency8__.computed;\n var CollectionView = __dependency9__[\"default\"];\n\n var alias = computed.alias;\n /**\n `{{collection}}` is a `Ember.Handlebars` helper for adding instances of\n `Ember.CollectionView` to a template. See [Ember.CollectionView](/api/classes/Ember.CollectionView.html)\n for additional information on how a `CollectionView` functions.\n\n `{{collection}}`'s primary use is as a block helper with a `contentBinding`\n option pointing towards an `Ember.Array`-compatible object. An `Ember.View`\n instance will be created for each item in its `content` property. Each view\n will have its own `content` property set to the appropriate item in the\n collection.\n\n The provided block will be applied as the template for each item's view.\n\n Given an empty `<body>` the following template:\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n And the following application code\n\n ```javascript\n App = Ember.Application.create()\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Hi Dave</div>\n <div class=\"ember-view\">Hi Mary</div>\n <div class=\"ember-view\">Hi Sara</div>\n </div>\n ```\n\n ### Blockless use in a collection\n\n If you provide an `itemViewClass` option that has its own `template` you can\n omit the block.\n\n The following template:\n\n ```handlebars\n {{collection contentBinding=\"App.items\" itemViewClass=\"App.AnItemView\"}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create();\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ];\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{view.content.name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n ### Specifying a CollectionView subclass\n\n By default the `{{collection}}` helper will create an instance of\n `Ember.CollectionView`. You can supply a `Ember.CollectionView` subclass to\n the helper by passing it as the first argument:\n\n ```handlebars\n {{#collection App.MyCustomCollectionClass contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n ### Forwarded `item.*`-named Options\n\n As with the `{{view}}`, helper options passed to the `{{collection}}` will be\n set on the resulting `Ember.CollectionView` as properties. Additionally,\n options prefixed with `item` will be applied to the views rendered for each\n item (note the camelcasing):\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"\n itemTagName=\"p\"\n itemClassNames=\"greeting\"}}\n Howdy {{view.content.name}}\n {{/collection}}\n ```\n\n Will result in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <p class=\"ember-view greeting\">Howdy Dave</p>\n <p class=\"ember-view greeting\">Howdy Mary</p>\n <p class=\"ember-view greeting\">Howdy Sara</p>\n </div>\n ```\n\n @method collection\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n @deprecated Use `{{each}}` helper instead.\n */\n function collectionHelper(path, options) {\n Ember.deprecate(\"Using the {{collection}} helper without specifying a class has been deprecated as the {{each}} helper now supports the same functionality.\", path !== 'collection');\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = undefined;\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 1);\n } else {\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 2);\n }\n\n var fn = options.fn;\n var data = options.data;\n var inverse = options.inverse;\n var view = options.data.view;\n\n\n var controller, container;\n // If passed a path string, convert that into an object.\n // Otherwise, just default to the standard class.\n var collectionClass;\n if (path) {\n controller = data.keywords.controller;\n container = controller && controller.container;\n collectionClass = handlebarsGet(this, path, options) || container.lookupFactory('view:' + path);\n Ember.assert(fmt(\"%@ #collection: Could not find collection class %@\", [data.view, path]), !!collectionClass);\n }\n else {\n collectionClass = CollectionView;\n }\n\n var hash = options.hash, itemHash = {}, match;\n\n // Extract item view class if provided else default to the standard class\n var collectionPrototype = collectionClass.proto(), itemViewClass;\n\n if (hash.itemView) {\n controller = data.keywords.controller;\n Ember.assert('You specified an itemView, but the current context has no ' +\n 'container to look the itemView up in. This probably means ' +\n 'that you created a view manually, instead of through the ' +\n 'container. Instead, use container.lookup(\"view:viewName\"), ' +\n 'which will properly instantiate your view.',\n controller && controller.container);\n container = controller.container;\n itemViewClass = container.lookupFactory('view:' + hash.itemView);\n Ember.assert('You specified the itemView ' + hash.itemView + \", but it was \" +\n \"not found at \" + container.describe(\"view:\" + hash.itemView) +\n \" (and it was not registered in the container)\", !!itemViewClass);\n } else if (hash.itemViewClass) {\n itemViewClass = handlebarsGet(collectionPrototype, hash.itemViewClass, options);\n } else {\n itemViewClass = collectionPrototype.itemViewClass;\n }\n\n Ember.assert(fmt(\"%@ #collection: Could not find itemViewClass %@\", [data.view, itemViewClass]), !!itemViewClass);\n\n delete hash.itemViewClass;\n delete hash.itemView;\n\n // Go through options passed to the {{collection}} helper and extract options\n // that configure item views instead of the collection itself.\n for (var prop in hash) {\n if (hash.hasOwnProperty(prop)) {\n match = prop.match(/^item(.)(.*)$/);\n\n if (match && prop !== 'itemController') {\n // Convert itemShouldFoo -> shouldFoo\n itemHash[match[1].toLowerCase() + match[2]] = hash[prop];\n // Delete from hash as this will end up getting passed to the\n // {{view}} helper method.\n delete hash[prop];\n }\n }\n }\n\n if (fn) {\n itemHash.template = fn;\n delete options.fn;\n }\n\n var emptyViewClass;\n if (inverse && inverse !== EmberHandlebars.VM.noop) {\n emptyViewClass = get(collectionPrototype, 'emptyViewClass');\n emptyViewClass = emptyViewClass.extend({\n template: inverse,\n tagName: itemHash.tagName\n });\n } else if (hash.emptyViewClass) {\n emptyViewClass = handlebarsGet(this, hash.emptyViewClass, options);\n }\n if (emptyViewClass) { hash.emptyView = emptyViewClass; }\n\n if (hash.keyword) {\n itemHash._context = this;\n } else {\n itemHash._context = alias('content');\n }\n\n var viewOptions = ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);\n hash.itemViewClass = itemViewClass.extend(viewOptions);\n\n options.helperName = options.helperName || 'collection';\n\n return helpers.view.call(this, collectionClass, options);\n }\n\n __exports__[\"default\"] = collectionHelper;\n });\ndefine(\"ember-handlebars/helpers/debug\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/logger\",\"ember-metal/property_get\",\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n /*jshint debug:true*/\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.FEATURES,\n var inspect = __dependency2__.inspect;\n var Logger = __dependency3__[\"default\"];\n\n var get = __dependency4__.get;\n var normalizePath = __dependency5__.normalizePath;\n var handlebarsGet = __dependency5__.handlebarsGet;\n\n var a_slice = [].slice;\n\n /**\n `log` allows you to output the value of variables in the current rendering\n context. `log` also accepts primitive types such as strings or numbers.\n\n ```handlebars\n {{log \"myVariable:\" myVariable }}\n ```\n\n @method log\n @for Ember.Handlebars.helpers\n @param {String} property\n */\n function logHelper() {\n var params = a_slice.call(arguments, 0, -1),\n options = arguments[arguments.length - 1],\n logger = Logger.log,\n values = [],\n allowPrimitives = true;\n\n for (var i = 0; i < params.length; i++) {\n var type = options.types[i];\n\n if (type === 'ID' || !allowPrimitives) {\n var context = (options.contexts && options.contexts[i]) || this,\n normalized = normalizePath(context, params[i], options.data);\n\n if (normalized.path === 'this') {\n values.push(normalized.root);\n } else {\n values.push(handlebarsGet(normalized.root, normalized.path, options));\n }\n } else {\n values.push(params[i]);\n }\n }\n\n logger.apply(logger, values);\n };\n\n /**\n Execute the `debugger` statement in the current context.\n\n ```handlebars\n {{debugger}}\n ```\n\n Before invoking the `debugger` statement, there\n are a few helpful variables defined in the\n body of this helper that you can inspect while\n debugging that describe how and where this\n helper was invoked:\n\n - templateContext: this is most likely a controller\n from which this template looks up / displays properties\n - typeOfTemplateContext: a string description of\n what the templateContext is\n\n For example, if you're wondering why a value `{{foo}}`\n isn't rendering as expected within a template, you\n could place a `{{debugger}}` statement, and when\n the `debugger;` breakpoint is hit, you can inspect\n `templateContext`, determine if it's the object you\n expect, and/or evaluate expressions in the console\n to perform property lookups on the `templateContext`:\n\n ```\n > templateContext.get('foo') // -> \"<value of {{foo}}>\"\n ```\n\n @method debugger\n @for Ember.Handlebars.helpers\n @param {String} property\n */\n function debuggerHelper(options) {\n\n // These are helpful values you can inspect while debugging.\n var templateContext = this;\n var typeOfTemplateContext = inspect(templateContext);\n\n debugger;\n }\n\n __exports__.logHelper = logHelper;\n __exports__.debuggerHelper = debuggerHelper;\n });\ndefine(\"ember-handlebars/helpers/each\",\n [\"ember-metal/core\",\"ember-handlebars-compiler\",\"ember-runtime/system/string\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-handlebars/views/metamorph_view\",\"ember-views/views/collection_view\",\"ember-metal/binding\",\"ember-runtime/controllers/controller\",\"ember-runtime/controllers/array_controller\",\"ember-runtime/mixins/array\",\"ember-runtime/copy\",\"ember-metal/run_loop\",\"ember-metal/observer\",\"ember-metal/events\",\"ember-handlebars/ext\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __exports__) {\n \"use strict\";\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.assert;, Ember.K\n // var emberAssert = Ember.assert,\n var K = Ember.K;\n\n var EmberHandlebars = __dependency2__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n\n var fmt = __dependency3__.fmt;\n var get = __dependency4__.get;\n var set = __dependency5__.set;\n var _Metamorph = __dependency6__._Metamorph;\n var _MetamorphView = __dependency6__._MetamorphView;\n var CollectionView = __dependency7__[\"default\"];\n var Binding = __dependency8__.Binding;\n var ControllerMixin = __dependency9__.ControllerMixin;\n var ArrayController = __dependency10__[\"default\"];\n var EmberArray = __dependency11__[\"default\"];\n var copy = __dependency12__[\"default\"];\n var run = __dependency13__[\"default\"];\n var addObserver = __dependency14__.addObserver;\n var removeObserver = __dependency14__.removeObserver;\n var addBeforeObserver = __dependency14__.addBeforeObserver;\n var removeBeforeObserver = __dependency14__.removeBeforeObserver;\n var on = __dependency15__.on;\n var handlebarsGet = __dependency16__.handlebarsGet;\n var computed = __dependency17__.computed;\n\n var handlebarsGet = __dependency16__.handlebarsGet;\n\n var EachView = CollectionView.extend(_Metamorph, {\n\n init: function() {\n var itemController = get(this, 'itemController');\n var binding;\n\n if (itemController) {\n var controller = get(this, 'controller.container').lookupFactory('controller:array').create({\n _isVirtual: true,\n parentController: get(this, 'controller'),\n itemController: itemController,\n target: get(this, 'controller'),\n _eachView: this\n });\n\n this.disableContentObservers(function() {\n set(this, 'content', controller);\n binding = new Binding('content', '_eachView.dataSource').oneWay();\n binding.connect(controller);\n });\n\n set(this, '_arrayController', controller);\n } else {\n this.disableContentObservers(function() {\n binding = new Binding('content', 'dataSource').oneWay();\n binding.connect(this);\n });\n }\n\n return this._super();\n },\n\n _assertArrayLike: function(content) {\n Ember.assert(fmt(\"The value that #each loops over must be an Array. You \" +\n \"passed %@, but it should have been an ArrayController\",\n [content.constructor]),\n !ControllerMixin.detect(content) ||\n (content && content.isGenerated) ||\n content instanceof ArrayController);\n Ember.assert(fmt(\"The value that #each loops over must be an Array. You passed %@\", [(ControllerMixin.detect(content) && content.get('model') !== undefined) ? fmt(\"'%@' (wrapped in %@)\", [content.get('model'), content]) : content]), EmberArray.detect(content));\n },\n\n disableContentObservers: function(callback) {\n removeBeforeObserver(this, 'content', null, '_contentWillChange');\n removeObserver(this, 'content', null, '_contentDidChange');\n\n callback.call(this);\n\n addBeforeObserver(this, 'content', null, '_contentWillChange');\n addObserver(this, 'content', null, '_contentDidChange');\n },\n\n itemViewClass: _MetamorphView,\n emptyViewClass: _MetamorphView,\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n // At the moment, if a container view subclass wants\n // to insert keywords, it is responsible for cloning\n // the keywords hash. This will be fixed momentarily.\n var keyword = get(this, 'keyword');\n var content = get(view, 'content');\n\n if (keyword) {\n var data = get(view, 'templateData');\n\n data = copy(data);\n data.keywords = view.cloneKeywords();\n set(view, 'templateData', data);\n\n // In this case, we do not bind, because the `content` of\n // a #each item cannot change.\n data.keywords[keyword] = content;\n }\n\n // If {{#each}} is looping over an array of controllers,\n // point each child view at their respective controller.\n if (content && content.isController) {\n set(view, 'controller', content);\n }\n\n return view;\n },\n\n destroy: function() {\n if (!this._super()) { return; }\n\n var arrayController = get(this, '_arrayController');\n\n if (arrayController) {\n arrayController.destroy();\n }\n\n return this;\n }\n });\n\n // Defeatureify doesn't seem to like nested functions that need to be removed\n function _addMetamorphCheck() {\n EachView.reopen({\n _checkMetamorph: on('didInsertElement', function() {\n Ember.assert(\"The metamorph tags, \" +\n this.morph.start + \" and \" + this.morph.end +\n \", have different parents.\\nThe browser has fixed your template to output valid HTML (for example, check that you have properly closed all tags and have used a TBODY tag when creating a table with '{{#each}}')\",\n document.getElementById( this.morph.start ).parentNode ===\n document.getElementById( this.morph.end ).parentNode\n );\n })\n });\n }\n\n // until ember-debug is es6ed\n var runInDebug = function(f){f()};\n runInDebug( function() {\n _addMetamorphCheck();\n });\n\n var GroupedEach = EmberHandlebars.GroupedEach = function(context, path, options) {\n var self = this,\n normalized = EmberHandlebars.normalizePath(context, path, options.data);\n\n this.context = context;\n this.path = path;\n this.options = options;\n this.template = options.fn;\n this.containingView = options.data.view;\n this.normalizedRoot = normalized.root;\n this.normalizedPath = normalized.path;\n this.content = this.lookupContent();\n\n this.addContentObservers();\n this.addArrayObservers();\n\n this.containingView.on('willClearRender', function() {\n self.destroy();\n });\n };\n\n GroupedEach.prototype = {\n contentWillChange: function() {\n this.removeArrayObservers();\n },\n\n contentDidChange: function() {\n this.content = this.lookupContent();\n this.addArrayObservers();\n this.rerenderContainingView();\n },\n\n contentArrayWillChange: K,\n\n contentArrayDidChange: function() {\n this.rerenderContainingView();\n },\n\n lookupContent: function() {\n return handlebarsGet(this.normalizedRoot, this.normalizedPath, this.options);\n },\n\n addArrayObservers: function() {\n if (!this.content) { return; }\n\n this.content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n removeArrayObservers: function() {\n if (!this.content) { return; }\n\n this.content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n addContentObservers: function() {\n addBeforeObserver(this.normalizedRoot, this.normalizedPath, this, this.contentWillChange);\n addObserver(this.normalizedRoot, this.normalizedPath, this, this.contentDidChange);\n },\n\n removeContentObservers: function() {\n removeBeforeObserver(this.normalizedRoot, this.normalizedPath, this.contentWillChange);\n removeObserver(this.normalizedRoot, this.normalizedPath, this.contentDidChange);\n },\n\n render: function() {\n if (!this.content) { return; }\n\n var content = this.content,\n contentLength = get(content, 'length'),\n data = this.options.data,\n template = this.template;\n\n data.insideEach = true;\n for (var i = 0; i < contentLength; i++) {\n template(content.objectAt(i), { data: data });\n }\n },\n\n rerenderContainingView: function() {\n var self = this;\n run.scheduleOnce('render', this, function() {\n // It's possible it's been destroyed after we enqueued a re-render call.\n if (!self.destroyed) {\n self.containingView.rerender();\n }\n });\n },\n\n destroy: function() {\n this.removeContentObservers();\n if (this.content) {\n this.removeArrayObservers();\n }\n this.destroyed = true;\n }\n };\n\n /**\n The `{{#each}}` helper loops over elements in a collection, rendering its\n block once for each item. It is an extension of the base Handlebars `{{#each}}`\n helper:\n\n ```javascript\n Developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}];\n ```\n\n ```handlebars\n {{#each Developers}}\n {{name}}\n {{/each}}\n ```\n\n `{{each}}` supports an alternative syntax with element naming:\n\n ```handlebars\n {{#each person in Developers}}\n {{person.name}}\n {{/each}}\n ```\n\n When looping over objects that do not have properties, `{{this}}` can be used\n to render the object:\n\n ```javascript\n DeveloperNames = ['Yehuda', 'Tom', 'Paul']\n ```\n\n ```handlebars\n {{#each DeveloperNames}}\n {{this}}\n {{/each}}\n ```\n ### {{else}} condition\n `{{#each}}` can have a matching `{{else}}`. The contents of this block will render\n if the collection is empty.\n\n ```\n {{#each person in Developers}}\n {{person.name}}\n {{else}}\n <p>Sorry, nobody is available for this task.</p>\n {{/each}}\n ```\n ### Specifying a View class for items\n If you provide an `itemViewClass` option that references a view class\n with its own `template` you can omit the block.\n\n The following template:\n\n ```handlebars\n {{#view App.MyView }}\n {{each view.items itemViewClass=\"App.AnItemView\"}}\n {{/view}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create({\n MyView: Ember.View.extend({\n items: [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n })\n });\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n If an `itemViewClass` is defined on the helper, and therefore the helper is not\n being used as a block, an `emptyViewClass` can also be provided optionally.\n The `emptyViewClass` will match the behavior of the `{{else}}` condition\n described above. That is, the `emptyViewClass` will render if the collection\n is empty.\n\n ### Representing each item with a Controller.\n By default the controller lookup within an `{{#each}}` block will be\n the controller of the template where the `{{#each}}` was used. If each\n item needs to be presented by a custom controller you can provide a\n `itemController` option which references a controller by lookup name.\n Each item in the loop will be wrapped in an instance of this controller\n and the item itself will be set to the `content` property of that controller.\n\n This is useful in cases where properties of model objects need transformation\n or synthesis for display:\n\n ```javascript\n App.DeveloperController = Ember.ObjectController.extend({\n isAvailableForHire: function() {\n return !this.get('content.isEmployed') && this.get('content.isSeekingWork');\n }.property('isEmployed', 'isSeekingWork')\n })\n ```\n\n ```handlebars\n {{#each person in developers itemController=\"developer\"}}\n {{person.name}} {{#if person.isAvailableForHire}}Hire me!{{/if}}\n {{/each}}\n ```\n\n Each itemController will receive a reference to the current controller as\n a `parentController` property.\n\n ### (Experimental) Grouped Each\n\n When used in conjunction with the experimental [group helper](https://github.com/emberjs/group-helper),\n you can inform Handlebars to re-render an entire group of items instead of\n re-rendering them one at a time (in the event that they are changed en masse\n or an item is added/removed).\n\n ```handlebars\n {{#group}}\n {{#each people}}\n {{firstName}} {{lastName}}\n {{/each}}\n {{/group}}\n ```\n\n This can be faster than the normal way that Handlebars re-renders items\n in some cases.\n\n If for some reason you have a group with more than one `#each`, you can make\n one of the collections be updated in normal (non-grouped) fashion by setting\n the option `groupedRows=true` (counter-intuitive, I know).\n\n For example,\n\n ```handlebars\n {{dealershipName}}\n\n {{#group}}\n {{#each dealers}}\n {{firstName}} {{lastName}}\n {{/each}}\n\n {{#each car in cars groupedRows=true}}\n {{car.make}} {{car.model}} {{car.color}}\n {{/each}}\n {{/group}}\n ```\n Any change to `dealershipName` or the `dealers` collection will cause the\n entire group to be re-rendered. However, changes to the `cars` collection\n will be re-rendered individually (as normal).\n\n Note that `group` behavior is also disabled by specifying an `itemViewClass`.\n\n @method each\n @for Ember.Handlebars.helpers\n @param [name] {String} name for item (used with `in`)\n @param [path] {String} path\n @param [options] {Object} Handlebars key/value pairs of options\n @param [options.itemViewClass] {String} a path to a view class used for each item\n @param [options.itemController] {String} name of a controller to be created for each item\n @param [options.groupedRows] {boolean} enable normal item-by-item rendering when inside a `#group` helper\n */\n function eachHelper(path, options) {\n var ctx, helperName = 'each';\n\n if (arguments.length === 4) {\n Ember.assert(\"If you pass more than one argument to the each helper, it must be in the form #each foo in bar\", arguments[1] === \"in\");\n\n var keywordName = arguments[0];\n\n\n options = arguments[3];\n path = arguments[2];\n\n helperName += ' ' + keywordName + ' in ' + path;\n\n if (path === '') { path = \"this\"; }\n\n options.hash.keyword = keywordName;\n\n } else if (arguments.length === 1) {\n options = path;\n path = 'this';\n } else {\n helperName += ' ' + path;\n }\n\n options.hash.dataSourceBinding = path;\n // Set up emptyView as a metamorph with no tag\n //options.hash.emptyViewClass = Ember._MetamorphView;\n\n // can't rely on this default behavior when use strict\n ctx = this || window;\n\n options.helperName = options.helperName || helperName;\n\n if (options.data.insideGroup && !options.hash.groupedRows && !options.hash.itemViewClass) {\n new GroupedEach(ctx, path, options).render();\n } else {\n // ES6TODO: figure out how to do this without global lookup.\n return helpers.collection.call(ctx, 'Ember.Handlebars.EachView', options);\n }\n }\n\n __exports__.EachView = EachView;\n __exports__.GroupedEach = GroupedEach;\n __exports__.eachHelper = eachHelper;\n });\ndefine(\"ember-handlebars/helpers/loc\",\n [\"ember-runtime/system/string\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var loc = __dependency1__.loc;\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n // ES6TODO:\n // Pretty sure this can be expressed as\n // var locHelper EmberStringUtils.loc ?\n\n /**\n Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the\n provided string.\n\n This is a convenient way to localize text. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"home\">\n {{loc \"welcome\"}}\n </script>\n ```\n\n Take note that `\"welcome\"` is a string and not an object\n reference.\n\n See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to \n set up localized string references.\n\n @method loc\n @for Ember.Handlebars.helpers\n @param {String} str The string to format\n @see {Ember.String#loc}\n */\n function locHelper(str) {\n return loc(str);\n }\n\n __exports__[\"default\"] = locHelper;\n });\ndefine(\"ember-handlebars/helpers/partial\",\n [\"ember-metal/core\",\"ember-metal/is_none\",\"ember-handlebars/ext\",\"ember-handlebars/helpers/binding\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n // var emberAssert = Ember.assert;\n\n var isNone = __dependency2__.isNone;\n var handlebarsGet = __dependency3__.handlebarsGet;\n var bind = __dependency4__.bind;\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n /**\n The `partial` helper renders another template without\n changing the template context:\n\n ```handlebars\n {{foo}}\n {{partial \"nav\"}}\n ```\n\n The above example template will render a template named\n \"_nav\", which has the same context as the parent template\n it's rendered into, so if the \"_nav\" template also referenced\n `{{foo}}`, it would print the same thing as the `{{foo}}`\n in the above example.\n\n If a \"_nav\" template isn't found, the `partial` helper will\n fall back to a template named \"nav\".\n\n ## Bound template names\n\n The parameter supplied to `partial` can also be a path\n to a property containing a template name, e.g.:\n\n ```handlebars\n {{partial someTemplateName}}\n ```\n\n The above example will look up the value of `someTemplateName`\n on the template context (e.g. a controller) and use that\n value as the name of the template to render. If the resolved\n value is falsy, nothing will be rendered. If `someTemplateName`\n changes, the partial will be re-rendered using the new template\n name.\n\n ## Setting the partial's context with `with`\n\n The `partial` helper can be used in conjunction with the `with`\n helper to set a context that will be used by the partial:\n\n ```handlebars\n {{#with currentUser}}\n {{partial \"user_info\"}}\n {{/with}}\n ```\n\n @method partial\n @for Ember.Handlebars.helpers\n @param {String} partialName the name of the template to render minus the leading underscore\n */\n\n function partialHelper(name, options) {\n\n var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this;\n\n options.helperName = options.helperName || 'partial';\n\n if (options.types[0] === \"ID\") {\n // Helper was passed a property path; we need to\n // create a binding that will re-render whenever\n // this property changes.\n options.fn = function(context, fnOptions) {\n var partialName = handlebarsGet(context, name, fnOptions);\n renderPartial(context, partialName, fnOptions);\n };\n\n return bind.call(context, name, options, true, exists);\n } else {\n // Render the partial right into parent template.\n renderPartial(context, name, options);\n }\n }\n\n function exists(value) {\n return !isNone(value);\n }\n\n function renderPartial(context, name, options) {\n var nameParts = name.split(\"/\");\n var lastPart = nameParts[nameParts.length - 1];\n\n nameParts[nameParts.length - 1] = \"_\" + lastPart;\n\n var view = options.data.view;\n var underscoredName = nameParts.join(\"/\");\n var template = view.templateForName(underscoredName);\n var deprecatedTemplate = !template && view.templateForName(name);\n\n Ember.assert(\"Unable to find partial with name '\"+name+\"'.\", template || deprecatedTemplate);\n\n template = template || deprecatedTemplate;\n\n template(context, { data: options.data });\n }\n\n __exports__[\"default\"] = partialHelper;\n });\ndefine(\"ember-handlebars/helpers/shared\",\n [\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var handlebarsGet = __dependency1__.handlebarsGet;\n\n function resolvePaths(options) {\n var ret = [],\n contexts = options.contexts,\n roots = options.roots,\n data = options.data;\n\n for (var i=0, l=contexts.length; i<l; i++) {\n ret.push( handlebarsGet(roots[i], contexts[i], { data: data }) );\n }\n\n return ret;\n }\n\n __exports__[\"default\"] = resolvePaths;\n });\ndefine(\"ember-handlebars/helpers/template\",\n [\"ember-metal/core\",\"ember-handlebars-compiler\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // var emberDeprecate = Ember.deprecate;\n\n var EmberHandlebars = __dependency2__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n /**\n `template` allows you to render a template from inside another template.\n This allows you to re-use the same template in multiple places. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"logged_in_user\">\n {{#with loggedInUser}}\n Last Login: {{lastLogin}}\n User Info: {{template \"user_info\"}}\n {{/with}}\n </script>\n ```\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"user_info\">\n Name: <em>{{name}}</em>\n Karma: <em>{{karma}}</em>\n </script>\n ```\n\n ```handlebars\n {{#if isUser}}\n {{template \"user_info\"}}\n {{else}}\n {{template \"unlogged_user_info\"}}\n {{/if}}\n ```\n\n This helper looks for templates in the global `Ember.TEMPLATES` hash. If you\n add `<script>` tags to your page with the `data-template-name` attribute set,\n they will be compiled and placed in this hash automatically.\n\n You can also manually register templates by adding them to the hash:\n\n ```javascript\n Ember.TEMPLATES[\"my_cool_template\"] = Ember.Handlebars.compile('<b>{{user}}</b>');\n ```\n\n @deprecated\n @method template\n @for Ember.Handlebars.helpers\n @param {String} templateName the template to render\n */\n function templateHelper(name, options) {\n Ember.deprecate(\"The `template` helper has been deprecated in favor of the `partial` helper. Please use `partial` instead, which will work the same way.\");\n\n options.helperName = options.helperName || 'template';\n\n return helpers.partial.apply(this, arguments);\n }\n\n __exports__[\"default\"] = templateHelper;\n });\ndefine(\"ember-handlebars/helpers/unbound\",\n [\"ember-handlebars-compiler\",\"ember-handlebars/helpers/binding\",\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /*globals Handlebars */\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var EmberHandlebars = __dependency1__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n\n var resolveHelper = __dependency2__.resolveHelper;\n var handlebarsGet = __dependency3__.handlebarsGet;\n\n var slice = [].slice;\n\n /**\n `unbound` allows you to output a property without binding. *Important:* The\n output will not be updated if the property changes. Use with caution.\n\n ```handlebars\n <div>{{unbound somePropertyThatDoesntChange}}</div>\n ```\n\n `unbound` can also be used in conjunction with a bound helper to\n render it in its unbound form:\n\n ```handlebars\n <div>{{unbound helperName somePropertyThatDoesntChange}}</div>\n ```\n\n @method unbound\n @for Ember.Handlebars.helpers\n @param {String} property\n @return {String} HTML string\n */\n function unboundHelper(property, fn) {\n var options = arguments[arguments.length - 1],\n container = options.data.view.container,\n helper, context, out, ctx;\n\n ctx = this;\n if (arguments.length > 2) {\n // Unbound helper call.\n options.data.isUnbound = true;\n helper = resolveHelper(container, property) || helpers.helperMissing;\n out = helper.apply(ctx, slice.call(arguments, 1));\n delete options.data.isUnbound;\n return out;\n }\n\n context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : ctx;\n return handlebarsGet(context, property, fn);\n }\n\n __exports__[\"default\"] = unboundHelper;\n });\ndefine(\"ember-handlebars/helpers/view\",\n [\"ember-metal/core\",\"ember-runtime/system/object\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/mixin\",\"ember-views/system/jquery\",\"ember-views/views/view\",\"ember-metal/binding\",\"ember-handlebars/ext\",\"ember-runtime/system/string\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n /*globals Handlebars */\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.warn, Ember.assert\n // var emberWarn = Ember.warn, emberAssert = Ember.assert;\n\n var EmberObject = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var IS_BINDING = __dependency5__.IS_BINDING;\n var jQuery = __dependency6__[\"default\"];\n var View = __dependency7__.View;\n var isGlobalPath = __dependency8__.isGlobalPath;\n var normalizePath = __dependency9__.normalizePath;\n var handlebarsGet = __dependency9__.handlebarsGet;\n var EmberString = __dependency10__[\"default\"];\n\n\n var LOWERCASE_A_Z = /^[a-z]/,\n VIEW_PREFIX = /^view\\./;\n\n function makeBindings(thisContext, options) {\n var hash = options.hash,\n hashType = options.hashTypes;\n\n for (var prop in hash) {\n if (hashType[prop] === 'ID') {\n\n var value = hash[prop];\n\n if (IS_BINDING.test(prop)) {\n Ember.warn(\"You're attempting to render a view by passing \" + prop + \"=\" + value + \" to a view helper, but this syntax is ambiguous. You should either surround \" + value + \" in quotes or remove `Binding` from \" + prop + \".\");\n } else {\n hash[prop + 'Binding'] = value;\n hashType[prop + 'Binding'] = 'STRING';\n delete hash[prop];\n delete hashType[prop];\n }\n }\n }\n\n if (hash.hasOwnProperty('idBinding')) {\n // id can't be bound, so just perform one-time lookup.\n hash.id = handlebarsGet(thisContext, hash.idBinding, options);\n hashType.id = 'STRING';\n delete hash.idBinding;\n delete hashType.idBinding;\n }\n }\n\n var ViewHelper = EmberObject.create({\n\n propertiesFromHTMLOptions: function(options) {\n var hash = options.hash, data = options.data;\n var extensions = {},\n classes = hash['class'],\n dup = false;\n\n if (hash.id) {\n extensions.elementId = hash.id;\n dup = true;\n }\n\n if (hash.tag) {\n extensions.tagName = hash.tag;\n dup = true;\n }\n\n if (classes) {\n classes = classes.split(' ');\n extensions.classNames = classes;\n dup = true;\n }\n\n if (hash.classBinding) {\n extensions.classNameBindings = hash.classBinding.split(' ');\n dup = true;\n }\n\n if (hash.classNameBindings) {\n if (extensions.classNameBindings === undefined) extensions.classNameBindings = [];\n extensions.classNameBindings = extensions.classNameBindings.concat(hash.classNameBindings.split(' '));\n dup = true;\n }\n\n if (hash.attributeBindings) {\n Ember.assert(\"Setting 'attributeBindings' via Handlebars is not allowed. Please subclass Ember.View and set it there instead.\");\n extensions.attributeBindings = null;\n dup = true;\n }\n\n if (dup) {\n hash = jQuery.extend({}, hash);\n delete hash.id;\n delete hash.tag;\n delete hash['class'];\n delete hash.classBinding;\n }\n\n // Set the proper context for all bindings passed to the helper. This applies to regular attribute bindings\n // as well as class name bindings. If the bindings are local, make them relative to the current context\n // instead of the view.\n var path;\n\n // Evaluate the context of regular attribute bindings:\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n\n // Test if the property ends in \"Binding\"\n if (IS_BINDING.test(prop) && typeof hash[prop] === 'string') {\n path = this.contextualizeBindingPath(hash[prop], data);\n if (path) { hash[prop] = path; }\n }\n }\n\n // Evaluate the context of class name bindings:\n if (extensions.classNameBindings) {\n for (var b in extensions.classNameBindings) {\n var full = extensions.classNameBindings[b];\n if (typeof full === 'string') {\n // Contextualize the path of classNameBinding so this:\n //\n // classNameBinding=\"isGreen:green\"\n //\n // is converted to this:\n //\n // classNameBinding=\"_parentView.context.isGreen:green\"\n var parsedPath = View._parsePropertyPath(full);\n path = this.contextualizeBindingPath(parsedPath.path, data);\n if (path) { extensions.classNameBindings[b] = path + parsedPath.classNames; }\n }\n }\n }\n\n return jQuery.extend(hash, extensions);\n },\n\n // Transform bindings from the current context to a context that can be evaluated within the view.\n // Returns null if the path shouldn't be changed.\n //\n // TODO: consider the addition of a prefix that would allow this method to return `path`.\n contextualizeBindingPath: function(path, data) {\n var normalized = normalizePath(null, path, data);\n if (normalized.isKeyword) {\n return 'templateData.keywords.' + path;\n } else if (isGlobalPath(path)) {\n return null;\n } else if (path === 'this' || path === '') {\n return '_parentView.context';\n } else {\n return '_parentView.context.' + path;\n }\n },\n\n helper: function(thisContext, path, options) {\n var data = options.data,\n fn = options.fn,\n newView;\n\n makeBindings(thisContext, options);\n\n if ('string' === typeof path) {\n\n // TODO: this is a lame conditional, this should likely change\n // but something along these lines will likely need to be added\n // as deprecation warnings\n //\n if (options.types[0] === 'STRING' && LOWERCASE_A_Z.test(path) && !VIEW_PREFIX.test(path)) {\n Ember.assert(\"View requires a container\", !!data.view.container);\n newView = data.view.container.lookupFactory('view:' + path);\n } else {\n newView = handlebarsGet(thisContext, path, options);\n }\n\n Ember.assert(\"Unable to find view at path '\" + path + \"'\", !!newView);\n } else {\n newView = path;\n }\n\n Ember.assert(EmberString.fmt('You must pass a view to the #view helper, not %@ (%@)', [path, newView]), View.detect(newView) || View.detectInstance(newView));\n\n var viewOptions = this.propertiesFromHTMLOptions(options, thisContext);\n var currentView = data.view;\n viewOptions.templateData = data;\n var newViewProto = newView.proto ? newView.proto() : newView;\n\n if (fn) {\n Ember.assert(\"You cannot provide a template block if you also specified a templateName\", !get(viewOptions, 'templateName') && !get(newViewProto, 'templateName'));\n viewOptions.template = fn;\n }\n\n // We only want to override the `_context` computed property if there is\n // no specified controller. See View#_context for more information.\n if (!newViewProto.controller && !newViewProto.controllerBinding && !viewOptions.controller && !viewOptions.controllerBinding) {\n viewOptions._context = thisContext;\n }\n\n // for instrumentation\n if (options.helperName) {\n viewOptions.helperName = options.helperName;\n }\n\n currentView.appendChild(newView, viewOptions);\n }\n });\n\n /**\n `{{view}}` inserts a new instance of `Ember.View` into a template passing its\n options to the `Ember.View`'s `create` method and using the supplied block as\n the view's own template.\n\n An empty `<body>` and the following template:\n\n ```handlebars\n A span:\n {{#view tagName=\"span\"}}\n hello.\n {{/view}}\n ```\n\n Will result in HTML structure:\n\n ```html\n <body>\n <!-- Note: the handlebars template script\n also results in a rendered Ember.View\n which is the outer <div> here -->\n\n <div class=\"ember-view\">\n A span:\n <span id=\"ember1\" class=\"ember-view\">\n Hello.\n </span>\n </div>\n </body>\n ```\n\n ### `parentView` setting\n\n The `parentView` property of the new `Ember.View` instance created through\n `{{view}}` will be set to the `Ember.View` instance of the template where\n `{{view}}` was called.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile(\"{{#view}} my parent: {{parentView.elementId}} {{/view}}\")\n });\n\n aView.appendTo('body');\n ```\n\n Will result in HTML structure:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view\">\n my parent: ember1\n </div>\n </div>\n ```\n\n ### Setting CSS id and class attributes\n\n The HTML `id` attribute can be set on the `{{view}}`'s resulting element with\n the `id` option. This option will _not_ be passed to `Ember.View.create`.\n\n ```handlebars\n {{#view tagName=\"span\" id=\"a-custom-id\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"a-custom-id\" class=\"ember-view\">\n hello.\n </span>\n </div>\n ```\n\n The HTML `class` attribute can be set on the `{{view}}`'s resulting element\n with the `class` or `classNameBindings` options. The `class` option will\n directly set the CSS `class` attribute and will not be passed to\n `Ember.View.create`. `classNameBindings` will be passed to `create` and use\n `Ember.View`'s class name binding functionality:\n\n ```handlebars\n {{#view tagName=\"span\" class=\"a-custom-class\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"ember2\" class=\"ember-view a-custom-class\">\n hello.\n </span>\n </div>\n ```\n\n ### Supplying a different view class\n\n `{{view}}` can take an optional first argument before its supplied options to\n specify a path to a custom view class.\n\n ```handlebars\n {{#view \"MyApp.CustomView\"}}\n hello.\n {{/view}}\n ```\n\n The first argument can also be a relative path accessible from the current\n context.\n\n ```javascript\n MyApp = Ember.Application.create({});\n MyApp.OuterView = Ember.View.extend({\n innerViewClass: Ember.View.extend({\n classNames: ['a-custom-view-class-as-property']\n }),\n template: Ember.Handlebars.compile('{{#view \"view.innerViewClass\"}} hi {{/view}}')\n });\n\n MyApp.OuterView.create().appendTo('body');\n ```\n\n Will result in the following HTML:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view a-custom-view-class-as-property\">\n hi\n </div>\n </div>\n ```\n\n ### Blockless use\n\n If you supply a custom `Ember.View` subclass that specifies its own template\n or provide a `templateName` option to `{{view}}` it can be used without\n supplying a block. Attempts to use both a `templateName` option and supply a\n block will throw an error.\n\n ```handlebars\n {{view \"MyApp.ViewWithATemplateDefined\"}}\n ```\n\n ### `viewName` property\n\n You can supply a `viewName` option to `{{view}}`. The `Ember.View` instance\n will be referenced as a property of its parent view by this name.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile('{{#view viewName=\"aChildByName\"}} hi {{/view}}')\n });\n\n aView.appendTo('body');\n aView.get('aChildByName') // the instance of Ember.View created by {{view}} helper\n ```\n\n @method view\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n */\n function viewHelper(path, options) {\n Ember.assert(\"The view helper only takes a single argument\", arguments.length <= 2);\n\n // If no path is provided, treat path param as options.\n // ES6TODO: find a way to do this without global lookup\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = \"Ember.View\";\n }\n\n options.helperName = options.helperName || 'view';\n\n return ViewHelper.helper(this, path, options);\n }\n\n __exports__.ViewHelper = ViewHelper;\n __exports__.viewHelper = viewHelper;\n });\ndefine(\"ember-handlebars/helpers/yield\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Ember = __dependency1__[\"default\"];\n // var emberAssert = Ember.assert;\n\n var get = __dependency2__.get;\n\n /**\n `{{yield}}` denotes an area of a template that will be rendered inside\n of another template. It has two main uses:\n\n ### Use with `layout`\n When used in a Handlebars template that is assigned to an `Ember.View`\n instance's `layout` property Ember will render the layout template first,\n inserting the view's own rendered output at the `{{yield}}` location.\n\n An empty `<body>` and the following application code:\n\n ```javascript\n AView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n layout: Ember.Handlebars.compile('<div class=\"wrapper\">{{yield}}</div>'),\n template: Ember.Handlebars.compile('<span>I am wrapped</span>')\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will result in the following HTML output:\n\n ```html\n <body>\n <div class='ember-view a-view-with-layout'>\n <div class=\"wrapper\">\n <span>I am wrapped</span>\n </div>\n </div>\n </body>\n ```\n\n The `yield` helper cannot be used outside of a template assigned to an\n `Ember.View`'s `layout` property and will throw an error if attempted.\n\n ```javascript\n BView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n template: Ember.Handlebars.compile('{{yield}}')\n });\n\n bView = BView.create();\n bView.appendTo('body');\n\n // throws\n // Uncaught Error: assertion failed:\n // You called yield in a template that was not a layout\n ```\n\n ### Use with Ember.Component\n When designing components `{{yield}}` is used to denote where, inside the component's\n template, an optional block passed to the component should render:\n\n ```handlebars\n <!-- application.hbs -->\n {{#labeled-textfield value=someProperty}}\n First name:\n {{/labeled-textfield}}\n ```\n\n ```handlebars\n <!-- components/labeled-textfield.hbs -->\n <label>\n {{yield}} {{input value=value}}\n </label>\n ```\n\n Result:\n\n ```html\n <label>\n First name: <input type=\"text\" />\n </label>\n ```\n\n @method yield\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n */\n function yieldHelper(options) {\n var view = options.data.view;\n\n while (view && !get(view, 'layout')) {\n if (view._contextView) {\n view = view._contextView;\n } else {\n view = get(view, '_parentView');\n }\n }\n\n Ember.assert(\"You called yield in a template that was not a layout\", !!view);\n\n view._yield(this, options);\n }\n\n __exports__[\"default\"] = yieldHelper;\n });\ndefine(\"ember-handlebars/loader\",\n [\"ember-handlebars/component_lookup\",\"ember-views/system/jquery\",\"ember-metal/error\",\"ember-runtime/system/lazy_load\",\"ember-handlebars-compiler\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n /*globals Handlebars */\n\n var ComponentLookup = __dependency1__[\"default\"];\n var jQuery = __dependency2__[\"default\"];\n var EmberError = __dependency3__[\"default\"];\n var onLoad = __dependency4__.onLoad;\n\n var EmberHandlebars = __dependency5__[\"default\"];\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n /**\n Find templates stored in the head tag as script tags and make them available\n to `Ember.CoreView` in the global `Ember.TEMPLATES` object. This will be run\n as as jQuery DOM-ready callback.\n\n Script tags with `text/x-handlebars` will be compiled\n with Ember's Handlebars and are suitable for use as a view's template.\n Those with type `text/x-raw-handlebars` will be compiled with regular\n Handlebars and are suitable for use in views' computed properties.\n\n @private\n @method bootstrap\n @for Ember.Handlebars\n @static\n @param ctx\n */\n function bootstrap(ctx) {\n var selectors = 'script[type=\"text/x-handlebars\"], script[type=\"text/x-raw-handlebars\"]';\n\n jQuery(selectors, ctx)\n .each(function() {\n // Get a reference to the script tag\n var script = jQuery(this);\n\n var compile = (script.attr('type') === 'text/x-raw-handlebars') ?\n jQuery.proxy(Handlebars.compile, Handlebars) :\n jQuery.proxy(EmberHandlebars.compile, EmberHandlebars),\n // Get the name of the script, used by Ember.View's templateName property.\n // First look for data-template-name attribute, then fall back to its\n // id if no name is found.\n templateName = script.attr('data-template-name') || script.attr('id') || 'application',\n template = compile(script.html());\n\n // Check if template of same name already exists\n if (Ember.TEMPLATES[templateName] !== undefined) {\n throw new EmberError('Template named \"' + templateName + '\" already exists.');\n }\n\n // For templates which have a name, we save them and then remove them from the DOM\n Ember.TEMPLATES[templateName] = template;\n\n // Remove script tag from DOM\n script.remove();\n });\n };\n\n function _bootstrap() {\n bootstrap( jQuery(document) );\n }\n\n function registerComponentLookup(container) {\n container.register('component-lookup:main', ComponentLookup);\n }\n\n /*\n We tie this to application.load to ensure that we've at least\n attempted to bootstrap at the point that the application is loaded.\n\n We also tie this to document ready since we're guaranteed that all\n the inline templates are present at this point.\n\n There's no harm to running this twice, since we remove the templates\n from the DOM after processing.\n */\n\n onLoad('Ember.Application', function(Application) {\n Application.initializer({\n name: 'domTemplates',\n initialize: _bootstrap\n });\n\n Application.initializer({\n name: 'registerComponentLookup',\n after: 'domTemplates',\n initialize: registerComponentLookup\n });\n });\n\n __exports__[\"default\"] = bootstrap;\n });\ndefine(\"ember-handlebars\",\n [\"ember-handlebars-compiler\",\"ember-metal/core\",\"ember-runtime/system/lazy_load\",\"ember-handlebars/loader\",\"ember-handlebars/ext\",\"ember-handlebars/string\",\"ember-handlebars/helpers/shared\",\"ember-handlebars/helpers/binding\",\"ember-handlebars/helpers/collection\",\"ember-handlebars/helpers/view\",\"ember-handlebars/helpers/unbound\",\"ember-handlebars/helpers/debug\",\"ember-handlebars/helpers/each\",\"ember-handlebars/helpers/template\",\"ember-handlebars/helpers/partial\",\"ember-handlebars/helpers/yield\",\"ember-handlebars/helpers/loc\",\"ember-handlebars/controls/checkbox\",\"ember-handlebars/controls/select\",\"ember-handlebars/controls/text_area\",\"ember-handlebars/controls/text_field\",\"ember-handlebars/controls/text_support\",\"ember-handlebars/controls\",\"ember-handlebars/component_lookup\",\"ember-handlebars/views/handlebars_bound_view\",\"ember-handlebars/views/metamorph_view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __exports__) {\n \"use strict\";\n var EmberHandlebars = __dependency1__[\"default\"];\n var Ember = __dependency2__[\"default\"];\n // to add to globals\n\n var runLoadHooks = __dependency3__.runLoadHooks;\n var bootstrap = __dependency4__[\"default\"];\n\n var normalizePath = __dependency5__.normalizePath;\n var template = __dependency5__.template;\n var makeBoundHelper = __dependency5__.makeBoundHelper;\n var registerBoundHelper = __dependency5__.registerBoundHelper;\n var resolveHash = __dependency5__.resolveHash;\n var resolveParams = __dependency5__.resolveParams;\n var getEscaped = __dependency5__.getEscaped;\n var handlebarsGet = __dependency5__.handlebarsGet;\n var evaluateUnboundHelper = __dependency5__.evaluateUnboundHelper;\n var helperMissingHelper = __dependency5__.helperMissingHelper;\n var blockHelperMissingHelper = __dependency5__.blockHelperMissingHelper;\n\n\n // side effect of extending StringUtils of htmlSafe\n\n var resolvePaths = __dependency7__[\"default\"];\n var bind = __dependency8__.bind;\n var _triageMustacheHelper = __dependency8__._triageMustacheHelper;\n var resolveHelper = __dependency8__.resolveHelper;\n var bindHelper = __dependency8__.bindHelper;\n var boundIfHelper = __dependency8__.boundIfHelper;\n var unboundIfHelper = __dependency8__.unboundIfHelper;\n var withHelper = __dependency8__.withHelper;\n var ifHelper = __dependency8__.ifHelper;\n var unlessHelper = __dependency8__.unlessHelper;\n var bindAttrHelper = __dependency8__.bindAttrHelper;\n var bindAttrHelperDeprecated = __dependency8__.bindAttrHelperDeprecated;\n var bindClasses = __dependency8__.bindClasses;\n\n var collectionHelper = __dependency9__[\"default\"];\n var ViewHelper = __dependency10__.ViewHelper;\n var viewHelper = __dependency10__.viewHelper;\n var unboundHelper = __dependency11__[\"default\"];\n var logHelper = __dependency12__.logHelper;\n var debuggerHelper = __dependency12__.debuggerHelper;\n var EachView = __dependency13__.EachView;\n var GroupedEach = __dependency13__.GroupedEach;\n var eachHelper = __dependency13__.eachHelper;\n\n var templateHelper = __dependency14__[\"default\"];\n var partialHelper = __dependency15__[\"default\"];\n var yieldHelper = __dependency16__[\"default\"];\n var locHelper = __dependency17__[\"default\"];\n\n\n var Checkbox = __dependency18__[\"default\"];\n var Select = __dependency19__.Select;\n var SelectOption = __dependency19__.SelectOption;\n var SelectOptgroup = __dependency19__.SelectOptgroup;\n var TextArea = __dependency20__[\"default\"];\n var TextField = __dependency21__[\"default\"];\n var TextSupport = __dependency22__[\"default\"];\n var TextSupport = __dependency22__[\"default\"];\n var inputHelper = __dependency23__.inputHelper;\n var textareaHelper = __dependency23__.textareaHelper;var ComponentLookup = __dependency24__[\"default\"];\n var _HandlebarsBoundView = __dependency25__._HandlebarsBoundView;\n var SimpleHandlebarsView = __dependency25__.SimpleHandlebarsView;\n var _SimpleMetamorphView = __dependency26__._SimpleMetamorphView;\n var _MetamorphView = __dependency26__._MetamorphView;\n var _Metamorph = __dependency26__._Metamorph;\n\n /**\n Ember Handlebars\n\n @module ember\n @submodule ember-handlebars\n @requires ember-views\n */\n\n // Ember.Handlebars.Globals\n EmberHandlebars.bootstrap = bootstrap;\n EmberHandlebars.template = template;\n EmberHandlebars.makeBoundHelper = makeBoundHelper;\n EmberHandlebars.registerBoundHelper = registerBoundHelper;\n EmberHandlebars.resolveHash = resolveHash;\n EmberHandlebars.resolveParams = resolveParams;\n EmberHandlebars.resolveHelper = resolveHelper;\n EmberHandlebars.get = handlebarsGet;\n EmberHandlebars.getEscaped = getEscaped;\n EmberHandlebars.evaluateUnboundHelper = evaluateUnboundHelper;\n EmberHandlebars.bind = bind;\n EmberHandlebars.bindClasses = bindClasses;\n EmberHandlebars.EachView = EachView;\n EmberHandlebars.GroupedEach = GroupedEach;\n EmberHandlebars.resolvePaths = resolvePaths;\n EmberHandlebars.ViewHelper = ViewHelper;\n EmberHandlebars.normalizePath = normalizePath;\n\n\n // Ember Globals\n Ember.Handlebars = EmberHandlebars;\n Ember.ComponentLookup = ComponentLookup;\n Ember._SimpleHandlebarsView = SimpleHandlebarsView;\n Ember._HandlebarsBoundView = _HandlebarsBoundView;\n Ember._SimpleMetamorphView = _SimpleMetamorphView;\n Ember._MetamorphView = _MetamorphView;\n Ember._Metamorph = _Metamorph;\n Ember.TextSupport = TextSupport;\n Ember.Checkbox = Checkbox;\n Ember.Select = Select;\n Ember.SelectOption = SelectOption;\n Ember.SelectOptgroup = SelectOptgroup;\n Ember.TextArea = TextArea;\n Ember.TextField = TextField;\n Ember.TextSupport = TextSupport;\n\n // register helpers\n EmberHandlebars.registerHelper('helperMissing', helperMissingHelper);\n EmberHandlebars.registerHelper('blockHelperMissing', blockHelperMissingHelper);\n EmberHandlebars.registerHelper('bind', bindHelper);\n EmberHandlebars.registerHelper('boundIf', boundIfHelper);\n EmberHandlebars.registerHelper('_triageMustache', _triageMustacheHelper);\n EmberHandlebars.registerHelper('unboundIf', unboundIfHelper);\n EmberHandlebars.registerHelper('with', withHelper);\n EmberHandlebars.registerHelper('if', ifHelper);\n EmberHandlebars.registerHelper('unless', unlessHelper);\n EmberHandlebars.registerHelper('bind-attr', bindAttrHelper);\n EmberHandlebars.registerHelper('bindAttr', bindAttrHelperDeprecated);\n EmberHandlebars.registerHelper('collection', collectionHelper);\n EmberHandlebars.registerHelper(\"log\", logHelper);\n EmberHandlebars.registerHelper(\"debugger\", debuggerHelper);\n EmberHandlebars.registerHelper(\"each\", eachHelper);\n EmberHandlebars.registerHelper(\"loc\", locHelper);\n EmberHandlebars.registerHelper(\"partial\", partialHelper);\n EmberHandlebars.registerHelper(\"template\", templateHelper);\n EmberHandlebars.registerHelper(\"yield\", yieldHelper);\n EmberHandlebars.registerHelper(\"view\", viewHelper);\n EmberHandlebars.registerHelper(\"unbound\", unboundHelper);\n EmberHandlebars.registerHelper(\"input\", inputHelper);\n EmberHandlebars.registerHelper(\"textarea\", textareaHelper);\n\n // run load hooks\n runLoadHooks('Ember.Handlebars', EmberHandlebars);\n\n __exports__[\"default\"] = EmberHandlebars;\n });\ndefine(\"ember-handlebars/string\",\n [\"ember-runtime/system/string\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n // required so we can extend this object.\n var EmberStringUtils = __dependency1__[\"default\"];\n\n /**\n Mark a string as safe for unescaped output with Handlebars. If you\n return HTML from a Handlebars helper, use this function to\n ensure Handlebars does not escape the HTML.\n\n ```javascript\n Ember.String.htmlSafe('<div>someString</div>')\n ```\n\n @method htmlSafe\n @for Ember.String\n @static\n @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars\n */\n function htmlSafe(str) {\n return new Handlebars.SafeString(str);\n };\n\n EmberStringUtils.htmlSafe = htmlSafe;\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n Mark a string as being safe for unescaped output with Handlebars.\n\n ```javascript\n '<div>someString</div>'.htmlSafe()\n ```\n\n See [Ember.String.htmlSafe](/api/classes/Ember.String.html#method_htmlSafe).\n\n @method htmlSafe\n @for String\n @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars\n */\n String.prototype.htmlSafe = function() {\n return htmlSafe(this);\n };\n }\n\n __exports__[\"default\"] = htmlSafe;\n });\ndefine(\"ember-handlebars/views/handlebars_bound_view\",\n [\"ember-handlebars-compiler\",\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/merge\",\"ember-metal/run_loop\",\"ember-metal/computed\",\"ember-views/views/view\",\"ember-views/views/states\",\"ember-handlebars/views/metamorph_view\",\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n /*globals Handlebars */\n /*jshint newcap:false*/\n\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var EmberHandlebars = __dependency1__[\"default\"];\n // EmberHandlebars.SafeString;\n var SafeString = EmberHandlebars.SafeString;\n\n var Ember = __dependency2__[\"default\"];\n // Ember.K\n var K = Ember.K\n\n var Metamorph = requireModule('metamorph');\n\n var EmberError = __dependency3__[\"default\"];\n var get = __dependency4__.get;\n var set = __dependency5__.set;\n var merge = __dependency6__[\"default\"];\n var run = __dependency7__[\"default\"];\n var computed = __dependency8__.computed;\n var View = __dependency9__.View;\n var cloneStates = __dependency10__.cloneStates;\n var states = __dependency10__.states;\n var viewStates = states;\n\n var _MetamorphView = __dependency11__._MetamorphView;\n var handlebarsGet = __dependency12__.handlebarsGet;\n\n function SimpleHandlebarsView(path, pathRoot, isEscaped, templateData) {\n this.path = path;\n this.pathRoot = pathRoot;\n this.isEscaped = isEscaped;\n this.templateData = templateData;\n\n this.morph = Metamorph();\n this.state = 'preRender';\n this.updateId = null;\n this._parentView = null;\n this.buffer = null;\n }\n\n SimpleHandlebarsView.prototype = {\n isVirtual: true,\n isView: true,\n\n destroy: function () {\n if (this.updateId) {\n run.cancel(this.updateId);\n this.updateId = null;\n }\n if (this._parentView) {\n this._parentView.removeChild(this);\n }\n this.morph = null;\n this.state = 'destroyed';\n },\n\n propertyWillChange: K,\n\n propertyDidChange: K,\n\n normalizedValue: function() {\n var path = this.path,\n pathRoot = this.pathRoot,\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = this.templateData;\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return result;\n },\n\n renderToBuffer: function(buffer) {\n var string = '';\n\n string += this.morph.startTag();\n string += this.render();\n string += this.morph.endTag();\n\n buffer.push(string);\n },\n\n render: function() {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = this.isEscaped;\n var result = this.normalizedValue();\n\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n return result;\n },\n\n rerender: function() {\n switch(this.state) {\n case 'preRender':\n case 'destroyed':\n break;\n case 'inBuffer':\n throw new EmberError(\"Something you did tried to replace an {{expression}} before it was inserted into the DOM.\");\n case 'hasElement':\n case 'inDOM':\n this.updateId = run.scheduleOnce('render', this, 'update');\n break;\n }\n\n return this;\n },\n\n update: function () {\n this.updateId = null;\n this.morph.html(this.render());\n },\n\n transitionTo: function(state) {\n this.state = state;\n }\n };\n\n var states = cloneStates(viewStates);\n\n merge(states._default, {\n rerenderIfNeeded: K\n });\n\n merge(states.inDOM, {\n rerenderIfNeeded: function(view) {\n if (view.normalizedValue() !== view._lastNormalizedValue) {\n view.rerender();\n }\n }\n });\n\n /**\n `Ember._HandlebarsBoundView` is a private view created by the Handlebars\n `{{bind}}` helpers that is used to keep track of bound properties.\n\n Every time a property is bound using a `{{mustache}}`, an anonymous subclass\n of `Ember._HandlebarsBoundView` is created with the appropriate sub-template\n and context set up. When the associated property changes, just the template\n for this view will re-render.\n\n @class _HandlebarsBoundView\n @namespace Ember\n @extends Ember._MetamorphView\n @private\n */\n var _HandlebarsBoundView = _MetamorphView.extend({\n states: states,\n instrumentName: 'boundHandlebars',\n\n /**\n The function used to determine if the `displayTemplate` or\n `inverseTemplate` should be rendered. This should be a function that takes\n a value and returns a Boolean.\n\n @property shouldDisplayFunc\n @type Function\n @default null\n */\n shouldDisplayFunc: null,\n\n /**\n Whether the template rendered by this view gets passed the context object\n of its parent template, or gets passed the value of retrieving `path`\n from the `pathRoot`.\n\n For example, this is true when using the `{{#if}}` helper, because the\n template inside the helper should look up properties relative to the same\n object as outside the block. This would be `false` when used with `{{#with\n foo}}` because the template should receive the object found by evaluating\n `foo`.\n\n @property preserveContext\n @type Boolean\n @default false\n */\n preserveContext: false,\n\n /**\n If `preserveContext` is true, this is the object that will be used\n to render the template.\n\n @property previousContext\n @type Object\n */\n previousContext: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `true`.\n\n @property displayTemplate\n @type Function\n @default null\n */\n displayTemplate: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `false`.\n\n @property inverseTemplate\n @type Function\n @default null\n */\n inverseTemplate: null,\n\n\n /**\n The path to look up on `pathRoot` that is passed to\n `shouldDisplayFunc` to determine which template to render.\n\n In addition, if `preserveContext` is `false,` the object at this path will\n be passed to the template when rendering.\n\n @property path\n @type String\n @default null\n */\n path: null,\n\n /**\n The object from which the `path` will be looked up. Sometimes this is the\n same as the `previousContext`, but in cases where this view has been\n generated for paths that start with a keyword such as `view` or\n `controller`, the path root will be that resolved object.\n\n @property pathRoot\n @type Object\n */\n pathRoot: null,\n\n normalizedValue: function() {\n var path = get(this, 'path'),\n pathRoot = get(this, 'pathRoot'),\n valueNormalizer = get(this, 'valueNormalizerFunc'),\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = get(this, 'templateData');\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return valueNormalizer ? valueNormalizer(result) : result;\n },\n\n rerenderIfNeeded: function() {\n this.currentState.rerenderIfNeeded(this);\n },\n\n /**\n Determines which template to invoke, sets up the correct state based on\n that logic, then invokes the default `Ember.View` `render` implementation.\n\n This method will first look up the `path` key on `pathRoot`,\n then pass that value to the `shouldDisplayFunc` function. If that returns\n `true,` the `displayTemplate` function will be rendered to DOM. Otherwise,\n `inverseTemplate`, if specified, will be rendered.\n\n For example, if this `Ember._HandlebarsBoundView` represented the `{{#with\n foo}}` helper, it would look up the `foo` property of its context, and\n `shouldDisplayFunc` would always return true. The object found by looking\n up `foo` would be passed to `displayTemplate`.\n\n @method render\n @param {Ember.RenderBuffer} buffer\n */\n render: function(buffer) {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = get(this, 'isEscaped');\n\n var shouldDisplay = get(this, 'shouldDisplayFunc'),\n preserveContext = get(this, 'preserveContext'),\n context = get(this, 'previousContext');\n\n var inverseTemplate = get(this, 'inverseTemplate'),\n displayTemplate = get(this, 'displayTemplate');\n\n var result = this.normalizedValue();\n this._lastNormalizedValue = result;\n\n // First, test the conditional to see if we should\n // render the template or not.\n if (shouldDisplay(result)) {\n set(this, 'template', displayTemplate);\n\n // If we are preserving the context (for example, if this\n // is an #if block, call the template with the same object.\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n // Otherwise, determine if this is a block bind or not.\n // If so, pass the specified object to the template\n if (displayTemplate) {\n set(this, '_context', result);\n } else {\n // This is not a bind block, just push the result of the\n // expression to the render context and return.\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n buffer.push(result);\n return;\n }\n }\n } else if (inverseTemplate) {\n set(this, 'template', inverseTemplate);\n\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n set(this, '_context', result);\n }\n } else {\n set(this, 'template', function() { return ''; });\n }\n\n return this._super(buffer);\n }\n });\n\n __exports__._HandlebarsBoundView = _HandlebarsBoundView;\n __exports__.SimpleHandlebarsView = SimpleHandlebarsView;\n });\ndefine(\"ember-handlebars/views/metamorph_view\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/view\",\"ember-metal/mixin\",\"ember-metal/run_loop\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n /*jshint newcap:false*/\n var Ember = __dependency1__[\"default\"];\n // Ember.deprecate\n // var emberDeprecate = Ember.deprecate;\n\n var get = __dependency2__.get;\n var set = __dependency3__[\"default\"];\n\n var CoreView = __dependency4__.CoreView;\n var View = __dependency4__.View;\n var Mixin = __dependency5__.Mixin;\n var run = __dependency6__[\"default\"];\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Metamorph = requireModule('metamorph');\n\n function notifyMutationListeners() {\n run.once(View, 'notifyMutationListeners');\n }\n\n // DOMManager should just abstract dom manipulation between jquery and metamorph\n var DOMManager = {\n remove: function(view) {\n view.morph.remove();\n notifyMutationListeners();\n },\n\n prepend: function(view, html) {\n view.morph.prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.morph.after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.morph.html(html);\n notifyMutationListeners();\n },\n\n // This is messed up.\n replace: function(view) {\n var morph = view.morph;\n\n view.transitionTo('preRender');\n\n run.schedule('render', this, function renderMetamorphView() {\n if (view.isDestroying) { return; }\n\n view.clearRenderedChildren();\n var buffer = view.renderToBuffer();\n\n view.invokeRecursively(function(view) {\n view.propertyWillChange('element');\n });\n view.triggerRecursively('willInsertElement');\n\n morph.replaceWith(buffer.string());\n view.transitionTo('inDOM');\n\n view.invokeRecursively(function(view) {\n view.propertyDidChange('element');\n });\n view.triggerRecursively('didInsertElement');\n\n notifyMutationListeners();\n });\n },\n\n empty: function(view) {\n view.morph.html(\"\");\n notifyMutationListeners();\n }\n };\n\n // The `morph` and `outerHTML` properties are internal only\n // and not observable.\n\n /**\n @class _Metamorph\n @namespace Ember\n @private\n */\n var _Metamorph = Mixin.create({\n isVirtual: true,\n tagName: '',\n\n instrumentName: 'metamorph',\n\n init: function() {\n this._super();\n this.morph = Metamorph();\n Ember.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated. You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName);\n },\n\n beforeRender: function(buffer) {\n buffer.push(this.morph.startTag());\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n buffer.push(this.morph.endTag());\n },\n\n createElement: function() {\n var buffer = this.renderToBuffer();\n this.outerHTML = buffer.string();\n this.clearBuffer();\n },\n\n domManager: DOMManager\n });\n\n /**\n @class _MetamorphView\n @namespace Ember\n @extends Ember.View\n @uses Ember._Metamorph\n @private\n */\n var _MetamorphView = View.extend(_Metamorph);\n\n /**\n @class _SimpleMetamorphView\n @namespace Ember\n @extends Ember.CoreView\n @uses Ember._Metamorph\n @private\n */\n var _SimpleMetamorphView = CoreView.extend(_Metamorph);\n\n __exports__._SimpleMetamorphView = _SimpleMetamorphView;\n __exports__._MetamorphView = _MetamorphView;\n __exports__._Metamorph = _Metamorph;\n });\n})();\n//@ sourceURL=ember-handlebars");minispade.register('ember-metal', "(function() {define(\"ember-metal/array\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /*jshint newcap:false*/\n /**\n @module ember-metal\n */\n\n var ArrayPrototype = Array.prototype;\n\n // NOTE: There is a bug in jshint that doesn't recognize `Object()` without `new`\n // as being ok unless both `newcap:false` and not `use strict`.\n // https://github.com/jshint/jshint/issues/392\n\n // Testing this is not ideal, but we want to use native functions\n // if available, but not to use versions created by libraries like Prototype\n var isNativeFunc = function(func) {\n // This should probably work in all browsers likely to have ES5 array methods\n return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1;\n };\n\n // From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/map\n var map = isNativeFunc(ArrayPrototype.map) ? ArrayPrototype.map : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var res = new Array(len);\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n res[i] = fun.call(thisp, t[i], i, t);\n }\n }\n\n return res;\n };\n\n // From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach\n var forEach = isNativeFunc(ArrayPrototype.forEach) ? ArrayPrototype.forEach : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n fun.call(thisp, t[i], i, t);\n }\n }\n };\n\n var indexOf = isNativeFunc(ArrayPrototype.indexOf) ? ArrayPrototype.indexOf : function (obj, fromIndex) {\n if (fromIndex === null || fromIndex === undefined) { fromIndex = 0; }\n else if (fromIndex < 0) { fromIndex = Math.max(0, this.length + fromIndex); }\n for (var i = fromIndex, j = this.length; i < j; i++) {\n if (this[i] === obj) { return i; }\n }\n return -1;\n };\n\n var filter = isNativeFunc(ArrayPrototype.filter) ? ArrayPrototype.filter : function (fn, context) {\n var i,\n value,\n result = [],\n length = this.length;\n\n for (i = 0; i < length; i++) {\n if (this.hasOwnProperty(i)) {\n value = this[i];\n if (fn.call(context, value, i, this)) {\n result.push(value);\n }\n }\n }\n return result;\n };\n\n\n if (Ember.SHIM_ES5) {\n if (!ArrayPrototype.map) {\n ArrayPrototype.map = map;\n }\n\n if (!ArrayPrototype.forEach) {\n ArrayPrototype.forEach = forEach;\n }\n\n if (!ArrayPrototype.filter) {\n ArrayPrototype.filter = filter;\n }\n\n if (!ArrayPrototype.indexOf) {\n ArrayPrototype.indexOf = indexOf;\n }\n }\n\n /**\n Array polyfills to support ES5 features in older browsers.\n\n @namespace Ember\n @property ArrayPolyfills\n */\n __exports__.map = map;\n __exports__.forEach = forEach;\n __exports__.filter = filter;\n __exports__.indexOf = indexOf;\n });\ndefine(\"ember-metal/binding\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/map\",\"ember-metal/observer\",\"ember-metal/run_loop\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.Logger, Ember.LOG_BINDINGS, assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var trySet = __dependency3__.trySet;\n var guidFor = __dependency4__.guidFor;\n var Map = __dependency5__.Map;\n var addObserver = __dependency6__.addObserver;\n var removeObserver = __dependency6__.removeObserver;\n var _suspendObserver = __dependency6__._suspendObserver;\n var run = __dependency7__[\"default\"];\n\n // ES6TODO: where is Ember.lookup defined?\n /**\n @module ember-metal\n */\n\n // ..........................................................\n // CONSTANTS\n //\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 Ember\n @type Boolean\n @default false\n */\n Ember.LOG_BINDINGS = false || !!Ember.ENV.LOG_BINDINGS;\n\n var IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;\n\n /**\n Returns true if the provided path is global (e.g., `MyApp.fooController.bar`)\n instead of local (`foo.bar.baz`).\n\n @method isGlobalPath\n @for Ember\n @private\n @param {String} path\n @return Boolean\n */\n function isGlobalPath(path) {\n return IS_GLOBAL.test(path);\n };\n\n function getWithGlobals(obj, path) {\n return get(isGlobalPath(path) ? Ember.lookup : obj, path);\n }\n\n // ..........................................................\n // BINDING\n //\n\n var Binding = function(toPath, fromPath) {\n this._direction = 'fwd';\n this._from = fromPath;\n this._to = toPath;\n this._directionMap = Map.create();\n };\n\n /**\n @class Binding\n @namespace Ember\n */\n\n Binding.prototype = {\n /**\n This copies the Binding so it can be connected to another object.\n\n @method copy\n @return {Ember.Binding} `this`\n */\n copy: function () {\n var copy = new Binding(this._to, this._from);\n if (this._oneWay) { copy._oneWay = true; }\n return copy;\n },\n\n // ..........................................................\n // CONFIG\n //\n\n /**\n This will set `from` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method from\n @param {String} path the property path to connect to\n @return {Ember.Binding} `this`\n */\n from: function(path) {\n this._from = path;\n return this;\n },\n\n /**\n This will set the `to` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method to\n @param {String|Tuple} path A property path or tuple\n @return {Ember.Binding} `this`\n */\n to: function(path) {\n this._to = path;\n return this;\n },\n\n /**\n Configures the binding as one way. A one-way binding will relay changes\n on the `from` side to the `to` side, but not the other way around. This\n means that if you change the `to` side directly, the `from` side may have\n a different value.\n\n @method oneWay\n @return {Ember.Binding} `this`\n */\n oneWay: function() {\n this._oneWay = true;\n return this;\n },\n\n /**\n @method toString\n @return {String} string representation of binding\n */\n toString: function() {\n var oneWay = this._oneWay ? '[oneWay]' : '';\n return \"Ember.Binding<\" + guidFor(this) + \">(\" + this._from + \" -> \" + this._to + \")\" + oneWay;\n },\n\n // ..........................................................\n // CONNECT AND SYNC\n //\n\n /**\n Attempts to connect this binding instance so that it can receive and relay\n changes. This method will raise an exception if you have not set the\n from/to properties yet.\n\n @method connect\n @param {Object} obj The root object for this binding.\n @return {Ember.Binding} `this`\n */\n connect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);\n\n var fromPath = this._from, toPath = this._to;\n trySet(obj, toPath, getWithGlobals(obj, fromPath));\n\n // add an observer on the object to be notified when the binding should be updated\n addObserver(obj, fromPath, this, this.fromDidChange);\n\n // if the binding is a two-way binding, also set up an observer on the target\n if (!this._oneWay) { addObserver(obj, toPath, this, this.toDidChange); }\n\n this._readyToSync = true;\n\n return this;\n },\n\n /**\n Disconnects the binding instance. Changes will no longer be relayed. You\n will not usually need to call this method.\n\n @method disconnect\n @param {Object} obj The root object you passed when connecting the binding.\n @return {Ember.Binding} `this`\n */\n disconnect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);\n\n var twoWay = !this._oneWay;\n\n // remove an observer on the object so we're no longer notified of\n // changes that should update bindings.\n removeObserver(obj, this._from, this, this.fromDidChange);\n\n // if the binding is two-way, remove the observer from the target as well\n if (twoWay) { removeObserver(obj, this._to, this, this.toDidChange); }\n\n this._readyToSync = false; // disable scheduled syncs...\n return this;\n },\n\n // ..........................................................\n // PRIVATE\n //\n\n /* called when the from side changes */\n fromDidChange: function(target) {\n this._scheduleSync(target, 'fwd');\n },\n\n /* called when the to side changes */\n toDidChange: function(target) {\n this._scheduleSync(target, 'back');\n },\n\n _scheduleSync: function(obj, dir) {\n var directionMap = this._directionMap;\n var existingDir = directionMap.get(obj);\n\n // if we haven't scheduled the binding yet, schedule it\n if (!existingDir) {\n run.schedule('sync', this, this._sync, obj);\n directionMap.set(obj, dir);\n }\n\n // If both a 'back' and 'fwd' sync have been scheduled on the same object,\n // default to a 'fwd' sync so that it remains deterministic.\n if (existingDir === 'back' && dir === 'fwd') {\n directionMap.set(obj, 'fwd');\n }\n },\n\n _sync: function(obj) {\n var log = Ember.LOG_BINDINGS;\n\n // don't synchronize destroyed objects or disconnected bindings\n if (obj.isDestroyed || !this._readyToSync) { return; }\n\n // get the direction of the binding for the object we are\n // synchronizing from\n var directionMap = this._directionMap;\n var direction = directionMap.get(obj);\n\n var fromPath = this._from, toPath = this._to;\n\n directionMap.remove(obj);\n\n // if we're synchronizing from the remote object...\n if (direction === 'fwd') {\n var fromValue = getWithGlobals(obj, this._from);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '->', fromValue, obj);\n }\n if (this._oneWay) {\n trySet(obj, toPath, fromValue);\n } else {\n _suspendObserver(obj, toPath, this, this.toDidChange, function () {\n trySet(obj, toPath, fromValue);\n });\n }\n // if we're synchronizing *to* the remote object\n } else if (direction === 'back') {\n var toValue = get(obj, this._to);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '<-', toValue, obj);\n }\n _suspendObserver(obj, fromPath, this, this.fromDidChange, function () {\n trySet(isGlobalPath(fromPath) ? Ember.lookup : obj, fromPath, toValue);\n });\n }\n }\n\n };\n\n function mixinProperties(to, from) {\n for (var key in from) {\n if (from.hasOwnProperty(key)) {\n to[key] = from[key];\n }\n }\n }\n\n mixinProperties(Binding, {\n\n /*\n See `Ember.Binding.from`.\n\n @method from\n @static\n */\n from: function() {\n var C = this, binding = new C();\n return binding.from.apply(binding, arguments);\n },\n\n /*\n See `Ember.Binding.to`.\n\n @method to\n @static\n */\n to: function() {\n var C = this, binding = new C();\n return binding.to.apply(binding, arguments);\n },\n\n /**\n Creates a new Binding instance and makes it apply in a single direction.\n A one-way binding will relay changes on the `from` side object (supplied\n as the `from` argument) the `to` side, but not the other way around.\n This means that if you change the \"to\" side directly, the \"from\" side may have\n a different value.\n\n See `Binding.oneWay`.\n\n @method oneWay\n @param {String} from from path.\n @param {Boolean} [flag] (Optional) passing nothing here will make the\n binding `oneWay`. You can instead pass `false` to disable `oneWay`, making the\n binding two way again.\n @return {Ember.Binding} `this`\n */\n oneWay: function(from, flag) {\n var C = this, binding = new C(null, from);\n return binding.oneWay(flag);\n }\n\n });\n\n /**\n An `Ember.Binding` connects the properties of two objects so that whenever\n the value of one property changes, the other property will be changed also.\n\n ## Automatic Creation of Bindings with `/^*Binding/`-named Properties\n\n You do not usually create Binding objects directly but instead describe\n bindings in your class or object definition using automatic binding\n detection.\n\n Properties ending in a `Binding` suffix will be converted to `Ember.Binding`\n instances. The value of this property should be a string representing a path\n to another object or a custom binding instanced created using Binding helpers\n (see \"One Way Bindings\"):\n\n ```\n valueBinding: \"MyApp.someController.title\"\n ```\n\n This will create a binding from `MyApp.someController.title` to the `value`\n property of your object instance automatically. Now the two values will be\n kept in sync.\n\n ## One Way Bindings\n\n One especially useful binding customization you can use is the `oneWay()`\n helper. This helper tells Ember that you are only interested in\n receiving changes on the object you are binding from. For example, if you\n are binding to a preference and you want to be notified if the preference\n has changed, but your object will not be changing the preference itself, you\n could do:\n\n ```\n bigTitlesBinding: Ember.Binding.oneWay(\"MyApp.preferencesController.bigTitles\")\n ```\n\n This way if the value of `MyApp.preferencesController.bigTitles` changes the\n `bigTitles` property of your object will change also. However, if you\n change the value of your `bigTitles` property, it will not update the\n `preferencesController`.\n\n One way bindings are almost twice as fast to setup and twice as fast to\n execute because the binding only has to worry about changes to one side.\n\n You should consider using one way bindings anytime you have an object that\n may be created frequently and you do not intend to change a property; only\n to monitor it for changes (such as in the example above).\n\n ## Adding Bindings Manually\n\n All of the examples above show you how to configure a custom binding, but the\n result of these customizations will be a binding template, not a fully active\n Binding instance. The binding will actually become active only when you\n instantiate the object the binding belongs to. It is useful however, to\n understand what actually happens when the binding is activated.\n\n For a binding to function it must have at least a `from` property and a `to`\n property. The `from` property path points to the object/key that you want to\n bind from while the `to` path points to the object/key you want to bind to.\n\n When you define a custom binding, you are usually describing the property\n you want to bind from (such as `MyApp.someController.value` in the examples\n above). When your object is created, it will automatically assign the value\n you want to bind `to` based on the name of your binding key. In the\n examples above, during init, Ember objects will effectively call\n something like this on your binding:\n\n ```javascript\n binding = Ember.Binding.from(this.valueBinding).to(\"value\");\n ```\n\n This creates a new binding instance based on the template you provide, and\n sets the to path to the `value` property of the new object. Now that the\n binding is fully configured with a `from` and a `to`, it simply needs to be\n connected to become active. This is done through the `connect()` method:\n\n ```javascript\n binding.connect(this);\n ```\n\n Note that when you connect a binding you pass the object you want it to be\n connected to. This object will be used as the root for both the from and\n to side of the binding when inspecting relative paths. This allows the\n binding to be automatically inherited by subclassed objects as well.\n\n Now that the binding is connected, it will observe both the from and to side\n and relay changes.\n\n If you ever needed to do so (you almost never will, but it is useful to\n understand this anyway), you could manually create an active binding by\n using the `Ember.bind()` helper method. (This is the same method used by\n to setup your bindings on objects):\n\n ```javascript\n Ember.bind(MyApp.anotherObject, \"value\", \"MyApp.someController.value\");\n ```\n\n Both of these code fragments have the same effect as doing the most friendly\n form of binding creation like so:\n\n ```javascript\n MyApp.anotherObject = Ember.Object.create({\n valueBinding: \"MyApp.someController.value\",\n\n // OTHER CODE FOR THIS OBJECT...\n });\n ```\n\n Ember's built in binding creation method makes it easy to automatically\n create bindings for you. You should always use the highest-level APIs\n available, even if you understand how it works underneath.\n\n @class Binding\n @namespace Ember\n @since Ember 0.9\n */\n // Ember.Binding = Binding; ES6TODO: where to put this?\n\n\n /**\n Global helper method to create a new binding. Just pass the root object\n along with a `to` and `from` path to create and connect the binding.\n\n @method bind\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n */\n function bind(obj, to, from) {\n return new Binding(to, from).connect(obj);\n };\n\n /**\n @method oneWay\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n */\n function oneWay(obj, to, from) {\n return new Binding(to, from).oneWay().connect(obj);\n };\n\n __exports__.Binding = Binding;\n __exports__.bind = bind;\n __exports__.oneWay = oneWay;\n __exports__.isGlobalPath = isGlobalPath;\n });\ndefine(\"ember-metal/chains\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/utils\",\"ember-metal/array\",\"ember-metal/watch_key\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // warn, assert, etc;\n var get = __dependency2__.get;\n var normalizeTuple = __dependency2__.normalizeTuple;\n var meta = __dependency3__.meta;\n var META_KEY = __dependency3__.META_KEY;\n var forEach = __dependency4__.forEach;\n var watchKey = __dependency5__.watchKey;\n var unwatchKey = __dependency5__.unwatchKey;\n\n var metaFor = meta,\n warn = Ember.warn,\n FIRST_KEY = /^([^\\.]+)/;\n\n function firstKey(path) {\n return path.match(FIRST_KEY)[0];\n }\n\n var pendingQueue = [];\n\n // attempts to add the pendingQueue chains again. If some of them end up\n // back in the queue and reschedule is true, schedules a timeout to try\n // again.\n function flushPendingChains() {\n if (pendingQueue.length === 0) { return; } // nothing to do\n\n var queue = pendingQueue;\n pendingQueue = [];\n\n forEach.call(queue, function(q) { q[0].add(q[1]); });\n\n warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);\n };\n\n\n function addChainWatcher(obj, keyName, node) {\n if (!obj || ('object' !== typeof obj)) { return; } // nothing to do\n\n var m = metaFor(obj), nodes = m.chainWatchers;\n\n if (!m.hasOwnProperty('chainWatchers')) {\n nodes = m.chainWatchers = {};\n }\n\n if (!nodes[keyName]) { nodes[keyName] = []; }\n nodes[keyName].push(node);\n watchKey(obj, keyName, m);\n }\n\n function removeChainWatcher(obj, keyName, node) {\n if (!obj || 'object' !== typeof obj) { return; } // nothing to do\n\n var m = obj[META_KEY];\n if (m && !m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m && m.chainWatchers;\n\n if (nodes && nodes[keyName]) {\n nodes = nodes[keyName];\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i] === node) { nodes.splice(i, 1); }\n }\n }\n unwatchKey(obj, keyName, m);\n };\n\n // A ChainNode watches a single key on an object. If you provide a starting\n // value for the key then the node won't actually watch it. For a root node\n // pass null for parent and key and object for value.\n function ChainNode(parent, key, value) {\n this._parent = parent;\n this._key = key;\n\n // _watching is true when calling get(this._parent, this._key) will\n // return the value of this node.\n //\n // It is false for the root of a chain (because we have no parent)\n // and for global paths (because the parent node is the object with\n // the observer on it)\n this._watching = value===undefined;\n\n this._value = value;\n this._paths = {};\n if (this._watching) {\n this._object = parent.value();\n if (this._object) { addChainWatcher(this._object, this._key, this); }\n }\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n //\n // TODO: Replace this with an efficient callback that the EachProxy\n // can implement.\n if (this._parent && this._parent._key === '@each') {\n this.value();\n }\n };\n\n var ChainNodePrototype = ChainNode.prototype;\n\n function lazyGet(obj, key) {\n if (!obj) return undefined;\n\n var meta = obj[META_KEY];\n // check if object meant only to be a prototype\n if (meta && meta.proto === obj) return undefined;\n\n if (key === \"@each\") return get(obj, key);\n\n // if a CP only return cached value\n var desc = meta && meta.descs[key];\n if (desc && desc._cacheable) {\n if (key in meta.cache) {\n return meta.cache[key];\n } else {\n return undefined;\n }\n }\n\n return get(obj, key);\n }\n\n ChainNodePrototype.value = function() {\n if (this._value === undefined && this._watching) {\n var obj = this._parent.value();\n this._value = lazyGet(obj, this._key);\n }\n return this._value;\n };\n\n ChainNodePrototype.destroy = function() {\n if (this._watching) {\n var obj = this._object;\n if (obj) { removeChainWatcher(obj, this._key, this); }\n this._watching = false; // so future calls do nothing\n }\n };\n\n // copies a top level object only\n ChainNodePrototype.copy = function(obj) {\n var ret = new ChainNode(null, null, obj),\n paths = this._paths, path;\n for (path in paths) {\n if (paths[path] <= 0) { continue; } // this check will also catch non-number vals.\n ret.add(path);\n }\n return ret;\n };\n\n // called on the root node of a chain to setup watchers on the specified\n // path.\n ChainNodePrototype.add = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n paths[path] = (paths[path] || 0) + 1;\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n\n // the path was a local path\n if (tuple[0] && tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n\n // global path, but object does not exist yet.\n // put into a queue and try to connect later.\n } else if (!tuple[0]) {\n pendingQueue.push([this, path]);\n tuple.length = 0;\n return;\n\n // global path, and object already exists\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.chain(key, path, src);\n };\n\n // called on the root node of a chain to teardown watcher on the specified\n // path\n ChainNodePrototype.remove = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n if (paths[path] > 0) { paths[path]--; }\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n if (tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.unchain(key, path);\n };\n\n ChainNodePrototype.count = 0;\n\n ChainNodePrototype.chain = function(key, path, src) {\n var chains = this._chains, node;\n if (!chains) { chains = this._chains = {}; }\n\n node = chains[key];\n if (!node) { node = chains[key] = new ChainNode(this, key, src); }\n node.count++; // count chains...\n\n // chain rest of path if there is one\n if (path && path.length>0) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.chain(key, path); // NOTE: no src means it will observe changes...\n }\n };\n\n ChainNodePrototype.unchain = function(key, path) {\n var chains = this._chains, node = chains[key];\n\n // unchain rest of path first...\n if (path && path.length>1) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.unchain(key, path);\n }\n\n // delete node if needed.\n node.count--;\n if (node.count<=0) {\n delete chains[node._key];\n node.destroy();\n }\n\n };\n\n ChainNodePrototype.willChange = function(events) {\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].willChange(events);\n }\n }\n\n if (this._parent) { this._parent.chainWillChange(this, this._key, 1, events); }\n };\n\n ChainNodePrototype.chainWillChange = function(chain, path, depth, events) {\n if (this._key) { path = this._key + '.' + path; }\n\n if (this._parent) {\n this._parent.chainWillChange(this, path, depth+1, events);\n } else {\n if (depth > 1) {\n events.push(this.value(), path);\n }\n path = 'this.' + path;\n if (this._paths[path] > 0) {\n events.push(this.value(), path);\n }\n }\n };\n\n ChainNodePrototype.chainDidChange = function(chain, path, depth, events) {\n if (this._key) { path = this._key + '.' + path; }\n if (this._parent) {\n this._parent.chainDidChange(this, path, depth+1, events);\n } else {\n if (depth > 1) {\n events.push(this.value(), path);\n }\n path = 'this.' + path;\n if (this._paths[path] > 0) {\n events.push(this.value(), path);\n }\n }\n };\n\n ChainNodePrototype.didChange = function(events) {\n // invalidate my own value first.\n if (this._watching) {\n var obj = this._parent.value();\n if (obj !== this._object) {\n removeChainWatcher(this._object, this._key, this);\n this._object = obj;\n addChainWatcher(obj, this._key, this);\n }\n this._value = undefined;\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n if (this._parent && this._parent._key === '@each')\n this.value();\n }\n\n // then notify chains...\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].didChange(events);\n }\n }\n\n // if no events are passed in then we only care about the above wiring update\n if (events === null) { return; }\n\n // and finally tell parent about my path changing...\n if (this._parent) { this._parent.chainDidChange(this, this._key, 1, events); }\n };\n\n function finishChains(obj) {\n // We only create meta if we really have to\n var m = obj[META_KEY], chains = m && m.chains;\n if (chains) {\n if (chains.value() !== obj) {\n metaFor(obj).chains = chains = chains.copy(obj);\n } else {\n chains.didChange(null);\n }\n }\n };\n\n __exports__.flushPendingChains = flushPendingChains;\n __exports__.removeChainWatcher = removeChainWatcher;\n __exports__.ChainNode = ChainNode;\n __exports__.finishChains = finishChains;\n });\ndefine(\"ember-metal/computed\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/enumerable_utils\",\"ember-metal/platform\",\"ember-metal/watching\",\"ember-metal/expand_properties\",\"ember-metal/error\",\"ember-metal/properties\",\"ember-metal/property_events\",\"ember-metal/is_empty\",\"ember-metal/is_none\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var meta = __dependency4__.meta;\n var META_KEY = __dependency4__.META_KEY;\n var guidFor = __dependency4__.guidFor;\n var typeOf = __dependency4__.typeOf;\n var inspect = __dependency4__.inspect;\n var EnumerableUtils = __dependency5__[\"default\"];\n var create = __dependency6__.create;\n var watch = __dependency7__.watch;\n var unwatch = __dependency7__.unwatch;\n var expandProperties = __dependency8__[\"default\"];\n var EmberError = __dependency9__[\"default\"];\n var Descriptor = __dependency10__.Descriptor;\n var defineProperty = __dependency10__.defineProperty;\n var propertyWillChange = __dependency11__.propertyWillChange;\n var propertyDidChange = __dependency11__.propertyDidChange;\n var isEmpty = __dependency12__[\"default\"];\n var isNone = __dependency13__.isNone;\n\n /**\n @module ember-metal\n */\n\n Ember.warn(\"The CP_DEFAULT_CACHEABLE flag has been removed and computed properties are always cached by default. Use `volatile` if you don't want caching.\", Ember.ENV.CP_DEFAULT_CACHEABLE !== false);\n\n\n var metaFor = meta,\n a_slice = [].slice,\n o_create = create;\n\n function UNDEFINED() { }\n\n var lengthPattern = /\\.(length|\\[\\])$/;\n\n // ..........................................................\n // DEPENDENT KEYS\n //\n\n // data structure:\n // meta.deps = {\n // 'depKey': {\n // 'keyName': count,\n // }\n // }\n\n /*\n This function returns a map of unique dependencies for a\n given object and key.\n */\n function keysForDep(depsMeta, depKey) {\n var keys = depsMeta[depKey];\n if (!keys) {\n // if there are no dependencies yet for a the given key\n // create a new empty list of dependencies for the key\n keys = depsMeta[depKey] = {};\n } else if (!depsMeta.hasOwnProperty(depKey)) {\n // otherwise if the dependency list is inherited from\n // a superclass, clone the hash\n keys = depsMeta[depKey] = o_create(keys);\n }\n return keys;\n }\n\n function metaForDeps(meta) {\n return keysForDep(meta, 'deps');\n }\n\n function addDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) + 1;\n // Watch the depKey\n watch(obj, depKey, meta);\n }\n }\n\n function removeDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) - 1;\n // Watch the depKey\n unwatch(obj, depKey, meta);\n }\n }\n\n // ..........................................................\n // COMPUTED PROPERTY\n //\n\n /**\n A computed property transforms an objects function into a property.\n\n By default the function backing the computed property will only be called\n once and the result will be cached. You can specify various properties\n that your computed property is dependent on. This will force the cached\n result to be recomputed if the dependencies are modified.\n\n In the following example we declare a computed property (by calling\n `.property()` on the fullName function) and setup the properties\n dependencies (depending on firstName and lastName). The fullName function\n will be called once (regardless of how many times it is accessed) as long\n as it's dependencies have not been changed. Once firstName or lastName are updated\n any future calls (or anything bound) to fullName will incorporate the new\n values.\n\n ```javascript\n var Person = Ember.Object.extend({\n // these will be supplied by `create`\n firstName: null,\n lastName: null,\n\n fullName: function() {\n var firstName = this.get('firstName');\n var lastName = this.get('lastName');\n\n return firstName + ' ' + lastName;\n }.property('firstName', 'lastName')\n });\n\n var tom = Person.create({\n firstName: 'Tom',\n lastName: 'Dale'\n });\n\n tom.get('fullName') // 'Tom Dale'\n ```\n\n You can also define what Ember should do when setting a computed property.\n If you try to set a computed property, it will be invoked with the key and\n value you want to set it to. You can also accept the previous value as the\n third parameter.\n\n ```javascript\n var Person = Ember.Object.extend({\n // these will be supplied by `create`\n firstName: null,\n lastName: null,\n\n fullName: function(key, value, oldValue) {\n // getter\n if (arguments.length === 1) {\n var firstName = this.get('firstName');\n var lastName = this.get('lastName');\n\n return firstName + ' ' + lastName;\n\n // setter\n } else {\n var name = value.split(' ');\n\n this.set('firstName', name[0]);\n this.set('lastName', name[1]);\n\n return value;\n }\n }.property('firstName', 'lastName')\n });\n\n var person = Person.create();\n\n person.set('fullName', 'Peter Wagenet');\n person.get('firstName'); // 'Peter'\n person.get('lastName'); // 'Wagenet'\n ```\n\n @class ComputedProperty\n @namespace Ember\n @extends Ember.Descriptor\n @constructor\n */\n function ComputedProperty(func, opts) {\n func.__ember_arity__ = func.length;\n this.func = func;\n\n this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;\n this._dependentKeys = opts && opts.dependentKeys;\n this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly) || false;\n }\n\n ComputedProperty.prototype = new Descriptor();\n\n var ComputedPropertyPrototype = ComputedProperty.prototype;\n ComputedPropertyPrototype._dependentKeys = undefined;\n ComputedPropertyPrototype._suspended = undefined;\n ComputedPropertyPrototype._meta = undefined;\n\n /**\n Properties are cacheable by default. Computed property will automatically\n cache the return value of your function until one of the dependent keys changes.\n\n Call `volatile()` to set it into non-cached mode. When in this mode\n the computed property will not automatically cache the return value.\n\n However, if a property is properly observable, there is no reason to disable\n caching.\n\n @method cacheable\n @param {Boolean} aFlag optional set to `false` to disable caching\n @return {Ember.ComputedProperty} this\n @chainable\n */\n ComputedPropertyPrototype.cacheable = function(aFlag) {\n this._cacheable = aFlag !== false;\n return this;\n };\n\n /**\n Call on a computed property to set it into non-cached mode. When in this\n mode the computed property will not automatically cache the return value.\n\n ```javascript\n var outsideService = Ember.Object.extend({\n value: function() {\n return OutsideService.getValue();\n }.property().volatile()\n }).create();\n ```\n\n @method volatile\n @return {Ember.ComputedProperty} this\n @chainable\n */\n ComputedPropertyPrototype.volatile = function() {\n return this.cacheable(false);\n };\n\n /**\n Call on a computed property to set it into read-only mode. When in this\n mode the computed property will throw an error when set.\n\n ```javascript\n var Person = Ember.Object.extend({\n guid: function() {\n return 'guid-guid-guid';\n }.property().readOnly()\n });\n\n var person = Person.create();\n\n person.set('guid', 'new-guid'); // will throw an exception\n ```\n\n @method readOnly\n @return {Ember.ComputedProperty} this\n @chainable\n */\n ComputedPropertyPrototype.readOnly = function(readOnly) {\n this._readOnly = readOnly === undefined || !!readOnly;\n return this;\n };\n\n /**\n Sets the dependent keys on this computed property. Pass any number of\n arguments containing key paths that this computed property depends on.\n\n ```javascript\n var President = Ember.Object.extend({\n fullName: computed(function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember that this computed property depends on firstName\n // and lastName\n }).property('firstName', 'lastName')\n });\n\n var president = President.create({\n firstName: 'Barack',\n lastName: 'Obama',\n });\n\n president.get('fullName'); // 'Barack Obama'\n ```\n\n @method property\n @param {String} path* zero or more property paths\n @return {Ember.ComputedProperty} this\n @chainable\n */\n ComputedPropertyPrototype.property = function() {\n var args;\n\n var addArg = function (property) {\n args.push(property);\n };\n\n args = [];\n for (var i = 0, l = arguments.length; i < l; i++) {\n expandProperties(arguments[i], addArg);\n }\n\n this._dependentKeys = args;\n return this;\n };\n\n /**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For example,\n computed property functions may close over variables that are then no longer\n available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n The hash that you pass to the `meta()` function will be saved on the\n computed property descriptor under the `_meta` key. Ember runtime\n exposes a public API for retrieving these values from classes,\n via the `metaForProperty()` function.\n\n @method meta\n @param {Hash} meta\n @chainable\n */\n\n ComputedPropertyPrototype.meta = function(meta) {\n if (arguments.length === 0) {\n return this._meta || {};\n } else {\n this._meta = meta;\n return this;\n }\n };\n\n /* impl descriptor API */\n ComputedPropertyPrototype.didChange = function(obj, keyName) {\n // _suspended is set via a CP.set to ensure we don't clear\n // the cached value set by the setter\n if (this._cacheable && this._suspended !== obj) {\n var meta = metaFor(obj);\n if (meta.cache[keyName] !== undefined) {\n meta.cache[keyName] = undefined;\n removeDependentKeys(this, obj, keyName, meta);\n }\n }\n };\n\n function finishChains(chainNodes)\n {\n for (var i=0, l=chainNodes.length; i<l; i++) {\n chainNodes[i].didChange(null);\n }\n }\n\n /**\n Access the value of the function backing the computed property.\n If this property has already been cached, return the cached result.\n Otherwise, call the function passing the property name as an argument.\n\n ```javascript\n var Person = Ember.Object.extend({\n fullName: function(keyName) {\n // the keyName parameter is 'fullName' in this case.\n return this.get('firstName') + ' ' + this.get('lastName');\n }.property('firstName', 'lastName')\n });\n\n\n var tom = Person.create({\n firstName: 'Tom',\n lastName: 'Dale'\n });\n\n tom.get('fullName') // 'Tom Dale'\n ```\n\n @method get\n @param {String} keyName The key being accessed.\n @return {Object} The return value of the function backing the CP.\n */\n ComputedPropertyPrototype.get = function(obj, keyName) {\n var ret, cache, meta, chainNodes;\n if (this._cacheable) {\n meta = metaFor(obj);\n cache = meta.cache;\n\n var result = cache[keyName];\n\n if (result === UNDEFINED) {\n return undefined;\n } else if (result !== undefined) {\n return result;\n }\n\n ret = this.func.call(obj, keyName);\n if (ret === undefined) {\n cache[keyName] = UNDEFINED;\n } else {\n cache[keyName] = ret;\n }\n\n chainNodes = meta.chainWatchers && meta.chainWatchers[keyName];\n if (chainNodes) { finishChains(chainNodes); }\n addDependentKeys(this, obj, keyName, meta);\n } else {\n ret = this.func.call(obj, keyName);\n }\n return ret;\n };\n\n /**\n Set the value of a computed property. If the function that backs your\n computed property does not accept arguments then the default action for\n setting would be to define the property on the current object, and set\n the value of the property to the value being set.\n\n Generally speaking if you intend for your computed property to be set\n your backing function should accept either two or three arguments.\n\n @method set\n @param {String} keyName The key being accessed.\n @param {Object} newValue The new value being assigned.\n @param {String} oldValue The old value being replaced.\n @return {Object} The return value of the function backing the CP.\n */\n ComputedPropertyPrototype.set = function(obj, keyName, value) {\n var cacheable = this._cacheable,\n func = this.func,\n meta = metaFor(obj, cacheable),\n oldSuspended = this._suspended,\n hadCachedValue = false,\n cache = meta.cache,\n funcArgLength, cachedValue, ret;\n\n if (this._readOnly) {\n throw new EmberError('Cannot set read-only property \"' + keyName + '\" on object: ' + inspect(obj));\n }\n\n this._suspended = obj;\n\n try {\n\n if (cacheable && cache[keyName] !== undefined) {\n cachedValue = cache[keyName];\n hadCachedValue = true;\n }\n\n // Check if the CP has been wrapped. If it has, use the\n // length from the wrapped function.\n\n funcArgLength = func.wrappedFunction ? func.wrappedFunction.__ember_arity__ : func.__ember_arity__;\n\n // For backwards-compatibility with computed properties\n // that check for arguments.length === 2 to determine if\n // they are being get or set, only pass the old cached\n // value if the computed property opts into a third\n // argument.\n if (funcArgLength === 3) {\n ret = func.call(obj, keyName, value, cachedValue);\n } else if (funcArgLength === 2) {\n ret = func.call(obj, keyName, value);\n } else {\n defineProperty(obj, keyName, null, cachedValue);\n set(obj, keyName, value);\n return;\n }\n\n if (hadCachedValue && cachedValue === ret) { return; }\n\n var watched = meta.watching[keyName];\n if (watched) { propertyWillChange(obj, keyName); }\n\n if (hadCachedValue) {\n cache[keyName] = undefined;\n }\n\n if (cacheable) {\n if (!hadCachedValue) {\n addDependentKeys(this, obj, keyName, meta);\n }\n if (ret === undefined) {\n cache[keyName] = UNDEFINED;\n } else {\n cache[keyName] = ret;\n }\n }\n\n if (watched) { propertyDidChange(obj, keyName); }\n } finally {\n this._suspended = oldSuspended;\n }\n return ret;\n };\n\n /* called before property is overridden */\n ComputedPropertyPrototype.teardown = function(obj, keyName) {\n var meta = metaFor(obj);\n\n if (keyName in meta.cache) {\n removeDependentKeys(this, obj, keyName, meta);\n }\n\n if (this._cacheable) { delete meta.cache[keyName]; }\n\n return null; // no value to restore\n };\n\n\n /**\n This helper returns a new property descriptor that wraps the passed\n computed property function. You can use this helper to define properties\n with mixins or via `Ember.defineProperty()`.\n\n The function you pass will be used to both get and set property values.\n The function should accept two parameters, key and value. If value is not\n undefined you should set the value first. In either case return the\n current value of the property.\n\n @method computed\n @for Ember\n @param {Function} func The computed property function.\n @return {Ember.ComputedProperty} property descriptor instance\n */\n function computed(func) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n func = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof func !== \"function\") {\n throw new EmberError(\"Computed Property declared without a property function\");\n }\n\n var cp = new ComputedProperty(func);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n };\n\n /**\n Returns the cached value for a property, if one exists.\n This can be useful for peeking at the value of a computed\n property that is generated lazily, without accidentally causing\n it to be created.\n\n @method cacheFor\n @for Ember\n @param {Object} obj the object whose property you want to check\n @param {String} key the name of the property whose cached value you want\n to return\n @return {Object} the cached value\n */\n function cacheFor(obj, key) {\n var meta = obj[META_KEY],\n cache = meta && meta.cache,\n ret = cache && cache[key];\n\n if (ret === UNDEFINED) { return undefined; }\n return ret;\n };\n\n cacheFor.set = function(cache, key, value) {\n if (value === undefined) {\n cache[key] = UNDEFINED;\n } else {\n cache[key] = value;\n }\n };\n\n cacheFor.get = function(cache, key) {\n var ret = cache[key];\n if (ret === UNDEFINED) { return undefined; }\n return ret;\n };\n\n cacheFor.remove = function(cache, key) {\n cache[key] = undefined;\n };\n\n function getProperties(self, propertyNames) {\n var ret = {};\n for(var i = 0; i < propertyNames.length; i++) {\n ret[propertyNames[i]] = get(self, propertyNames[i]);\n }\n return ret;\n }\n\n function registerComputed(name, macro) {\n computed[name] = function(dependentKey) {\n var args = a_slice.call(arguments);\n return computed(dependentKey, function() {\n return macro.apply(this, args);\n });\n };\n };\n\n function registerComputedWithProperties(name, macro) {\n computed[name] = function() {\n var properties = a_slice.call(arguments);\n\n var computedFunc = computed(function() {\n return macro.apply(this, [getProperties(this, properties)]);\n });\n\n return computedFunc.property.apply(computedFunc, properties);\n };\n };\n\n /**\n A computed property that returns true if the value of the dependent\n property is null, an empty string, empty array, or empty function.\n\n Example\n\n ```javascript\n var ToDoList = Ember.Object.extend({\n done: Ember.computed.empty('todos')\n });\n\n var todoList = ToDoList.create({\n todos: ['Unit Test', 'Documentation', 'Release']\n });\n\n todoList.get('done'); // false\n todoList.get('todos').clear();\n todoList.get('done'); // true\n ```\n\n @since 1.6.0\n @method computed.empty\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which negate\n the original value for property\n */\n computed.empty = function (dependentKey) {\n return computed(dependentKey + '.length', function () {\n return isEmpty(get(this, dependentKey));\n });\n };\n\n /**\n A computed property that returns true if the value of the dependent\n property is NOT null, an empty string, empty array, or empty function.\n\n Note: When using `computed.notEmpty` to watch an array make sure to\n use the `array.[]` syntax so the computed can subscribe to transitions\n from empty to non-empty states.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasStuff: Ember.computed.notEmpty('backpack.[]')\n });\n\n var hamster = Hamster.create({ backpack: ['Food', 'Sleeping Bag', 'Tent'] });\n\n hamster.get('hasStuff'); // true\n hamster.get('backpack').clear(); // []\n hamster.get('hasStuff'); // false\n ```\n\n @method computed.notEmpty\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which returns true if\n original value for property is not empty.\n */\n registerComputed('notEmpty', function(dependentKey) {\n return !isEmpty(get(this, dependentKey));\n });\n\n /**\n A computed property that returns true if the value of the dependent\n property is null or undefined. This avoids errors from JSLint complaining\n about use of ==, which can be technically confusing.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n isHungry: Ember.computed.none('food')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('isHungry'); // true\n hamster.set('food', 'Banana');\n hamster.get('isHungry'); // false\n hamster.set('food', null);\n hamster.get('isHungry'); // true\n ```\n\n @method computed.none\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which\n returns true if original value for property is null or undefined.\n */\n registerComputed('none', function(dependentKey) {\n return isNone(get(this, dependentKey));\n });\n\n /**\n A computed property that returns the inverse boolean value\n of the original value for the dependent property.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n isAnonymous: Ember.computed.not('loggedIn')\n });\n\n var user = User.create({loggedIn: false});\n\n user.get('isAnonymous'); // true\n user.set('loggedIn', true);\n user.get('isAnonymous'); // false\n ```\n\n @method computed.not\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which returns\n inverse of the original value for property\n */\n registerComputed('not', function(dependentKey) {\n return !get(this, dependentKey);\n });\n\n /**\n A computed property that converts the provided dependent property\n into a boolean value.\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasBananas: Ember.computed.bool('numBananas')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('hasBananas'); // false\n hamster.set('numBananas', 0);\n hamster.get('hasBananas'); // false\n hamster.set('numBananas', 1);\n hamster.get('hasBananas'); // true\n hamster.set('numBananas', null);\n hamster.get('hasBananas'); // false\n ```\n\n @method computed.bool\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which converts\n to boolean the original value for property\n */\n registerComputed('bool', function(dependentKey) {\n return !!get(this, dependentKey);\n });\n\n /**\n A computed property which matches the original value for the\n dependent property against a given RegExp, returning `true`\n if they values matches the RegExp and `false` if it does not.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n hasValidEmail: Ember.computed.match('email', /^.+@.+\\..+$/)\n });\n\n var user = User.create({loggedIn: false});\n\n user.get('hasValidEmail'); // false\n user.set('email', '');\n user.get('hasValidEmail'); // false\n user.set('email', 'ember_hamster@example.com');\n user.get('hasValidEmail'); // true\n ```\n\n @method computed.match\n @for Ember\n @param {String} dependentKey\n @param {RegExp} regexp\n @return {Ember.ComputedProperty} computed property which match\n the original value for property against a given RegExp\n */\n registerComputed('match', function(dependentKey, regexp) {\n var value = get(this, dependentKey);\n return typeof value === 'string' ? regexp.test(value) : false;\n });\n\n /**\n A computed property that returns true if the provided dependent property\n is equal to the given value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n napTime: Ember.computed.equal('state', 'sleepy')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('napTime'); // false\n hamster.set('state', 'sleepy');\n hamster.get('napTime'); // true\n hamster.set('state', 'hungry');\n hamster.get('napTime'); // false\n ```\n\n @method computed.equal\n @for Ember\n @param {String} dependentKey\n @param {String|Number|Object} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is equal to the given value.\n */\n registerComputed('equal', function(dependentKey, value) {\n return get(this, dependentKey) === value;\n });\n\n /**\n A computed property that returns true if the provied dependent property\n is greater than the provided value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasTooManyBananas: Ember.computed.gt('numBananas', 10)\n });\n\n var hamster = Hamster.create();\n\n hamster.get('hasTooManyBananas'); // false\n hamster.set('numBananas', 3);\n hamster.get('hasTooManyBananas'); // false\n hamster.set('numBananas', 11);\n hamster.get('hasTooManyBananas'); // true\n ```\n\n @method computed.gt\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is greater then given value.\n */\n registerComputed('gt', function(dependentKey, value) {\n return get(this, dependentKey) > value;\n });\n\n /**\n A computed property that returns true if the provided dependent property\n is greater than or equal to the provided value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasTooManyBananas: Ember.computed.gte('numBananas', 10)\n });\n\n var hamster = Hamster.create();\n\n hamster.get('hasTooManyBananas'); // false\n hamster.set('numBananas', 3);\n hamster.get('hasTooManyBananas'); // false\n hamster.set('numBananas', 10);\n hamster.get('hasTooManyBananas'); // true\n ```\n\n @method computed.gte\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is greater or equal then given value.\n */\n registerComputed('gte', function(dependentKey, value) {\n return get(this, dependentKey) >= value;\n });\n\n /**\n A computed property that returns true if the provided dependent property\n is less than the provided value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n needsMoreBananas: Ember.computed.lt('numBananas', 3)\n });\n\n var hamster = Hamster.create();\n\n hamster.get('needsMoreBananas'); // true\n hamster.set('numBananas', 3);\n hamster.get('needsMoreBananas'); // false\n hamster.set('numBananas', 2);\n hamster.get('needsMoreBananas'); // true\n ```\n\n @method computed.lt\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is less then given value.\n */\n registerComputed('lt', function(dependentKey, value) {\n return get(this, dependentKey) < value;\n });\n\n /**\n A computed property that returns true if the provided dependent property\n is less than or equal to the provided value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n needsMoreBananas: Ember.computed.lte('numBananas', 3)\n });\n\n var hamster = Hamster.create();\n\n hamster.get('needsMoreBananas'); // true\n hamster.set('numBananas', 5);\n hamster.get('needsMoreBananas'); // false\n hamster.set('numBananas', 3);\n hamster.get('needsMoreBananas'); // true\n ```\n\n @method computed.lte\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is less or equal then given value.\n */\n registerComputed('lte', function(dependentKey, value) {\n return get(this, dependentKey) <= value;\n });\n\n /**\n A computed property that performs a logical `and` on the\n original values for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n readyForCamp: Ember.computed.and('hasTent', 'hasBackpack')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('readyForCamp'); // false\n hamster.set('hasTent', true);\n hamster.get('readyForCamp'); // false\n hamster.set('hasBackpack', true);\n hamster.get('readyForCamp'); // true\n ```\n\n @method computed.and\n @for Ember\n @param {String} dependentKey*\n @return {Ember.ComputedProperty} computed property which performs\n a logical `and` on the values of all the original values for properties.\n */\n registerComputedWithProperties('and', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && !properties[key]) {\n return false;\n }\n }\n return true;\n });\n\n /**\n A computed property which performs a logical `or` on the\n original values for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('readyForRain'); // false\n hamster.set('hasJacket', true);\n hamster.get('readyForRain'); // true\n ```\n\n @method computed.or\n @for Ember\n @param {String} dependentKey*\n @return {Ember.ComputedProperty} computed property which performs\n a logical `or` on the values of all the original values for properties.\n */\n registerComputedWithProperties('or', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n return true;\n }\n }\n return false;\n });\n\n /**\n A computed property that returns the first truthy value\n from a list of dependent properties.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasClothes: Ember.computed.any('hat', 'shirt')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('hasClothes'); // null\n hamster.set('shirt', 'Hawaiian Shirt');\n hamster.get('hasClothes'); // 'Hawaiian Shirt'\n ```\n\n @method computed.any\n @for Ember\n @param {String} dependentKey*\n @return {Ember.ComputedProperty} computed property which returns\n the first truthy value of given list of properties.\n */\n registerComputedWithProperties('any', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n return properties[key];\n }\n }\n return null;\n });\n\n /**\n A computed property that returns the array of values\n for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n clothes: Ember.computed.collect('hat', 'shirt')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('clothes'); // [null, null]\n hamster.set('hat', 'Camp Hat');\n hamster.set('shirt', 'Camp Shirt');\n hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt']\n ```\n\n @method computed.collect\n @for Ember\n @param {String} dependentKey*\n @return {Ember.ComputedProperty} computed property which maps\n values of all passed properties in to an array.\n */\n registerComputedWithProperties('collect', function(properties) {\n var res = [];\n for (var key in properties) {\n if (properties.hasOwnProperty(key)) {\n if (isNone(properties[key])) {\n res.push(null);\n } else {\n res.push(properties[key]);\n }\n }\n }\n return res;\n });\n\n /**\n Creates a new property that is an alias for another property\n on an object. Calls to `get` or `set` this property behave as\n though they were called on the original property.\n\n ```javascript\n var Person = Ember.Object.extend({\n name: 'Alex Matchneer',\n nomen: Ember.computed.alias('name')\n });\n\n var alex = Person.create();\n\n alex.get('nomen'); // 'Alex Matchneer'\n alex.get('name'); // 'Alex Matchneer'\n\n alex.set('nomen', '@machty');\n alex.get('name'); // '@machty'\n ```\n\n @method computed.alias\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates an\n alias to the original value for property.\n */\n computed.alias = function(dependentKey) {\n return computed(dependentKey, function(key, value) {\n if (arguments.length > 1) {\n set(this, dependentKey, value);\n return get(this, dependentKey);\n } else {\n return get(this, dependentKey);\n }\n });\n };\n\n /**\n Where `computed.alias` aliases `get` and `set`, and allows for bidirectional\n data flow, `computed.oneWay` only provides an aliased `get`. The `set` will\n not mutate the upstream property, rather causes the current property to\n become the value set. This causes the downstream property to permanently\n diverge from the upstream property.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n firstName: null,\n lastName: null,\n nickName: Ember.computed.oneWay('firstName')\n });\n\n var teddy = User.create({\n firstName: 'Teddy',\n lastName: 'Zeenny'\n });\n\n teddy.get('nickName'); // 'Teddy'\n teddy.set('nickName', 'TeddyBear'); // 'TeddyBear'\n teddy.get('firstName'); // 'Teddy'\n ```\n\n @method computed.oneWay\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates a\n one way computed property to the original value for property.\n */\n computed.oneWay = function(dependentKey) {\n return computed(dependentKey, function() {\n return get(this, dependentKey);\n });\n };\n\n if (Ember.FEATURES.isEnabled('query-params-new')) {\n /**\n This is a more semantically meaningful alias of `computed.oneWay`,\n whose name is somewhat ambiguous as to which direction the data flows.\n\n @method computed.reads\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates a\n one way computed property to the original value for property.\n */\n computed.reads = computed.oneWay;\n }\n\n /**\n Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides\n a readOnly one way binding. Very often when using `computed.oneWay` one does\n not also want changes to propogate back up, as they will replace the value.\n\n This prevents the reverse flow, and also throws an exception when it occurs.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n firstName: null,\n lastName: null,\n nickName: Ember.computed.readOnly('firstName')\n });\n\n var teddy = User.create({\n firstName: 'Teddy',\n lastName: 'Zeenny'\n });\n\n teddy.get('nickName'); // 'Teddy'\n teddy.set('nickName', 'TeddyBear'); // throws Exception\n // throw new Ember.Error('Cannot Set: nickName on: <User:ember27288>' );`\n teddy.get('firstName'); // 'Teddy'\n ```\n\n @method computed.readOnly\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates a\n one way computed property to the original value for property.\n @since 1.5.0\n */\n computed.readOnly = function(dependentKey) {\n return computed(dependentKey, function() {\n return get(this, dependentKey);\n }).readOnly();\n };\n /**\n A computed property that acts like a standard getter and setter,\n but returns the value at the provided `defaultPath` if the\n property itself has not been set to a value\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n wishList: Ember.computed.defaultTo('favoriteFood')\n });\n\n var hamster = Hamster.create({ favoriteFood: 'Banana' });\n\n hamster.get('wishList'); // 'Banana'\n hamster.set('wishList', 'More Unit Tests');\n hamster.get('wishList'); // 'More Unit Tests'\n hamster.get('favoriteFood'); // 'Banana'\n ```\n\n @method computed.defaultTo\n @for Ember\n @param {String} defaultPath\n @return {Ember.ComputedProperty} computed property which acts like\n a standard getter and setter, but defaults to the value from `defaultPath`.\n */\n // ES6TODO: computed should have its own export path so you can do import {defaultTo} from computed\n computed.defaultTo = function(defaultPath) {\n return computed(function(key, newValue, cachedValue) {\n if (arguments.length === 1) {\n return get(this, defaultPath);\n }\n return newValue != null ? newValue : get(this, defaultPath);\n });\n };\n\n __exports__.ComputedProperty = ComputedProperty;\n __exports__.computed = computed;\n __exports__.cacheFor = cacheFor;\n });\ndefine(\"ember-metal/core\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /*globals Em:true ENV EmberENV MetamorphENV:true */\n\n /**\n @module ember\n @submodule ember-metal\n */\n\n /**\n All Ember methods and functions are defined inside of this namespace. You\n generally should not add new properties to this namespace as it may be\n overwritten by future versions of Ember.\n\n You can also use the shorthand `Em` instead of `Ember`.\n\n Ember-Runtime is a framework that provides core functions for Ember including\n cross-platform functions, support for property observing and objects. Its\n focus is on small size and performance. You can use this in place of or\n along-side other cross-platform libraries such as jQuery.\n\n The core Runtime framework is based on the jQuery API with a number of\n performance optimizations.\n\n @class Ember\n @static\n @version 1.6.0\n */\n\n if ('undefined' === typeof Ember) {\n // Create core object. Make it act like an instance of Ember.Namespace so that\n // objects assigned to it are given a sane string representation.\n Ember = {};\n }\n\n // Default imports, exports and lookup to the global object;\n var imports = Ember.imports = Ember.imports || this;\n var exports = Ember.exports = Ember.exports || this;\n var lookup = Ember.lookup = Ember.lookup || this;\n\n // aliases needed to keep minifiers from removing the global context\n exports.Em = exports.Ember = Ember;\n\n // Make sure these are set whether Ember was already defined or not\n\n Ember.isNamespace = true;\n\n Ember.toString = function() { return \"Ember\"; };\n\n\n /**\n @property VERSION\n @type String\n @default '1.6.0'\n @static\n */\n Ember.VERSION = '1.6.0';\n\n /**\n Standard environmental variables. You can define these in a global `EmberENV`\n variable before loading Ember to control various configuration settings.\n\n For backwards compatibility with earlier versions of Ember the global `ENV`\n variable will be used if `EmberENV` is not defined.\n\n @property ENV\n @type Hash\n */\n\n if (Ember.ENV) {\n // do nothing if Ember.ENV is already setup\n } else if ('undefined' !== typeof EmberENV) {\n Ember.ENV = EmberENV;\n } else if('undefined' !== typeof ENV) {\n Ember.ENV = ENV;\n } else {\n Ember.ENV = {};\n }\n\n Ember.config = Ember.config || {};\n\n // We disable the RANGE API by default for performance reasons\n if ('undefined' === typeof Ember.ENV.DISABLE_RANGE_API) {\n Ember.ENV.DISABLE_RANGE_API = true;\n }\n\n if (\"undefined\" === typeof MetamorphENV) {\n exports.MetamorphENV = {};\n }\n\n MetamorphENV.DISABLE_RANGE_API = Ember.ENV.DISABLE_RANGE_API;\n\n /**\n Hash of enabled Canary features. Add to before creating your application.\n\n You can also define `ENV.FEATURES` if you need to enable features flagged at runtime.\n\n @class FEATURES\n @namespace Ember\n @static\n @since 1.1.0\n */\n\n Ember.FEATURES = Ember.ENV.FEATURES || {};\n\n /**\n Test that a feature is enabled. Parsed by Ember's build tools to leave\n experimental features out of beta/stable builds.\n\n You can define the following configuration options:\n\n * `ENV.ENABLE_ALL_FEATURES` - force all features to be enabled.\n * `ENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly\n enabled/disabled.\n\n @method isEnabled\n @param {String} feature\n @return {Boolean}\n @for Ember.FEATURES\n @since 1.1.0\n */\n\n Ember.FEATURES.isEnabled = function(feature) {\n var featureValue = Ember.FEATURES[feature];\n\n if (Ember.ENV.ENABLE_ALL_FEATURES) {\n return true;\n } else if (featureValue === true || featureValue === false || featureValue === undefined) {\n return featureValue;\n } else if (Ember.ENV.ENABLE_OPTIONAL_FEATURES) {\n return true;\n } else {\n return false;\n }\n };\n\n // ..........................................................\n // BOOTSTRAP\n //\n\n /**\n Determines whether Ember should enhance some built-in object prototypes to\n provide a more friendly API. If enabled, a few methods will be added to\n `Function`, `String`, and `Array`. `Object.prototype` will not be enhanced,\n which is the one that causes most trouble for people.\n\n In general we recommend leaving this option set to true since it rarely\n conflicts with other code. If you need to turn it off however, you can\n define an `ENV.EXTEND_PROTOTYPES` config to disable it.\n\n @property EXTEND_PROTOTYPES\n @type Boolean\n @default true\n @for Ember\n */\n Ember.EXTEND_PROTOTYPES = Ember.ENV.EXTEND_PROTOTYPES;\n\n if (typeof Ember.EXTEND_PROTOTYPES === 'undefined') {\n Ember.EXTEND_PROTOTYPES = true;\n }\n\n /**\n Determines whether Ember logs a full stack trace during deprecation warnings\n\n @property LOG_STACKTRACE_ON_DEPRECATION\n @type Boolean\n @default true\n */\n Ember.LOG_STACKTRACE_ON_DEPRECATION = (Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== false);\n\n /**\n Determines whether Ember should add ECMAScript 5 shims to older browsers.\n\n @property SHIM_ES5\n @type Boolean\n @default Ember.EXTEND_PROTOTYPES\n */\n Ember.SHIM_ES5 = (Ember.ENV.SHIM_ES5 === false) ? false : Ember.EXTEND_PROTOTYPES;\n\n /**\n Determines whether Ember logs info about version of used libraries\n\n @property LOG_VERSION\n @type Boolean\n @default true\n */\n Ember.LOG_VERSION = (Ember.ENV.LOG_VERSION === false) ? false : true;\n\n /**\n Empty function. Useful for some operations. Always returns `this`.\n\n @method K\n @private\n @return {Object}\n */\n Ember.K = function() { return this; };\n\n\n // Stub out the methods defined by the ember-debug package in case it's not loaded\n\n if ('undefined' === typeof Ember.assert) { Ember.assert = Ember.K; }\n if ('undefined' === typeof Ember.warn) { Ember.warn = Ember.K; }\n if ('undefined' === typeof Ember.debug) { Ember.debug = Ember.K; }\n if ('undefined' === typeof Ember.runInDebug) { Ember.runInDebug = Ember.K; }\n if ('undefined' === typeof Ember.deprecate) { Ember.deprecate = Ember.K; }\n if ('undefined' === typeof Ember.deprecateFunc) {\n Ember.deprecateFunc = function(_, func) { return func; };\n }\n\n /**\n Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from\n jQuery master. We'll just bootstrap our own uuid now.\n\n @property uuid\n @type Number\n @private\n */\n Ember.uuid = 0;\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-metal/enumerable_utils\",\n [\"ember-metal/array\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var map, forEach, indexOf, splice, filter;\n\n var map = __dependency1__.map;\n var forEach = __dependency1__.forEach;\n var indexOf = __dependency1__.indexOf;\n var filter = __dependency1__.filter;\n\n // ES6TODO: doesn't array polyfills already do this?\n map = Array.prototype.map || map;\n forEach = Array.prototype.forEach || forEach;\n indexOf = Array.prototype.indexOf || indexOf;\n filter = Array.prototype.filter || filter;\n splice = Array.prototype.splice;\n\n /**\n * Defines some convenience methods for working with Enumerables.\n * `Ember.EnumerableUtils` uses `Ember.ArrayPolyfills` when necessary.\n *\n * @class EnumerableUtils\n * @namespace Ember\n * @static\n * */\n var utils = {\n /**\n * Calls the map function on the passed object with a specified callback. This\n * uses `Ember.ArrayPolyfill`'s-map method when necessary.\n *\n * @method map\n * @param {Object} obj The object that should be mapped\n * @param {Function} callback The callback to execute\n * @param {Object} thisArg Value to use as this when executing *callback*\n *\n * @return {Array} An array of mapped values.\n */\n map: function(obj, callback, thisArg) {\n return obj.map ? obj.map.call(obj, callback, thisArg) : map.call(obj, callback, thisArg);\n },\n\n /**\n * Calls the forEach function on the passed object with a specified callback. This\n * uses `Ember.ArrayPolyfill`'s-forEach method when necessary.\n *\n * @method forEach\n * @param {Object} obj The object to call forEach on\n * @param {Function} callback The callback to execute\n * @param {Object} thisArg Value to use as this when executing *callback*\n *\n */\n forEach: function(obj, callback, thisArg) {\n return obj.forEach ? obj.forEach.call(obj, callback, thisArg) : forEach.call(obj, callback, thisArg);\n },\n\n /**\n * Calls the filter function on the passed object with a specified callback. This\n * uses `Ember.ArrayPolyfill`'s-filter method when necessary.\n *\n * @method filter\n * @param {Object} obj The object to call filter on\n * @param {Function} callback The callback to execute\n * @param {Object} thisArg Value to use as this when executing *callback*\n *\n * @return {Array} An array containing the filtered values\n * @since 1.4.0\n */\n filter: function(obj, callback, thisArg) {\n return obj.filter ? obj.filter.call(obj, callback, thisArg) : filter.call(obj, callback, thisArg);\n },\n\n /**\n * Calls the indexOf function on the passed object with a specified callback. This\n * uses `Ember.ArrayPolyfill`'s-indexOf method when necessary.\n *\n * @method indexOf\n * @param {Object} obj The object to call indexOn on\n * @param {Function} callback The callback to execute\n * @param {Object} index The index to start searching from\n *\n */\n indexOf: function(obj, element, index) {\n return obj.indexOf ? obj.indexOf.call(obj, element, index) : indexOf.call(obj, element, index);\n },\n\n /**\n * Returns an array of indexes of the first occurrences of the passed elements\n * on the passed object.\n *\n * ```javascript\n * var array = [1, 2, 3, 4, 5];\n * Ember.EnumerableUtils.indexesOf(array, [2, 5]); // [1, 4]\n *\n * var fubar = \"Fubarr\";\n * Ember.EnumerableUtils.indexesOf(fubar, ['b', 'r']); // [2, 4]\n * ```\n *\n * @method indexesOf\n * @param {Object} obj The object to check for element indexes\n * @param {Array} elements The elements to search for on *obj*\n *\n * @return {Array} An array of indexes.\n *\n */\n indexesOf: function(obj, elements) {\n return elements === undefined ? [] : utils.map(elements, function(item) {\n return utils.indexOf(obj, item);\n });\n },\n\n /**\n * Adds an object to an array. If the array already includes the object this\n * method has no effect.\n *\n * @method addObject\n * @param {Array} array The array the passed item should be added to\n * @param {Object} item The item to add to the passed array\n *\n * @return 'undefined'\n */\n addObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index === -1) { array.push(item); }\n },\n\n /**\n * Removes an object from an array. If the array does not contain the passed\n * object this method has no effect.\n *\n * @method removeObject\n * @param {Array} array The array to remove the item from.\n * @param {Object} item The item to remove from the passed array.\n *\n * @return 'undefined'\n */\n removeObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index !== -1) { array.splice(index, 1); }\n },\n\n _replace: function(array, idx, amt, objects) {\n var args = [].concat(objects), chunk, ret = [],\n // https://code.google.com/p/chromium/issues/detail?id=56588\n size = 60000, start = idx, ends = amt, count;\n\n while (args.length) {\n count = ends > size ? size : ends;\n if (count <= 0) { count = 0; }\n\n chunk = args.splice(0, size);\n chunk = [start, count].concat(chunk);\n\n start += size;\n ends -= count;\n\n ret = ret.concat(splice.apply(array, chunk));\n }\n return ret;\n },\n\n /**\n * Replaces objects in an array with the passed objects.\n *\n * ```javascript\n * var array = [1,2,3];\n * Ember.EnumerableUtils.replace(array, 1, 2, [4, 5]); // [1, 4, 5]\n *\n * var array = [1,2,3];\n * Ember.EnumerableUtils.replace(array, 1, 1, [4, 5]); // [1, 4, 5, 3]\n *\n * var array = [1,2,3];\n * Ember.EnumerableUtils.replace(array, 10, 1, [4, 5]); // [1, 2, 3, 4, 5]\n * ```\n *\n * @method replace\n * @param {Array} array The array the objects should be inserted into.\n * @param {Number} idx Starting index in the array to replace. If *idx* >=\n * length, then append to the end of the array.\n * @param {Number} amt Number of elements that should be removed from the array,\n * starting at *idx*\n * @param {Array} objects An array of zero or more objects that should be\n * inserted into the array at *idx*\n *\n * @return {Array} The modified array.\n */\n replace: function(array, idx, amt, objects) {\n if (array.replace) {\n return array.replace(idx, amt, objects);\n } else {\n return utils._replace(array, idx, amt, objects);\n }\n },\n\n /**\n * Calculates the intersection of two arrays. This method returns a new array\n * filled with the records that the two passed arrays share with each other.\n * If there is no intersection, an empty array will be returned.\n *\n * ```javascript\n * var array1 = [1, 2, 3, 4, 5];\n * var array2 = [1, 3, 5, 6, 7];\n *\n * Ember.EnumerableUtils.intersection(array1, array2); // [1, 3, 5]\n *\n * var array1 = [1, 2, 3];\n * var array2 = [4, 5, 6];\n *\n * Ember.EnumerableUtils.intersection(array1, array2); // []\n * ```\n *\n * @method intersection\n * @param {Array} array1 The first array\n * @param {Array} array2 The second array\n *\n * @return {Array} The intersection of the two passed arrays.\n */\n intersection: function(array1, array2) {\n var intersection = [];\n\n utils.forEach(array1, function(element) {\n if (utils.indexOf(array2, element) >= 0) {\n intersection.push(element);\n }\n });\n\n return intersection;\n }\n };\n\n __exports__[\"default\"] = utils;\n });\ndefine(\"ember-metal/error\",\n [\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var create = __dependency1__.create;\n\n var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];\n\n /**\n A subclass of the JavaScript Error object for use in Ember.\n\n @class Error\n @namespace Ember\n @extends Error\n @constructor\n */\n var EmberError = function() {\n var tmp = Error.apply(this, arguments);\n\n // Adds a `stack` property to the given error object that will yield the\n // stack trace at the time captureStackTrace was called.\n // When collecting the stack trace all frames above the topmost call\n // to this function, including that call, will be left out of the\n // stack trace.\n // This is useful because we can hide Ember implementation details\n // that are not very helpful for the user.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, Ember.Error);\n }\n // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n for (var idx = 0; idx < errorProps.length; idx++) {\n this[errorProps[idx]] = tmp[errorProps[idx]];\n }\n };\n\n EmberError.prototype = create(Error.prototype);\n\n __exports__[\"default\"] = EmberError;\n });\ndefine(\"ember-metal/events\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n var Ember = __dependency1__[\"default\"];\n var meta = __dependency2__.meta;\n var META_KEY = __dependency2__.META_KEY;\n var tryFinally = __dependency2__.tryFinally;\n var apply = __dependency2__.apply;\n var applyStr = __dependency2__.applyStr;\n var create = __dependency3__.create;\n\n var a_slice = [].slice,\n metaFor = meta,\n /* listener flags */\n ONCE = 1, SUSPENDED = 2;\n\n\n /*\n The event system uses a series of nested hashes to store listeners on an\n object. When a listener is registered, or when an event arrives, these\n hashes are consulted to determine which target and action pair to invoke.\n\n The hashes are stored in the object's meta hash, and look like this:\n\n // Object's meta hash\n {\n listeners: { // variable name: `listenerSet`\n \"foo:changed\": [ // variable name: `actions`\n target, method, flags\n ]\n }\n }\n\n */\n\n function indexOf(array, target, method) {\n var index = -1;\n // hashes are added to the end of the event array\n // so it makes sense to start searching at the end\n // of the array and search in reverse\n for (var i = array.length - 3 ; i >=0; i -= 3) {\n if (target === array[i] && method === array[i + 1]) {\n index = i; break;\n }\n }\n return index;\n }\n\n function actionsFor(obj, eventName) {\n var meta = metaFor(obj, true),\n actions;\n\n if (!meta.listeners) { meta.listeners = {}; }\n\n if (!meta.hasOwnProperty('listeners')) {\n // setup inherited copy of the listeners object\n meta.listeners = create(meta.listeners);\n }\n\n actions = meta.listeners[eventName];\n\n // if there are actions, but the eventName doesn't exist in our listeners, then copy them from the prototype\n if (actions && !meta.listeners.hasOwnProperty(eventName)) {\n actions = meta.listeners[eventName] = meta.listeners[eventName].slice();\n } else if (!actions) {\n actions = meta.listeners[eventName] = [];\n }\n\n return actions;\n }\n\n function listenersUnion(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n var target = actions[i],\n method = actions[i+1],\n flags = actions[i+2],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex === -1) {\n otherActions.push(target, method, flags);\n }\n }\n }\n\n function listenersDiff(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName],\n diffActions = [];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n var target = actions[i],\n method = actions[i+1],\n flags = actions[i+2],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex !== -1) { continue; }\n\n otherActions.push(target, method, flags);\n diffActions.push(target, method, flags);\n }\n\n return diffActions;\n }\n\n /**\n Add an event listener\n\n @method addListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Boolean} once A flag whether a function should only be called once\n */\n function addListener(obj, eventName, target, method, once) {\n Ember.assert(\"You must pass at least an object and event name to Ember.addListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method),\n flags = 0;\n\n if (once) flags |= ONCE;\n\n if (actionIndex !== -1) { return; }\n\n actions.push(target, method, flags);\n\n if ('function' === typeof obj.didAddListener) {\n obj.didAddListener(eventName, target, method);\n }\n }\n\n /**\n Remove an event listener\n\n Arguments should match those passed to `Ember.addListener`.\n\n @method removeListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n */\n function removeListener(obj, eventName, target, method) {\n Ember.assert(\"You must pass at least an object and event name to Ember.removeListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n function _removeListener(target, method) {\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n // action doesn't exist, give up silently\n if (actionIndex === -1) { return; }\n\n actions.splice(actionIndex, 3);\n\n if ('function' === typeof obj.didRemoveListener) {\n obj.didRemoveListener(eventName, target, method);\n }\n }\n\n if (method) {\n _removeListener(target, method);\n } else {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n _removeListener(actions[i], actions[i+1]);\n }\n }\n }\n\n /**\n Suspend listener during callback.\n\n This should only be used by the target of the event listener\n when it is taking an action that would cause the event, e.g.\n an object might suspend its property change listener while it is\n setting that property.\n\n @method suspendListener\n @for Ember\n\n @private\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n */\n function suspendListener(obj, eventName, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n actions[actionIndex+2] |= SUSPENDED; // mark the action as suspended\n }\n\n function tryable() { return callback.call(target); }\n function finalizer() { if (actionIndex !== -1) { actions[actionIndex+2] &= ~SUSPENDED; } }\n\n return tryFinally(tryable, finalizer);\n }\n\n /**\n Suspends multiple listeners during a callback.\n\n @method suspendListeners\n @for Ember\n\n @private\n @param obj\n @param {Array} eventName Array of event names\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n */\n function suspendListeners(obj, eventNames, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var suspendedActions = [],\n actionsList = [],\n eventName, actions, i, l;\n\n for (i=0, l=eventNames.length; i<l; i++) {\n eventName = eventNames[i];\n actions = actionsFor(obj, eventName);\n var actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n actions[actionIndex+2] |= SUSPENDED;\n suspendedActions.push(actionIndex);\n actionsList.push(actions);\n }\n }\n\n function tryable() { return callback.call(target); }\n\n function finalizer() {\n for (var i = 0, l = suspendedActions.length; i < l; i++) {\n var actionIndex = suspendedActions[i];\n actionsList[i][actionIndex+2] &= ~SUSPENDED;\n }\n }\n\n return tryFinally(tryable, finalizer);\n }\n\n /**\n Return a list of currently watched events\n\n @private\n @method watchedEvents\n @for Ember\n @param obj\n */\n function watchedEvents(obj) {\n var listeners = obj[META_KEY].listeners, ret = [];\n\n if (listeners) {\n for(var eventName in listeners) {\n if (listeners[eventName]) { ret.push(eventName); }\n }\n }\n return ret;\n }\n\n /**\n Send an event. The execution of suspended listeners\n is skipped, and once listeners are removed. A listener without\n a target is executed on the passed object. If an array of actions\n is not passed, the actions stored on the passed object are invoked.\n\n @method sendEvent\n @for Ember\n @param obj\n @param {String} eventName\n @param {Array} params Optional parameters for each listener.\n @param {Array} actions Optional array of actions (listeners).\n @return true\n */\n function sendEvent(obj, eventName, params, actions) {\n // first give object a chance to handle it\n if (obj !== Ember && 'function' === typeof obj.sendEvent) {\n obj.sendEvent(eventName, params);\n }\n\n if (!actions) {\n var meta = obj[META_KEY];\n actions = meta && meta.listeners && meta.listeners[eventName];\n }\n\n if (!actions) { return; }\n\n for (var i = actions.length - 3; i >= 0; i -= 3) { // looping in reverse for once listeners\n var target = actions[i], method = actions[i+1], flags = actions[i+2];\n if (!method) { continue; }\n if (flags & SUSPENDED) { continue; }\n if (flags & ONCE) { removeListener(obj, eventName, target, method); }\n if (!target) { target = obj; }\n if ('string' === typeof method) {\n if (params) {\n applyStr(target, method, params);\n } else {\n target[method]();\n }\n } else {\n if (params) {\n apply(target, method, params);\n } else {\n method.call(target);\n }\n }\n }\n return true;\n }\n\n /**\n @private\n @method hasListeners\n @for Ember\n @param obj\n @param {String} eventName\n */\n function hasListeners(obj, eventName) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n return !!(actions && actions.length);\n }\n\n /**\n @private\n @method listenersFor\n @for Ember\n @param obj\n @param {String} eventName\n */\n function listenersFor(obj, eventName) {\n var ret = [];\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return ret; }\n\n for (var i = 0, l = actions.length; i < l; i += 3) {\n var target = actions[i],\n method = actions[i+1];\n ret.push([target, method]);\n }\n\n return ret;\n }\n\n /**\n Define a property as a function that should be executed when\n a specified event or events are triggered.\n\n\n ``` javascript\n var Job = Ember.Object.extend({\n logCompleted: Ember.on('completed', function() {\n console.log('Job completed!');\n })\n });\n\n var job = Job.create();\n\n Ember.sendEvent(job, 'completed'); // Logs 'Job completed!'\n ```\n\n @method on\n @for Ember\n @param {String} eventNames*\n @param {Function} func\n @return func\n */\n function on(){\n var func = a_slice.call(arguments, -1)[0],\n events = a_slice.call(arguments, 0, -1);\n func.__ember_listens__ = events;\n return func;\n };\n\n __exports__.on = on;\n __exports__.addListener = addListener;\n __exports__.removeListener = removeListener;\n __exports__.suspendListener = suspendListener;\n __exports__.suspendListeners = suspendListeners;\n __exports__.sendEvent = sendEvent;\n __exports__.hasListeners = hasListeners;\n __exports__.watchedEvents = watchedEvents;\n __exports__.listenersFor = listenersFor;\n __exports__.listenersDiff = listenersDiff;\n __exports__.listenersUnion = listenersUnion;\n });\ndefine(\"ember-metal/expand_properties\",\n [\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var EmberError = __dependency1__[\"default\"];\n var EnumerableUtils = __dependency2__[\"default\"];\n\n /**\n @module ember-metal\n */\n\n var forEach = EnumerableUtils.forEach,\n BRACE_EXPANSION = /^((?:[^\\.]*\\.)*)\\{(.*)\\}$/;\n\n /**\n Expands `pattern`, invoking `callback` for each expansion.\n\n The only pattern supported is brace-expansion, anything else will be passed\n once to `callback` directly. Brace expansion can only appear at the end of a\n pattern, for an example see the last call below.\n\n Example\n ```js\n function echo(arg){ console.log(arg); }\n\n Ember.expandProperties('foo.bar', echo); //=> 'foo.bar'\n Ember.expandProperties('{foo,bar}', echo); //=> 'foo', 'bar'\n Ember.expandProperties('foo.{bar,baz}', echo); //=> 'foo.bar', 'foo.baz'\n Ember.expandProperties('{foo,bar}.baz', echo); //=> '{foo,bar}.baz'\n ```\n\n @method\n @private\n @param {string} pattern The property pattern to expand.\n @param {function} callback The callback to invoke. It is invoked once per\n expansion, and is passed the expansion.\n */\n function expandProperties(pattern, callback) {\n var match, prefix, list;\n\n if (pattern.indexOf(' ') > -1) {\n throw new EmberError('Brace expanded properties cannot contain spaces, ' + \n 'e.g. `user.{firstName, lastName}` should be `user.{firstName,lastName}`');\n }\n\n if (match = BRACE_EXPANSION.exec(pattern)) {\n prefix = match[1];\n list = match[2];\n\n forEach(list.split(','), function (suffix) {\n callback(prefix + suffix);\n });\n } else {\n callback(pattern);\n }\n };\n\n __exports__[\"default\"] = expandProperties;\n });\ndefine(\"ember-metal/get_properties\",\n [\"ember-metal/property_get\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var typeOf = __dependency2__.typeOf;\n\n /**\n To get multiple properties at once, call `Ember.getProperties`\n with an object followed by a list of strings or an array:\n\n ```javascript\n Ember.getProperties(record, 'firstName', 'lastName', 'zipCode');\n // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']);\n // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param obj\n @param {String...|Array} list of keys to get\n @return {Hash}\n */\n function getProperties(obj) {\n var ret = {},\n propertyNames = arguments,\n i = 1;\n\n if (arguments.length === 2 && typeOf(arguments[1]) === 'array') {\n i = 0;\n propertyNames = arguments[1];\n }\n for(var len = propertyNames.length; i < len; i++) {\n ret[propertyNames[i]] = get(obj, propertyNames[i]);\n }\n return ret;\n };\n\n __exports__[\"default\"] = getProperties;\n });\ndefine(\"ember-metal/instrumentation\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var tryCatchFinally = __dependency2__.tryCatchFinally;\n\n /**\n The purpose of the Ember Instrumentation module is\n to provide efficient, general-purpose instrumentation\n for Ember.\n\n Subscribe to a listener by using `Ember.subscribe`:\n\n ```javascript\n Ember.subscribe(\"render\", {\n before: function(name, timestamp, payload) {\n\n },\n\n after: function(name, timestamp, payload) {\n\n }\n });\n ```\n\n If you return a value from the `before` callback, that same\n value will be passed as a fourth parameter to the `after`\n callback.\n\n Instrument a block of code by using `Ember.instrument`:\n\n ```javascript\n Ember.instrument(\"render.handlebars\", payload, function() {\n // rendering logic\n }, binding);\n ```\n\n Event names passed to `Ember.instrument` are namespaced\n by periods, from more general to more specific. Subscribers\n can listen for events by whatever level of granularity they\n are interested in.\n\n In the above example, the event is `render.handlebars`,\n and the subscriber listened for all events beginning with\n `render`. It would receive callbacks for events named\n `render`, `render.handlebars`, `render.container`, or\n even `render.handlebars.layout`.\n\n @class Instrumentation\n @namespace Ember\n @static\n */\n var subscribers = [], cache = {};\n\n var populateListeners = function(name) {\n var listeners = [], subscriber;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n subscriber = subscribers[i];\n if (subscriber.regex.test(name)) {\n listeners.push(subscriber.object);\n }\n }\n\n cache[name] = listeners;\n return listeners;\n };\n\n var time = (function() {\n var perf = 'undefined' !== typeof window ? window.performance || {} : {};\n var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow;\n // fn.bind will be available in all the browsers that support the advanced window.performance... ;-)\n return fn ? fn.bind(perf) : function() { return +new Date(); };\n })();\n\n /**\n Notifies event's subscribers, calls `before` and `after` hooks.\n\n @method instrument\n @namespace Ember.Instrumentation\n\n @param {String} [name] Namespaced event name.\n @param {Object} payload\n @param {Function} callback Function that you're instrumenting.\n @param {Object} binding Context that instrument function is called with.\n */\n function instrument(name, payload, callback, binding) {\n var listeners = cache[name], timeName, ret;\n\n // ES6TODO: Docs. What is this?\n if (Ember.STRUCTURED_PROFILE) {\n timeName = name + \": \" + payload.object;\n console.time(timeName);\n }\n\n if (!listeners) {\n listeners = populateListeners(name);\n }\n\n if (listeners.length === 0) {\n ret = callback.call(binding);\n if (Ember.STRUCTURED_PROFILE) { console.timeEnd(timeName); }\n return ret;\n }\n\n var beforeValues = [], listener, i, l;\n\n function tryable() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n }\n\n function catchable(e) {\n payload = payload || {};\n payload.exception = e;\n }\n\n function finalizer() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n\n if (Ember.STRUCTURED_PROFILE) {\n console.timeEnd(timeName);\n }\n }\n\n return tryCatchFinally(tryable, catchable, finalizer);\n };\n\n /**\n Subscribes to a particular event or instrumented block of code.\n\n @method subscribe\n @namespace Ember.Instrumentation\n\n @param {String} [pattern] Namespaced event name.\n @param {Object} [object] Before and After hooks.\n\n @return {Subscriber}\n */\n function subscribe(pattern, object) {\n var paths = pattern.split(\".\"), path, regex = [];\n\n for (var i=0, l=paths.length; i<l; i++) {\n path = paths[i];\n if (path === \"*\") {\n regex.push(\"[^\\\\.]*\");\n } else {\n regex.push(path);\n }\n }\n\n regex = regex.join(\"\\\\.\");\n regex = regex + \"(\\\\..*)?\";\n\n var subscriber = {\n pattern: pattern,\n regex: new RegExp(\"^\" + regex + \"$\"),\n object: object\n };\n\n subscribers.push(subscriber);\n cache = {};\n\n return subscriber;\n };\n\n /**\n Unsubscribes from a particular event or instrumented block of code.\n\n @method unsubscribe\n @namespace Ember.Instrumentation\n\n @param {Object} [subscriber]\n */\n function unsubscribe(subscriber) {\n var index;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n if (subscribers[i] === subscriber) {\n index = i;\n }\n }\n\n subscribers.splice(index, 1);\n cache = {};\n };\n\n /**\n Resets `Ember.Instrumentation` by flushing list of subscribers.\n\n @method reset\n @namespace Ember.Instrumentation\n */\n function reset() {\n subscribers = [];\n cache = {};\n };\n\n __exports__.instrument = instrument;\n __exports__.subscribe = subscribe;\n __exports__.unsubscribe = unsubscribe;\n __exports__.reset = reset;\n });\ndefine(\"ember-metal/is_blank\",\n [\"ember-metal/core\",\"ember-metal/is_empty\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // deprecateFunc\n var isEmpty = __dependency2__[\"default\"];\n\n /**\n A value is blank if it is empty or a whitespace string.\n\n ```javascript\n Ember.isBlank(); // true\n Ember.isBlank(null); // true\n Ember.isBlank(undefined); // true\n Ember.isBlank(''); // true\n Ember.isBlank([]); // true\n Ember.isBlank('\\n\\t'); // true\n Ember.isBlank(' '); // true\n Ember.isBlank({}); // false\n Ember.isBlank('\\n\\t Hello'); // false\n Ember.isBlank('Hello world'); // false\n Ember.isBlank([1,2,3]); // false\n ```\n\n @method isBlank\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n @since 1.5.0\n */\n function isBlank(obj) {\n return isEmpty(obj) || (typeof obj === 'string' && obj.match(/\\S/) === null);\n };\n\n __exports__[\"default\"] = isBlank;\n });\ndefine(\"ember-metal/is_empty\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/is_none\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // deprecateFunc\n var get = __dependency2__.get;\n var isNone = __dependency3__[\"default\"];\n\n /**\n Verifies that a value is `null` or an empty string, empty array,\n or empty function.\n\n Constrains the rules on `Ember.isNone` by returning false for empty\n string and empty arrays.\n\n ```javascript\n Ember.isEmpty(); // true\n Ember.isEmpty(null); // true\n Ember.isEmpty(undefined); // true\n Ember.isEmpty(''); // true\n Ember.isEmpty([]); // true\n Ember.isEmpty('Adam Hawkins'); // false\n Ember.isEmpty([0,1,2]); // false\n ```\n\n @method isEmpty\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n */\n var isEmpty = function(obj) {\n return isNone(obj) || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && get(obj, 'length') === 0);\n };\n var empty = Ember.deprecateFunc(\"Ember.empty is deprecated. Please use Ember.isEmpty instead.\", isEmpty);\n\n __exports__[\"default\"] = isEmpty;\n __exports__.isEmpty = isEmpty;\n __exports__.empty = empty;\n });\ndefine(\"ember-metal/is_none\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // deprecateFunc\n\n /**\n Returns true if the passed value is null or undefined. This avoids errors\n from JSLint complaining about use of ==, which can be technically\n confusing.\n\n ```javascript\n Ember.isNone(); // true\n Ember.isNone(null); // true\n Ember.isNone(undefined); // true\n Ember.isNone(''); // false\n Ember.isNone([]); // false\n Ember.isNone(function() {}); // false\n ```\n\n @method isNone\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n */\n var isNone = function(obj) {\n return obj === null || obj === undefined;\n };\n var none = Ember.deprecateFunc(\"Ember.none is deprecated. Please use Ember.isNone instead.\", isNone);\n\n __exports__[\"default\"] = isNone;\n __exports__.isNone = isNone;\n __exports__.none = none;\n });\ndefine(\"ember-metal/libraries\",\n [\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n // Provides a way to register library versions with ember.\n var EnumerableUtils = __dependency1__[\"default\"];\n\n var forEach = EnumerableUtils.forEach,\n indexOf = EnumerableUtils.indexOf;\n\n var libraries = function() {\n var _libraries = [];\n var coreLibIndex = 0;\n\n var getLibrary = function(name) {\n for (var i = 0; i < _libraries.length; i++) {\n if (_libraries[i].name === name) {\n return _libraries[i];\n }\n }\n };\n\n _libraries.register = function(name, version) {\n if (!getLibrary(name)) {\n _libraries.push({name: name, version: version});\n }\n };\n\n _libraries.registerCoreLibrary = function(name, version) {\n if (!getLibrary(name)) {\n _libraries.splice(coreLibIndex++, 0, {name: name, version: version});\n }\n };\n\n _libraries.deRegister = function(name) {\n var lib = getLibrary(name);\n if (lib) _libraries.splice(indexOf(_libraries, lib), 1);\n };\n\n _libraries.each = function (callback) {\n forEach(_libraries, function(lib) {\n callback(lib.name, lib.version);\n });\n };\n\n return _libraries;\n }();\n\n __exports__[\"default\"] = libraries;\n });\ndefine(\"ember-metal/logger\",\n [\"ember-metal/core\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var EmberError = __dependency2__[\"default\"];\n\n function consoleMethod(name) {\n var consoleObj, logToConsole;\n if (Ember.imports.console) {\n consoleObj = Ember.imports.console;\n } else if (typeof console !== 'undefined') {\n consoleObj = console;\n }\n\n var method = typeof consoleObj === 'object' ? consoleObj[name] : null;\n\n if (method) {\n // Older IE doesn't support apply, but Chrome needs it\n if (typeof method.apply === 'function') {\n logToConsole = function() {\n method.apply(consoleObj, arguments);\n };\n logToConsole.displayName = 'console.' + name;\n return logToConsole;\n } else {\n return function() {\n var message = Array.prototype.join.call(arguments, ', ');\n method(message);\n };\n }\n }\n }\n\n function assertPolyfill(test, message) {\n if (!test) {\n try {\n // attempt to preserve the stack\n throw new EmberError(\"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 */\n var Logger = {\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\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\n @method log\n @for Ember.Logger\n @param {*} arguments\n */\n log: consoleMethod('log') || Ember.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\n ```javascript\n Ember.Logger.warn('Something happened!');\n // \"Something happened!\" will be printed to the console with a warning icon.\n ```\n\n @method warn\n @for Ember.Logger\n @param {*} arguments\n */\n warn: consoleMethod('warn') || Ember.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\n ```javascript\n Ember.Logger.error('Danger! Danger!');\n // \"Danger! Danger!\" will be printed to the console in red text.\n ```\n\n @method error\n @for Ember.Logger\n @param {*} arguments\n */\n error: consoleMethod('error') || Ember.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\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\n @method info\n @for Ember.Logger\n @param {*} arguments\n */\n info: consoleMethod('info') || Ember.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\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\n @method debug\n @for Ember.Logger\n @param {*} arguments\n */\n debug: consoleMethod('debug') || consoleMethod('info') || Ember.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\n ```javascript\n Ember.Logger.assert(true); // undefined\n Ember.Logger.assert(true === false); // Throws an Assertion failed error.\n ```\n\n @method assert\n @for Ember.Logger\n @param {Boolean} bool Value to test\n */\n assert: consoleMethod('assert') || assertPolyfill\n };\n\n __exports__[\"default\"] = Logger;\n });\ndefine(\"ember-metal\",\n [\"ember-metal/core\",\"ember-metal/merge\",\"ember-metal/instrumentation\",\"ember-metal/utils\",\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"ember-metal/platform\",\"ember-metal/array\",\"ember-metal/logger\",\"ember-metal/property_get\",\"ember-metal/events\",\"ember-metal/observer_set\",\"ember-metal/property_events\",\"ember-metal/properties\",\"ember-metal/property_set\",\"ember-metal/map\",\"ember-metal/get_properties\",\"ember-metal/set_properties\",\"ember-metal/watch_key\",\"ember-metal/chains\",\"ember-metal/watch_path\",\"ember-metal/watching\",\"ember-metal/expand_properties\",\"ember-metal/computed\",\"ember-metal/observer\",\"ember-metal/mixin\",\"ember-metal/binding\",\"ember-metal/run_loop\",\"ember-metal/libraries\",\"ember-metal/is_none\",\"ember-metal/is_empty\",\"ember-metal/is_blank\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __dependency27__, __dependency28__, __dependency29__, __dependency30__, __dependency31__, __dependency32__, __exports__) {\n \"use strict\";\n /**\n Ember Metal\n\n @module ember\n @submodule ember-metal\n */\n\n // BEGIN IMPORTS\n var Ember = __dependency1__[\"default\"];\n var merge = __dependency2__[\"default\"];\n var instrument = __dependency3__.instrument;\n var subscribe = __dependency3__.subscribe;\n var unsubscribe = __dependency3__.unsubscribe;\n var reset = __dependency3__.reset;\n var generateGuid = __dependency4__.generateGuid;\n var GUID_KEY = __dependency4__.GUID_KEY;\n var GUID_PREFIX = __dependency4__.GUID_PREFIX;\n var guidFor = __dependency4__.guidFor;\n var META_DESC = __dependency4__.META_DESC;\n var EMPTY_META = __dependency4__.EMPTY_META;\n var meta = __dependency4__.meta;\n var getMeta = __dependency4__.getMeta;\n var setMeta = __dependency4__.setMeta;\n var metaPath = __dependency4__.metaPath;\n var inspect = __dependency4__.inspect;\n var typeOf = __dependency4__.typeOf;\n var tryCatchFinally = __dependency4__.tryCatchFinally;\n var isArray = __dependency4__.isArray;\n var makeArray = __dependency4__.makeArray;\n var canInvoke = __dependency4__.canInvoke;\n var tryInvoke = __dependency4__.tryInvoke;\n var tryFinally = __dependency4__.tryFinally;\n var wrap = __dependency4__.wrap;\n var apply = __dependency4__.apply;\n var applyStr = __dependency4__.applyStr;\n var EmberError = __dependency5__[\"default\"];\n var EnumerableUtils = __dependency6__[\"default\"];\n\n var create = __dependency7__.create;\n var platform = __dependency7__.platform;\n var map = __dependency8__.map;\n var forEach = __dependency8__.forEach;\n var filter = __dependency8__.filter;\n var indexOf = __dependency8__.indexOf;\n var Logger = __dependency9__[\"default\"];\n\n var get = __dependency10__.get;\n var getWithDefault = __dependency10__.getWithDefault;\n var normalizeTuple = __dependency10__.normalizeTuple;\n var _getPath = __dependency10__._getPath;\n\n var on = __dependency11__.on;\n var addListener = __dependency11__.addListener;\n var removeListener = __dependency11__.removeListener;\n var suspendListener = __dependency11__.suspendListener;\n var suspendListeners = __dependency11__.suspendListeners;\n var sendEvent = __dependency11__.sendEvent;\n var hasListeners = __dependency11__.hasListeners;\n var watchedEvents = __dependency11__.watchedEvents;\n var listenersFor = __dependency11__.listenersFor;\n var listenersDiff = __dependency11__.listenersDiff;\n var listenersUnion = __dependency11__.listenersUnion;\n\n var ObserverSet = __dependency12__[\"default\"];\n\n var propertyWillChange = __dependency13__.propertyWillChange;\n var propertyDidChange = __dependency13__.propertyDidChange;\n var overrideChains = __dependency13__.overrideChains;\n var beginPropertyChanges = __dependency13__.beginPropertyChanges;\n var endPropertyChanges = __dependency13__.endPropertyChanges;\n var changeProperties = __dependency13__.changeProperties;\n\n var Descriptor = __dependency14__.Descriptor;\n var defineProperty = __dependency14__.defineProperty;\n var set = __dependency15__.set;\n var trySet = __dependency15__.trySet;\n\n var OrderedSet = __dependency16__.OrderedSet;\n var Map = __dependency16__.Map;\n var MapWithDefault = __dependency16__.MapWithDefault;\n var getProperties = __dependency17__[\"default\"];\n var setProperties = __dependency18__[\"default\"];\n var watchKey = __dependency19__.watchKey;\n var unwatchKey = __dependency19__.unwatchKey;\n var flushPendingChains = __dependency20__.flushPendingChains;\n var removeChainWatcher = __dependency20__.removeChainWatcher;\n var ChainNode = __dependency20__.ChainNode;\n var finishChains = __dependency20__.finishChains;\n var watchPath = __dependency21__.watchPath;\n var unwatchPath = __dependency21__.unwatchPath;\n var watch = __dependency22__.watch;\n var isWatching = __dependency22__.isWatching;\n var unwatch = __dependency22__.unwatch;\n var rewatch = __dependency22__.rewatch;\n var destroy = __dependency22__.destroy;\n var expandProperties = __dependency23__[\"default\"];\n var ComputedProperty = __dependency24__.ComputedProperty;\n var computed = __dependency24__.computed;\n var cacheFor = __dependency24__.cacheFor;\n\n var addObserver = __dependency25__.addObserver;\n var observersFor = __dependency25__.observersFor;\n var removeObserver = __dependency25__.removeObserver;\n var addBeforeObserver = __dependency25__.addBeforeObserver;\n var _suspendBeforeObserver = __dependency25__._suspendBeforeObserver;\n var _suspendObserver = __dependency25__._suspendObserver;\n var _suspendBeforeObservers = __dependency25__._suspendBeforeObservers;\n var _suspendObservers = __dependency25__._suspendObservers;\n var beforeObserversFor = __dependency25__.beforeObserversFor;\n var removeBeforeObserver = __dependency25__.removeBeforeObserver;\n var IS_BINDING = __dependency26__.IS_BINDING;\n var mixin = __dependency26__.mixin;\n var Mixin = __dependency26__.Mixin;\n var required = __dependency26__.required;\n var aliasMethod = __dependency26__.aliasMethod;\n var observer = __dependency26__.observer;\n var immediateObserver = __dependency26__.immediateObserver;\n var beforeObserver = __dependency26__.beforeObserver;\n var Binding = __dependency27__.Binding;\n var isGlobalPath = __dependency27__.isGlobalPath;\n var bind = __dependency27__.bind;\n var oneWay = __dependency27__.oneWay;\n var run = __dependency28__[\"default\"];\n var libraries = __dependency29__[\"default\"];\n var isNone = __dependency30__.isNone;\n var none = __dependency30__.none;\n var isEmpty = __dependency31__.isEmpty;\n var empty = __dependency31__.empty;\n var isBlank = __dependency32__[\"default\"];\n // END IMPORTS\n\n // BEGIN EXPORTS\n var EmberInstrumentation = Ember.Instrumentation = {};\n EmberInstrumentation.instrument = instrument;\n EmberInstrumentation.subscribe = subscribe;\n EmberInstrumentation.unsubscribe = unsubscribe;\n EmberInstrumentation.reset = reset;\n\n Ember.instrument = instrument;\n Ember.subscribe = subscribe;\n\n Ember.generateGuid = generateGuid;\n Ember.GUID_KEY = GUID_KEY;\n Ember.GUID_PREFIX = GUID_PREFIX;\n Ember.create = create;\n Ember.platform = platform;\n\n var EmberArrayPolyfills = Ember.ArrayPolyfills = {};\n\n EmberArrayPolyfills.map = map;\n EmberArrayPolyfills.forEach = forEach;\n EmberArrayPolyfills.filter = filter;\n EmberArrayPolyfills.indexOf = indexOf;\n\n Ember.Error = EmberError;\n Ember.guidFor = guidFor;\n Ember.META_DESC = META_DESC;\n Ember.EMPTY_META = EMPTY_META;\n Ember.meta = meta;\n Ember.getMeta = getMeta;\n Ember.setMeta = setMeta;\n Ember.metaPath = metaPath;\n Ember.inspect = inspect;\n Ember.typeOf = typeOf;\n Ember.tryCatchFinally = tryCatchFinally;\n Ember.isArray = isArray;\n Ember.makeArray = makeArray;\n Ember.canInvoke = canInvoke;\n Ember.tryInvoke = tryInvoke;\n Ember.tryFinally = tryFinally;\n Ember.wrap = wrap;\n Ember.apply = apply;\n Ember.applyStr = applyStr;\n\n Ember.Logger = Logger;\n\n Ember.get = get;\n Ember.getWithDefault = getWithDefault;\n Ember.normalizeTuple = normalizeTuple;\n Ember._getPath = _getPath;\n\n Ember.EnumerableUtils = EnumerableUtils;\n\n Ember.on = on;\n Ember.addListener = addListener;\n Ember.removeListener = removeListener;\n Ember._suspendListener = suspendListener;\n Ember._suspendListeners = suspendListeners;\n Ember.sendEvent = sendEvent;\n Ember.hasListeners = hasListeners;\n Ember.watchedEvents = watchedEvents;\n Ember.listenersFor = listenersFor;\n Ember.listenersDiff = listenersDiff;\n Ember.listenersUnion = listenersUnion;\n\n Ember._ObserverSet = ObserverSet;\n\n Ember.propertyWillChange = propertyWillChange;\n Ember.propertyDidChange = propertyDidChange;\n Ember.overrideChains = overrideChains;\n Ember.beginPropertyChanges = beginPropertyChanges;\n Ember.endPropertyChanges = endPropertyChanges;\n Ember.changeProperties = changeProperties;\n\n Ember.Descriptor = Descriptor;\n Ember.defineProperty = defineProperty;\n\n Ember.set = set;\n Ember.trySet = trySet;\n\n Ember.OrderedSet = OrderedSet;\n Ember.Map = Map;\n Ember.MapWithDefault = MapWithDefault;\n\n Ember.getProperties = getProperties;\n Ember.setProperties = setProperties;\n\n Ember.watchKey = watchKey;\n Ember.unwatchKey = unwatchKey;\n\n Ember.flushPendingChains = flushPendingChains;\n Ember.removeChainWatcher = removeChainWatcher;\n Ember._ChainNode = ChainNode;\n Ember.finishChains = finishChains;\n\n Ember.watchPath = watchPath;\n Ember.unwatchPath = unwatchPath;\n\n Ember.watch = watch;\n Ember.isWatching = isWatching;\n Ember.unwatch = unwatch;\n Ember.rewatch = rewatch;\n Ember.destroy = destroy;\n\n Ember.expandProperties = expandProperties;\n\n Ember.ComputedProperty = ComputedProperty;\n Ember.computed = computed;\n Ember.cacheFor = cacheFor;\n\n Ember.addObserver = addObserver;\n Ember.observersFor = observersFor;\n Ember.removeObserver = removeObserver;\n Ember.addBeforeObserver = addBeforeObserver;\n Ember._suspendBeforeObserver = _suspendBeforeObserver;\n Ember._suspendBeforeObservers = _suspendBeforeObservers;\n Ember._suspendObserver = _suspendObserver;\n Ember._suspendObservers = _suspendObservers;\n Ember.beforeObserversFor = beforeObserversFor;\n Ember.removeBeforeObserver = removeBeforeObserver;\n\n Ember.IS_BINDING = IS_BINDING;\n Ember.required = required;\n Ember.aliasMethod = aliasMethod;\n Ember.observer = observer;\n Ember.immediateObserver = immediateObserver;\n Ember.beforeObserver = beforeObserver;\n Ember.mixin = mixin;\n Ember.Mixin = Mixin;\n\n Ember.oneWay = oneWay;\n Ember.bind = bind;\n Ember.Binding = Binding;\n Ember.isGlobalPath = isGlobalPath;\n\n Ember.run = run;\n\n Ember.libraries = libraries;\n Ember.libraries.registerCoreLibrary('Ember', Ember.VERSION);\n\n Ember.isNone = isNone;\n Ember.none = none;\n\n Ember.isEmpty = isEmpty;\n Ember.empty = empty;\n\n Ember.isBlank = isBlank;\n\n Ember.merge = merge;\n\n /**\n A function may be assigned to `Ember.onerror` to be called when Ember\n internals encounter an error. This is useful for specialized error handling\n and reporting code.\n\n ```javascript\n Ember.onerror = function(error) {\n Em.$.ajax('/report-error', 'POST', {\n stack: error.stack,\n otherInformation: 'whatever app state you want to provide'\n });\n };\n ```\n\n Internally, `Ember.onerror` is used as Backburner's error handler.\n\n @event onerror\n @for Ember\n @param {Exception} error the error object\n */\n Ember.onerror = null;\n // END EXPORTS\n\n // do this for side-effects of updating Ember.assert, warn, etc when\n // ember-debug is present\n if (Ember.__loader.registry['ember-debug']) {\n requireModule('ember-debug');\n }\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-metal/map\",\n [\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/array\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n\n /*\n JavaScript (before ES6) does not have a Map implementation. Objects,\n which are often used as dictionaries, may only have Strings as keys.\n\n Because Ember has a way to get a unique identifier for every object\n via `Ember.guidFor`, we can implement a performant Map with arbitrary\n keys. Because it is commonly used in low-level bookkeeping, Map is\n implemented as a pure JavaScript object for performance.\n\n This implementation follows the current iteration of the ES6 proposal for\n maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),\n with two exceptions. First, because we need our implementation to be pleasant\n on older browsers, we do not use the `delete` name (using `remove` instead).\n Second, as we do not have the luxury of in-VM iteration, we implement a\n forEach method for iteration.\n\n Map is mocked out to look like an Ember object, so you can do\n `Ember.Map.create()` for symmetry with other Ember classes.\n */\n\n var set = __dependency1__.set;\n var guidFor = __dependency2__.guidFor;\n var indexOf = __dependency3__.indexOf;var create = __dependency4__.create;\n\n var copy = function(obj) {\n var output = {};\n\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) { output[prop] = obj[prop]; }\n }\n\n return output;\n };\n\n var copyMap = function(original, newObject) {\n var keys = original.keys.copy(),\n values = copy(original.values);\n\n newObject.keys = keys;\n newObject.values = values;\n newObject.length = original.length;\n\n return newObject;\n };\n\n /**\n This class is used internally by Ember and Ember Data.\n Please do not use it at this time. We plan to clean it up\n and add many tests soon.\n\n @class OrderedSet\n @namespace Ember\n @constructor\n @private\n */\n function OrderedSet() {\n this.clear();\n };\n\n /**\n @method create\n @static\n @return {Ember.OrderedSet}\n */\n OrderedSet.create = function() {\n return new OrderedSet();\n };\n\n\n OrderedSet.prototype = {\n /**\n @method clear\n */\n clear: function() {\n this.presenceSet = {};\n this.list = [];\n },\n\n /**\n @method add\n @param obj\n */\n add: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n if (guid in presenceSet) { return; }\n\n presenceSet[guid] = true;\n list.push(obj);\n },\n\n /**\n @method remove\n @param obj\n */\n remove: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n delete presenceSet[guid];\n\n var index = indexOf.call(list, obj);\n if (index > -1) {\n list.splice(index, 1);\n }\n },\n\n /**\n @method isEmpty\n @return {Boolean}\n */\n isEmpty: function() {\n return this.list.length === 0;\n },\n\n /**\n @method has\n @param obj\n @return {Boolean}\n */\n has: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet;\n\n return guid in presenceSet;\n },\n\n /**\n @method forEach\n @param {Function} fn\n @param self\n */\n forEach: function(fn, self) {\n // allow mutation during iteration\n var list = this.toArray();\n\n for (var i = 0, j = list.length; i < j; i++) {\n fn.call(self, list[i]);\n }\n },\n\n /**\n @method toArray\n @return {Array}\n */\n toArray: function() {\n return this.list.slice();\n },\n\n /**\n @method copy\n @return {Ember.OrderedSet}\n */\n copy: function() {\n var set = new OrderedSet();\n\n set.presenceSet = copy(this.presenceSet);\n set.list = this.toArray();\n\n return set;\n }\n };\n\n /**\n A Map stores values indexed by keys. Unlike JavaScript's\n default Objects, the keys of a Map can be any JavaScript\n object.\n\n Internally, a Map has two data structures:\n\n 1. `keys`: an OrderedSet of all of the existing keys\n 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)`\n\n When a key/value pair is added for the first time, we\n add the key to the `keys` OrderedSet, and create or\n replace an entry in `values`. When an entry is deleted,\n we delete its entry in `keys` and `values`.\n\n @class Map\n @namespace Ember\n @private\n @constructor\n */\n var Map = Ember.Map = function() {\n this.keys = OrderedSet.create();\n this.values = {};\n };\n\n /**\n @method create\n @static\n */\n Map.create = function() {\n return new Map();\n };\n\n Map.prototype = {\n /**\n This property will change as the number of objects in the map changes.\n\n @property length\n @type number\n @default 0\n */\n length: 0,\n\n\n /**\n Retrieve the value associated with a given key.\n\n @method get\n @param {*} key\n @return {*} the value associated with the key, or `undefined`\n */\n get: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values[guid];\n },\n\n /**\n Adds a value to the map. If a value for the given key has already been\n provided, the new value will replace the old value.\n\n @method set\n @param {*} key\n @param {*} value\n */\n set: function(key, value) {\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n keys.add(key);\n values[guid] = value;\n set(this, 'length', keys.list.length);\n },\n\n /**\n Removes a value from the map for an associated key.\n\n @method remove\n @param {*} key\n @return {Boolean} true if an item was removed, false otherwise\n */\n remove: function(key) {\n // don't use ES6 \"delete\" because it will be annoying\n // to use in browsers that are not ES6 friendly;\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n if (values.hasOwnProperty(guid)) {\n keys.remove(key);\n delete values[guid];\n set(this, 'length', keys.list.length);\n return true;\n } else {\n return false;\n }\n },\n\n /**\n Check whether a key is present.\n\n @method has\n @param {*} key\n @return {Boolean} true if the item was present, false otherwise\n */\n has: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values.hasOwnProperty(guid);\n },\n\n /**\n Iterate over all the keys and values. Calls the function once\n for each key, passing in the key and value, in that order.\n\n The keys are guaranteed to be iterated over in insertion order.\n\n @method forEach\n @param {Function} callback\n @param {*} self if passed, the `this` value inside the\n callback. By default, `this` is the map.\n */\n forEach: function(callback, self) {\n var keys = this.keys,\n values = this.values;\n\n keys.forEach(function(key) {\n var guid = guidFor(key);\n callback.call(self, key, values[guid]);\n });\n },\n\n /**\n @method copy\n @return {Ember.Map}\n */\n copy: function() {\n return copyMap(this, new Map());\n }\n };\n\n /**\n @class MapWithDefault\n @namespace Ember\n @extends Ember.Map\n @private\n @constructor\n @param [options]\n @param {*} [options.defaultValue]\n */\n function MapWithDefault(options) {\n Map.call(this);\n this.defaultValue = options.defaultValue;\n };\n\n /**\n @method create\n @static\n @param [options]\n @param {*} [options.defaultValue]\n @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns\n `Ember.MapWithDefault` otherwise returns `Ember.Map`\n */\n MapWithDefault.create = function(options) {\n if (options) {\n return new MapWithDefault(options);\n } else {\n return new Map();\n }\n };\n\n MapWithDefault.prototype = create(Map.prototype);\n\n /**\n Retrieve the value associated with a given key.\n\n @method get\n @param {*} key\n @return {*} the value associated with the key, or the default value\n */\n MapWithDefault.prototype.get = function(key) {\n var hasValue = this.has(key);\n\n if (hasValue) {\n return Map.prototype.get.call(this, key);\n } else {\n var defaultValue = this.defaultValue(key);\n this.set(key, defaultValue);\n return defaultValue;\n }\n };\n\n /**\n @method copy\n @return {Ember.MapWithDefault}\n */\n MapWithDefault.prototype.copy = function() {\n return copyMap(this, new MapWithDefault({\n defaultValue: this.defaultValue\n }));\n };\n\n __exports__.OrderedSet = OrderedSet;\n __exports__.Map = Map;\n __exports__.MapWithDefault = MapWithDefault;\n });\ndefine(\"ember-metal/merge\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n Merge the contents of two objects together into the first object.\n\n ```javascript\n Ember.merge({first: 'Tom'}, {last: 'Dale'}); // {first: 'Tom', last: 'Dale'}\n var a = {first: 'Yehuda'}, b = {last: 'Katz'};\n Ember.merge(a, b); // a == {first: 'Yehuda', last: 'Katz'}, b == {last: 'Katz'}\n ```\n\n @method merge\n @for Ember\n @param {Object} original The object to merge into\n @param {Object} updates The object to copy properties from\n @return {Object}\n */\n function merge(original, updates) {\n for (var prop in updates) {\n if (!updates.hasOwnProperty(prop)) { continue; }\n original[prop] = updates[prop];\n }\n return original;\n };\n\n __exports__[\"default\"] = merge;\n });\ndefine(\"ember-metal/mixin\",\n [\"ember-metal/core\",\"ember-metal/merge\",\"ember-metal/array\",\"ember-metal/platform\",\"ember-metal/utils\",\"ember-metal/expand_properties\",\"ember-metal/properties\",\"ember-metal/computed\",\"ember-metal/binding\",\"ember-metal/observer\",\"ember-metal/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-metal\n */\n\n var Ember = __dependency1__[\"default\"];\n // warn, assert, wrap, et;\n var merge = __dependency2__[\"default\"];\n var map = __dependency3__.map;\n var indexOf = __dependency3__.indexOf;\n var forEach = __dependency3__.forEach;\n var create = __dependency4__.create;\n var guidFor = __dependency5__.guidFor;\n var meta = __dependency5__.meta;\n var META_KEY = __dependency5__.META_KEY;\n var wrap = __dependency5__.wrap;\n var makeArray = __dependency5__.makeArray;\n var apply = __dependency5__.apply;\n var expandProperties = __dependency6__[\"default\"];\n var Descriptor = __dependency7__.Descriptor;\n var defineProperty = __dependency7__.defineProperty;\n var ComputedProperty = __dependency8__.ComputedProperty;\n var Binding = __dependency9__.Binding;\n var addObserver = __dependency10__.addObserver;\n var removeObserver = __dependency10__.removeObserver;\n var addBeforeObserver = __dependency10__.addBeforeObserver;\n var removeBeforeObserver = __dependency10__.removeBeforeObserver;\n var addListener = __dependency11__.addListener;\n var removeListener = __dependency11__.removeListener;\n\n var REQUIRED, Alias,\n a_map = map,\n a_indexOf = indexOf,\n a_forEach = forEach,\n a_slice = [].slice,\n o_create = create,\n defineProperty = defineProperty,\n metaFor = meta;\n\n function superFunction(){\n var ret, func = this.__nextSuper;\n if (func) {\n this.__nextSuper = null;\n ret = apply(this, func, arguments);\n this.__nextSuper = func;\n }\n return ret;\n }\n\n function mixinsMeta(obj) {\n var m = metaFor(obj, true), ret = m.mixins;\n if (!ret) {\n ret = m.mixins = {};\n } else if (!m.hasOwnProperty('mixins')) {\n ret = m.mixins = o_create(ret);\n }\n return ret;\n }\n\n function initMixin(mixin, args) {\n if (args && args.length > 0) {\n mixin.mixins = a_map.call(args, function(x) {\n if (x instanceof Mixin) { return x; }\n\n // Note: Manually setup a primitive mixin here. This is the only\n // way to actually get a primitive mixin. This way normal creation\n // of mixins will give you combined mixins...\n var mixin = new Mixin();\n mixin.properties = x;\n return mixin;\n });\n }\n return mixin;\n }\n\n function isMethod(obj) {\n return 'function' === typeof obj &&\n obj.isMethod !== false &&\n obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;\n }\n\n var CONTINUE = {};\n\n function mixinProperties(mixinsMeta, mixin) {\n var guid;\n\n if (mixin instanceof Mixin) {\n guid = guidFor(mixin);\n if (mixinsMeta[guid]) { return CONTINUE; }\n mixinsMeta[guid] = mixin;\n return mixin.properties;\n } else {\n return mixin; // apply anonymous mixin properties\n }\n }\n\n function concatenatedMixinProperties(concatProp, props, values, base) {\n var concats;\n\n // reset before adding each new mixin to pickup concats from previous\n concats = values[concatProp] || base[concatProp];\n if (props[concatProp]) {\n concats = concats ? concats.concat(props[concatProp]) : props[concatProp];\n }\n\n return concats;\n }\n\n function giveDescriptorSuper(meta, key, property, values, descs) {\n var superProperty;\n\n // Computed properties override methods, and do not call super to them\n if (values[key] === undefined) {\n // Find the original descriptor in a parent mixin\n superProperty = descs[key];\n }\n\n // If we didn't find the original descriptor in a parent mixin, find\n // it on the original object.\n superProperty = superProperty || meta.descs[key];\n\n if (!superProperty || !(superProperty instanceof ComputedProperty)) {\n return property;\n }\n\n // Since multiple mixins may inherit from the same parent, we need\n // to clone the computed property so that other mixins do not receive\n // the wrapped version.\n property = o_create(property);\n property.func = wrap(property.func, superProperty.func);\n\n return property;\n }\n\n function giveMethodSuper(obj, key, method, values, descs) {\n var superMethod;\n\n // Methods overwrite computed properties, and do not call super to them.\n if (descs[key] === undefined) {\n // Find the original method in a parent mixin\n superMethod = values[key];\n }\n\n // If we didn't find the original value in a parent mixin, find it in\n // the original object\n superMethod = superMethod || obj[key];\n\n // Only wrap the new method if the original method was a function\n if ('function' !== typeof superMethod) {\n return method;\n }\n\n return wrap(method, superMethod);\n }\n\n function applyConcatenatedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n return baseValue.concat(value);\n } else {\n return makeArray(baseValue).concat(value);\n }\n } else {\n return makeArray(value);\n }\n }\n\n function applyMergedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (!baseValue) { return value; }\n\n var newBase = merge({}, baseValue),\n hasFunction = false;\n\n for (var prop in value) {\n if (!value.hasOwnProperty(prop)) { continue; }\n\n var propValue = value[prop];\n if (isMethod(propValue)) {\n // TODO: support for Computed Properties, etc?\n hasFunction = true;\n newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {});\n } else {\n newBase[prop] = propValue;\n }\n }\n\n if (hasFunction) {\n newBase._super = superFunction;\n }\n\n return newBase;\n }\n\n function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) {\n if (value instanceof Descriptor) {\n if (value === REQUIRED && descs[key]) { return CONTINUE; }\n\n // Wrap descriptor function to implement\n // __nextSuper() if needed\n if (value.func) {\n value = giveDescriptorSuper(meta, key, value, values, descs);\n }\n\n descs[key] = value;\n values[key] = undefined;\n } else {\n if ((concats && a_indexOf.call(concats, key) >= 0) ||\n key === 'concatenatedProperties' ||\n key === 'mergedProperties') {\n value = applyConcatenatedProperties(base, key, value, values);\n } else if ((mergings && a_indexOf.call(mergings, key) >= 0)) {\n value = applyMergedProperties(base, key, value, values);\n } else if (isMethod(value)) {\n value = giveMethodSuper(base, key, value, values, descs);\n }\n\n descs[key] = undefined;\n values[key] = value;\n }\n }\n\n function mergeMixins(mixins, m, descs, values, base, keys) {\n var mixin, props, key, concats, mergings, meta;\n\n function removeKeys(keyName) {\n delete descs[keyName];\n delete values[keyName];\n }\n\n for(var i=0, l=mixins.length; i<l; i++) {\n mixin = mixins[i];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin),\n typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n props = mixinProperties(m, mixin);\n if (props === CONTINUE) { continue; }\n\n if (props) {\n meta = metaFor(base);\n if (base.willMergeMixin) { base.willMergeMixin(props); }\n concats = concatenatedMixinProperties('concatenatedProperties', props, values, base);\n mergings = concatenatedMixinProperties('mergedProperties', props, values, base);\n\n for (key in props) {\n if (!props.hasOwnProperty(key)) { continue; }\n keys.push(key);\n addNormalizedProperty(base, key, props[key], meta, descs, values, concats, mergings);\n }\n\n // manually copy toString() because some JS engines do not enumerate it\n if (props.hasOwnProperty('toString')) { base.toString = props.toString; }\n } else if (mixin.mixins) {\n mergeMixins(mixin.mixins, m, descs, values, base, keys);\n if (mixin._without) { a_forEach.call(mixin._without, removeKeys); }\n }\n }\n }\n\n var IS_BINDING = /^.+Binding$/;\n\n function detectBinding(obj, key, value, m) {\n if (IS_BINDING.test(key)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[key] = value;\n }\n }\n\n function connectBindings(obj, m) {\n // TODO Mixin.apply(instance) should disconnect binding if exists\n var bindings = m.bindings, key, binding, to;\n if (bindings) {\n for (key in bindings) {\n binding = bindings[key];\n if (binding) {\n to = key.slice(0, -7); // strip Binding off end\n if (binding instanceof Binding) {\n binding = binding.copy(); // copy prototypes' instance\n binding.to(to);\n } else { // binding is string path\n binding = new Binding(to, binding);\n }\n binding.connect(obj);\n obj[key] = binding;\n }\n }\n // mark as applied\n m.bindings = {};\n }\n }\n\n function finishPartial(obj, m) {\n connectBindings(obj, m || metaFor(obj));\n return obj;\n }\n\n function followAlias(obj, desc, m, descs, values) {\n var altKey = desc.methodName, value;\n if (descs[altKey] || values[altKey]) {\n value = values[altKey];\n desc = descs[altKey];\n } else if (m.descs[altKey]) {\n desc = m.descs[altKey];\n value = undefined;\n } else {\n desc = undefined;\n value = obj[altKey];\n }\n\n return { desc: desc, value: value };\n }\n\n function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) {\n var paths = observerOrListener[pathsKey];\n\n if (paths) {\n for (var i=0, l=paths.length; i<l; i++) {\n updateMethod(obj, paths[i], null, key);\n }\n }\n }\n\n function replaceObserversAndListeners(obj, key, observerOrListener) {\n var prev = obj[key];\n\n if ('function' === typeof prev) {\n updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', removeBeforeObserver);\n updateObserversAndListeners(obj, key, prev, '__ember_observes__', removeObserver);\n updateObserversAndListeners(obj, key, prev, '__ember_listens__', removeListener);\n }\n\n if ('function' === typeof observerOrListener) {\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', addBeforeObserver);\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', addObserver);\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', addListener);\n }\n }\n\n function applyMixin(obj, mixins, partial) {\n var descs = {}, values = {}, m = metaFor(obj),\n key, value, desc, keys = [];\n\n obj._super = superFunction;\n\n // Go through all mixins and hashes passed in, and:\n //\n // * Handle concatenated properties\n // * Handle merged properties\n // * Set up _super wrapping if necessary\n // * Set up computed property descriptors\n // * Copying `toString` in broken browsers\n mergeMixins(mixins, mixinsMeta(obj), descs, values, obj, keys);\n\n for(var i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n if (key === 'constructor' || !values.hasOwnProperty(key)) { continue; }\n\n desc = descs[key];\n value = values[key];\n\n if (desc === REQUIRED) { continue; }\n\n while (desc && desc instanceof Alias) {\n var followed = followAlias(obj, desc, m, descs, values);\n desc = followed.desc;\n value = followed.value;\n }\n\n if (desc === undefined && value === undefined) { continue; }\n\n replaceObserversAndListeners(obj, key, value);\n detectBinding(obj, key, value, m);\n defineProperty(obj, key, desc, value, m);\n }\n\n if (!partial) { // don't apply to prototype\n finishPartial(obj, m);\n }\n\n return obj;\n }\n\n /**\n @method mixin\n @for Ember\n @param obj\n @param mixins*\n @return obj\n */\n function mixin(obj) {\n var args = a_slice.call(arguments, 1);\n applyMixin(obj, args, false);\n return obj;\n };\n\n /**\n The `Ember.Mixin` class allows you to create mixins, whose properties can be\n added to other classes. For instance,\n\n ```javascript\n App.Editable = Ember.Mixin.create({\n edit: function() {\n console.log('starting to edit');\n this.set('isEditing', true);\n },\n isEditing: false\n });\n\n // Mix mixins into classes by passing them as the first arguments to\n // .extend.\n App.CommentView = Ember.View.extend(App.Editable, {\n template: Ember.Handlebars.compile('{{#if view.isEditing}}...{{else}}...{{/if}}')\n });\n\n commentView = App.CommentView.create();\n commentView.edit(); // outputs 'starting to edit'\n ```\n\n Note that Mixins are created with `Ember.Mixin.create`, not\n `Ember.Mixin.extend`.\n\n Note that mixins extend a constructor's prototype so arrays and object literals\n defined as properties will be shared amongst objects that implement the mixin.\n If you want to define a property in a mixin that is not shared, you can define\n it either as a computed property or have it be created on initialization of the object.\n\n ```javascript\n //filters array will be shared amongst any object implementing mixin\n App.Filterable = Ember.Mixin.create({\n filters: Ember.A()\n });\n\n //filters will be a separate array for every object implementing the mixin\n App.Filterable = Ember.Mixin.create({\n filters: Ember.computed(function(){return Ember.A();})\n });\n\n //filters will be created as a separate array during the object's initialization\n App.Filterable = Ember.Mixin.create({\n init: function() {\n this._super();\n this.set(\"filters\", Ember.A());\n }\n });\n ```\n\n @class Mixin\n @namespace Ember\n */\n function Mixin() { return initMixin(this, arguments); };\n\n Mixin.prototype = {\n properties: null,\n mixins: null,\n ownerConstructor: null\n };\n\n Mixin._apply = applyMixin;\n\n Mixin.applyPartial = function(obj) {\n var args = a_slice.call(arguments, 1);\n return applyMixin(obj, args, true);\n };\n\n Mixin.finishPartial = finishPartial;\n\n // ES6TODO: this relies on a global state?\n Ember.anyUnprocessedMixins = false;\n\n /**\n @method create\n @static\n @param arguments*\n */\n Mixin.create = function() {\n // ES6TODO: this relies on a global state?\n Ember.anyUnprocessedMixins = true;\n var M = this;\n return initMixin(new M(), arguments);\n };\n\n var MixinPrototype = Mixin.prototype;\n\n /**\n @method reopen\n @param arguments*\n */\n MixinPrototype.reopen = function() {\n var mixin, tmp;\n\n if (this.properties) {\n mixin = Mixin.create();\n mixin.properties = this.properties;\n delete this.properties;\n this.mixins = [mixin];\n } else if (!this.mixins) {\n this.mixins = [];\n }\n\n var len = arguments.length, mixins = this.mixins, idx;\n\n for(idx=0; idx < len; idx++) {\n mixin = arguments[idx];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin),\n typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n if (mixin instanceof Mixin) {\n mixins.push(mixin);\n } else {\n tmp = Mixin.create();\n tmp.properties = mixin;\n mixins.push(tmp);\n }\n }\n\n return this;\n };\n\n /**\n @method apply\n @param obj\n @return applied object\n */\n MixinPrototype.apply = function(obj) {\n return applyMixin(obj, [this], false);\n };\n\n MixinPrototype.applyPartial = function(obj) {\n return applyMixin(obj, [this], true);\n };\n\n function _detect(curMixin, targetMixin, seen) {\n var guid = guidFor(curMixin);\n\n if (seen[guid]) { return false; }\n seen[guid] = true;\n\n if (curMixin === targetMixin) { return true; }\n var mixins = curMixin.mixins, loc = mixins ? mixins.length : 0;\n while (--loc >= 0) {\n if (_detect(mixins[loc], targetMixin, seen)) { return true; }\n }\n return false;\n }\n\n /**\n @method detect\n @param obj\n @return {Boolean}\n */\n MixinPrototype.detect = function(obj) {\n if (!obj) { return false; }\n if (obj instanceof Mixin) { return _detect(obj, this, {}); }\n var m = obj[META_KEY],\n mixins = m && m.mixins;\n if (mixins) {\n return !!mixins[guidFor(this)];\n }\n return false;\n };\n\n MixinPrototype.without = function() {\n var ret = new Mixin(this);\n ret._without = a_slice.call(arguments);\n return ret;\n };\n\n function _keys(ret, mixin, seen) {\n if (seen[guidFor(mixin)]) { return; }\n seen[guidFor(mixin)] = true;\n\n if (mixin.properties) {\n var props = mixin.properties;\n for (var key in props) {\n if (props.hasOwnProperty(key)) { ret[key] = true; }\n }\n } else if (mixin.mixins) {\n a_forEach.call(mixin.mixins, function(x) { _keys(ret, x, seen); });\n }\n }\n\n MixinPrototype.keys = function() {\n var keys = {}, seen = {}, ret = [];\n _keys(keys, this, seen);\n for(var key in keys) {\n if (keys.hasOwnProperty(key)) { ret.push(key); }\n }\n return ret;\n };\n\n // returns the mixins currently applied to the specified object\n // TODO: Make Ember.mixin\n Mixin.mixins = function(obj) {\n var m = obj[META_KEY],\n mixins = m && m.mixins, ret = [];\n\n if (!mixins) { return ret; }\n\n for (var key in mixins) {\n var mixin = mixins[key];\n\n // skip primitive mixins since these are always anonymous\n if (!mixin.properties) { ret.push(mixin); }\n }\n\n return ret;\n };\n\n REQUIRED = new Descriptor();\n REQUIRED.toString = function() { return '(Required Property)'; };\n\n /**\n Denotes a required property for a mixin\n\n @method required\n @for Ember\n */\n function required() {\n return REQUIRED;\n };\n\n Alias = function(methodName) {\n this.methodName = methodName;\n };\n Alias.prototype = new Descriptor();\n\n /**\n Makes a method available via an additional name.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name: function() {\n return 'Tomhuda Katzdale';\n },\n moniker: Ember.aliasMethod('name')\n });\n\n var goodGuy = App.Person.create();\n \n goodGuy.name(); // 'Tomhuda Katzdale'\n goodGuy.moniker(); // 'Tomhuda Katzdale'\n ```\n\n @method aliasMethod\n @for Ember\n @param {String} methodName name of the method to alias\n @return {Ember.Descriptor}\n */\n function aliasMethod(methodName) {\n return new Alias(methodName);\n };\n\n // ..........................................................\n // OBSERVER HELPER\n //\n\n /**\n Specify a method that observes property changes.\n\n ```javascript\n Ember.Object.extend({\n valueObserver: Ember.observer('value', function() {\n // Executes whenever the \"value\" property changes\n })\n });\n ```\n\n In the future this method may become asynchronous. If you want to ensure\n synchronous behavior, use `immediateObserver`.\n\n Also available as `Function.prototype.observes` if prototype extensions are\n enabled.\n\n @method observer\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n */\n function observer() {\n var func = a_slice.call(arguments, -1)[0];\n var paths;\n\n var addWatchedProperty = function (path) { paths.push(path); };\n var _paths = a_slice.call(arguments, 0, -1);\n\n if (typeof func !== \"function\") {\n // revert to old, soft-deprecated argument ordering\n\n func = arguments[0];\n _paths = a_slice.call(arguments, 1);\n }\n\n paths = [];\n\n for (var i=0; i<_paths.length; ++i) {\n expandProperties(_paths[i], addWatchedProperty);\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Ember.observer called without a function\");\n }\n\n func.__ember_observes__ = paths;\n return func;\n };\n\n /**\n Specify a method that observes property changes.\n\n ```javascript\n Ember.Object.extend({\n valueObserver: Ember.immediateObserver('value', function() {\n // Executes whenever the \"value\" property changes\n })\n });\n ```\n\n In the future, `Ember.observer` may become asynchronous. In this event,\n `Ember.immediateObserver` will maintain the synchronous behavior.\n\n Also available as `Function.prototype.observesImmediately` if prototype extensions are\n enabled.\n\n @method immediateObserver\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n */\n function immediateObserver() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", typeof arg !== \"string\" || arg.indexOf('.') === -1);\n }\n\n return observer.apply(this, arguments);\n };\n\n /**\n When observers fire, they are called with the arguments `obj`, `keyName`.\n\n Note, `@each.property` observer is called per each add or replace of an element\n and it's not called with a specific enumeration item.\n\n A `beforeObserver` fires before a property changes.\n\n A `beforeObserver` is an alternative form of `.observesBefore()`.\n\n ```javascript\n App.PersonView = Ember.View.extend({\n friends: [{ name: 'Tom' }, { name: 'Stefan' }, { name: 'Kris' }],\n\n valueWillChange: Ember.beforeObserver('content.value', function(obj, keyName) {\n this.changingFrom = obj.get(keyName);\n }),\n\n valueDidChange: Ember.observer('content.value', function(obj, keyName) {\n // only run if updating a value already in the DOM\n if (this.get('state') === 'inDOM') {\n var color = obj.get(keyName) > this.changingFrom ? 'green' : 'red';\n // logic\n }\n }),\n\n friendsDidChange: Ember.observer('friends.@each.name', function(obj, keyName) {\n // some logic\n // obj.get(keyName) returns friends array\n })\n });\n ```\n\n Also available as `Function.prototype.observesBefore` if prototype extensions are\n enabled.\n\n @method beforeObserver\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n */\n function beforeObserver() {\n var func = a_slice.call(arguments, -1)[0];\n var paths;\n\n var addWatchedProperty = function(path) { paths.push(path); };\n\n var _paths = a_slice.call(arguments, 0, -1);\n\n if (typeof func !== \"function\") {\n // revert to old, soft-deprecated argument ordering\n\n func = arguments[0];\n _paths = a_slice.call(arguments, 1);\n }\n\n paths = [];\n\n for (var i=0; i<_paths.length; ++i) {\n expandProperties(_paths[i], addWatchedProperty);\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Ember.beforeObserver called without a function\");\n }\n\n func.__ember_observesBefore__ = paths;\n return func;\n };\n\n __exports__.IS_BINDING = IS_BINDING;\n __exports__.mixin = mixin;\n __exports__.Mixin = Mixin;\n __exports__.required = required;\n __exports__.aliasMethod = aliasMethod;\n __exports__.observer = observer;\n __exports__.immediateObserver = immediateObserver;\n __exports__.beforeObserver = beforeObserver;\n });\ndefine(\"ember-metal/observer\",\n [\"ember-metal/watching\",\"ember-metal/array\",\"ember-metal/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var watch = __dependency1__.watch;\n var unwatch = __dependency1__.unwatch;\n var map = __dependency2__.map;\n var listenersFor = __dependency3__.listenersFor;\n var addListener = __dependency3__.addListener;\n var removeListener = __dependency3__.removeListener;\n var suspendListeners = __dependency3__.suspendListeners;\n var suspendListener = __dependency3__.suspendListener;\n /**\n @module ember-metal\n */\n\n var AFTER_OBSERVERS = ':change',\n BEFORE_OBSERVERS = ':before';\n\n function changeEvent(keyName) {\n return keyName+AFTER_OBSERVERS;\n }\n\n function beforeEvent(keyName) {\n return keyName+BEFORE_OBSERVERS;\n }\n\n /**\n @method addObserver\n @for Ember\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n */\n function addObserver(obj, _path, target, method) {\n addListener(obj, changeEvent(_path), target, method);\n watch(obj, _path);\n\n return this;\n };\n\n function observersFor(obj, path) {\n return listenersFor(obj, changeEvent(path));\n };\n\n /**\n @method removeObserver\n @for Ember\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n */\n function removeObserver(obj, _path, target, method) {\n unwatch(obj, _path);\n removeListener(obj, changeEvent(_path), target, method);\n\n return this;\n };\n\n /**\n @method addBeforeObserver\n @for Ember\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n */\n function addBeforeObserver(obj, _path, target, method) {\n addListener(obj, beforeEvent(_path), target, method);\n watch(obj, _path);\n\n return this;\n };\n\n // Suspend observer during callback.\n //\n // This should only be used by the target of the observer\n // while it is setting the observed path.\n function _suspendBeforeObserver(obj, path, target, method, callback) {\n return suspendListener(obj, beforeEvent(path), target, method, callback);\n };\n\n function _suspendObserver(obj, path, target, method, callback) {\n return suspendListener(obj, changeEvent(path), target, method, callback);\n };\n\n function _suspendBeforeObservers(obj, paths, target, method, callback) {\n var events = map.call(paths, beforeEvent);\n return suspendListeners(obj, events, target, method, callback);\n };\n\n function _suspendObservers(obj, paths, target, method, callback) {\n var events = map.call(paths, changeEvent);\n return suspendListeners(obj, events, target, method, callback);\n };\n\n function beforeObserversFor(obj, path) {\n return listenersFor(obj, beforeEvent(path));\n };\n\n /**\n @method removeBeforeObserver\n @for Ember\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n */\n function removeBeforeObserver(obj, _path, target, method) {\n unwatch(obj, _path);\n removeListener(obj, beforeEvent(_path), target, method);\n\n return this;\n };\n\n __exports__.addObserver = addObserver;\n __exports__.observersFor = observersFor;\n __exports__.removeObserver = removeObserver;\n __exports__.addBeforeObserver = addBeforeObserver;\n __exports__._suspendBeforeObserver = _suspendBeforeObserver;\n __exports__._suspendObserver = _suspendObserver;\n __exports__._suspendBeforeObservers = _suspendBeforeObservers;\n __exports__._suspendObservers = _suspendObservers;\n __exports__.beforeObserversFor = beforeObserversFor;\n __exports__.removeBeforeObserver = removeBeforeObserver;\n });\ndefine(\"ember-metal/observer_set\",\n [\"ember-metal/utils\",\"ember-metal/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var guidFor = __dependency1__.guidFor;\n var sendEvent = __dependency2__.sendEvent;\n\n /*\n this.observerSet = {\n [senderGuid]: { // variable name: `keySet`\n [keyName]: listIndex\n }\n },\n this.observers = [\n {\n sender: obj,\n keyName: keyName,\n eventName: eventName,\n listeners: [\n [target, method, flags]\n ]\n },\n ...\n ]\n */\n function ObserverSet() {\n this.clear();\n };\n\n ObserverSet.prototype.add = function(sender, keyName, eventName) {\n var observerSet = this.observerSet,\n observers = this.observers,\n senderGuid = guidFor(sender),\n keySet = observerSet[senderGuid],\n index;\n\n if (!keySet) {\n observerSet[senderGuid] = keySet = {};\n }\n index = keySet[keyName];\n if (index === undefined) {\n index = observers.push({\n sender: sender,\n keyName: keyName,\n eventName: eventName,\n listeners: []\n }) - 1;\n keySet[keyName] = index;\n }\n return observers[index].listeners;\n };\n\n ObserverSet.prototype.flush = function() {\n var observers = this.observers, i, len, observer, sender;\n this.clear();\n for (i=0, len=observers.length; i < len; ++i) {\n observer = observers[i];\n sender = observer.sender;\n if (sender.isDestroying || sender.isDestroyed) { continue; }\n sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners);\n }\n };\n\n ObserverSet.prototype.clear = function() {\n this.observerSet = {};\n this.observers = [];\n };\n\n __exports__[\"default\"] = ObserverSet;\n });\ndefine(\"ember-metal/platform\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n /*globals Node */\n\n var Ember = __dependency1__[\"default\"];\n\n /**\n @module ember-metal\n */\n\n /**\n Platform specific methods and feature detectors needed by the framework.\n\n @class platform\n @namespace Ember\n @static\n */\n // TODO remove this\n var platform = {};\n\n /**\n Identical to `Object.create()`. Implements if not available natively.\n\n @method create\n @for Ember\n */\n var create = Object.create;\n\n // IE8 has Object.create but it couldn't treat property descriptors.\n if (create) {\n if (create({a: 1}, {a: {value: 2}}).a !== 2) {\n create = null;\n }\n }\n\n // STUB_OBJECT_CREATE allows us to override other libraries that stub\n // Object.create different than we would prefer\n if (!create || Ember.ENV.STUB_OBJECT_CREATE) {\n var K = function() {};\n\n create = function(obj, props) {\n K.prototype = obj;\n obj = new K();\n if (props) {\n K.prototype = obj;\n for (var prop in props) {\n K.prototype[prop] = props[prop].value;\n }\n obj = new K();\n }\n K.prototype = null;\n\n return obj;\n };\n\n create.isSimulated = true;\n }\n\n var defineProperty = Object.defineProperty;\n var canRedefineProperties, canDefinePropertyOnDOM;\n\n // Catch IE8 where Object.defineProperty exists but only works on DOM elements\n if (defineProperty) {\n try {\n defineProperty({}, 'a',{get:function() {}});\n } catch (e) {\n defineProperty = null;\n }\n }\n\n if (defineProperty) {\n // Detects a bug in Android <3.2 where you cannot redefine a property using\n // Object.defineProperty once accessors have already been set.\n canRedefineProperties = (function() {\n var obj = {};\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n get: function() { },\n set: function() { }\n });\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: true\n });\n\n return obj.a === true;\n })();\n\n // This is for Safari 5.0, which supports Object.defineProperty, but not\n // on DOM nodes.\n canDefinePropertyOnDOM = (function() {\n try {\n defineProperty(document.createElement('div'), 'definePropertyOnDOM', {});\n return true;\n } catch(e) { }\n\n return false;\n })();\n\n if (!canRedefineProperties) {\n defineProperty = null;\n } else if (!canDefinePropertyOnDOM) {\n defineProperty = function(obj, keyName, desc) {\n var isNode;\n\n if (typeof Node === \"object\") {\n isNode = obj instanceof Node;\n } else {\n isNode = typeof obj === \"object\" && typeof obj.nodeType === \"number\" && typeof obj.nodeName === \"string\";\n }\n\n if (isNode) {\n // TODO: Should we have a warning here?\n return (obj[keyName] = desc.value);\n } else {\n return Object.defineProperty(obj, keyName, desc);\n }\n };\n }\n }\n\n /**\n @class platform\n @namespace Ember\n */\n\n /**\n Identical to `Object.defineProperty()`. Implements as much functionality\n as possible if not available natively.\n\n @method defineProperty\n @param {Object} obj The object to modify\n @param {String} keyName property name to modify\n @param {Object} desc descriptor hash\n @return {void}\n */\n platform.defineProperty = defineProperty;\n\n /**\n Set to true if the platform supports native getters and setters.\n\n @property hasPropertyAccessors\n @final\n */\n platform.hasPropertyAccessors = true;\n\n if (!platform.defineProperty) {\n platform.hasPropertyAccessors = false;\n\n platform.defineProperty = function(obj, keyName, desc) {\n if (!desc.get) { obj[keyName] = desc.value; }\n };\n\n platform.defineProperty.isSimulated = true;\n }\n\n if (Ember.ENV.MANDATORY_SETTER && !platform.hasPropertyAccessors) {\n Ember.ENV.MANDATORY_SETTER = false;\n }\n\n __exports__.create = create;\n __exports__.platform = platform;\n });\ndefine(\"ember-metal/properties\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/platform\",\"ember-metal/property_events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n\n var Ember = __dependency1__[\"default\"];\n var META_KEY = __dependency2__.META_KEY;\n var meta = __dependency2__.meta;\n var platform = __dependency3__.platform;\n var overrideChains = __dependency4__.overrideChains;\n var metaFor = meta,\n objectDefineProperty = platform.defineProperty;\n\n var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n // ..........................................................\n // DESCRIPTOR\n //\n\n /**\n Objects of this type can implement an interface to respond to requests to\n get and set. The default implementation handles simple properties.\n\n You generally won't need to create or subclass this directly.\n\n @class Descriptor\n @namespace Ember\n @private\n @constructor\n */\n function Descriptor() {};\n\n // ..........................................................\n // DEFINING PROPERTIES API\n //\n\n var MANDATORY_SETTER_FUNCTION = Ember.MANDATORY_SETTER_FUNCTION = function(value) {\n Ember.assert(\"You must use Ember.set() to access this property (of \" + this + \")\", false);\n };\n\n var DEFAULT_GETTER_FUNCTION = Ember.DEFAULT_GETTER_FUNCTION = function(name) {\n return function() {\n var meta = this[META_KEY];\n return meta && meta.values[name];\n };\n };\n\n /**\n NOTE: This is a low-level method used by other parts of the API. You almost\n never want to call this method directly. Instead you should use\n `Ember.mixin()` to define new properties.\n\n Defines a property on an object. This method works much like the ES5\n `Object.defineProperty()` method except that it can also accept computed\n properties and other special descriptors.\n\n Normally this method takes only three parameters. However if you pass an\n instance of `Ember.Descriptor` as the third param then you can pass an\n optional value as the fourth parameter. This is often more efficient than\n creating new descriptor hashes for each property.\n\n ## Examples\n\n ```javascript\n // ES5 compatible mode\n Ember.defineProperty(contact, 'firstName', {\n writable: true,\n configurable: false,\n enumerable: true,\n value: 'Charles'\n });\n\n // define a simple property\n Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');\n\n // define a computed property\n Ember.defineProperty(contact, 'fullName', Ember.computed(function() {\n return this.firstName+' '+this.lastName;\n }).property('firstName', 'lastName'));\n ```\n\n @private\n @method defineProperty\n @for Ember\n @param {Object} obj the object to define this property on. This may be a prototype.\n @param {String} keyName the name of the property\n @param {Ember.Descriptor} [desc] an instance of `Ember.Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.\n @param {*} [data] something other than a descriptor, that will\n become the explicit value of this property.\n */\n function defineProperty(obj, keyName, desc, data, meta) {\n var descs, existingDesc, watching, value;\n\n if (!meta) meta = metaFor(obj);\n descs = meta.descs;\n existingDesc = meta.descs[keyName];\n watching = meta.watching[keyName] > 0;\n\n if (existingDesc instanceof Descriptor) {\n existingDesc.teardown(obj, keyName);\n }\n\n if (desc instanceof Descriptor) {\n value = desc;\n\n descs[keyName] = desc;\n if (MANDATORY_SETTER && watching) {\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: undefined // make enumerable\n });\n } else {\n obj[keyName] = undefined; // make enumerable\n }\n } else {\n descs[keyName] = undefined; // shadow descriptor in proto\n if (desc == null) {\n value = data;\n\n if (MANDATORY_SETTER && watching) {\n meta.values[keyName] = data;\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: MANDATORY_SETTER_FUNCTION,\n get: DEFAULT_GETTER_FUNCTION(keyName)\n });\n } else {\n obj[keyName] = data;\n }\n } else {\n value = desc;\n\n // compatibility with ES5\n objectDefineProperty(obj, keyName, desc);\n }\n }\n\n // if key is being watched, override chains that\n // were initialized with the prototype\n if (watching) { overrideChains(obj, keyName, meta); }\n\n // The `value` passed to the `didDefineProperty` hook is\n // either the descriptor or data, whichever was passed.\n if (obj.didDefineProperty) { obj.didDefineProperty(obj, keyName, value); }\n\n return this;\n };\n\n __exports__.Descriptor = Descriptor;\n __exports__.defineProperty = defineProperty;\n });\ndefine(\"ember-metal/property_events\",\n [\"ember-metal/utils\",\"ember-metal/events\",\"ember-metal/observer_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var META_KEY = __dependency1__.META_KEY;\n var guidFor = __dependency1__.guidFor;\n var tryFinally = __dependency1__.tryFinally;\n var sendEvent = __dependency2__.sendEvent;\n var listenersUnion = __dependency2__.listenersUnion;\n var listenersDiff = __dependency2__.listenersDiff;\n var ObserverSet = __dependency3__[\"default\"];\n\n var beforeObserverSet = new ObserverSet(),\n observerSet = new ObserverSet(),\n deferred = 0;\n\n // ..........................................................\n // PROPERTY CHANGES\n //\n\n /**\n This function is called just before an object property is about to change.\n It will notify any before observers and prepare caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyDidChange()` which you should call just\n after the property value changes.\n\n @method propertyWillChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n */\n function propertyWillChange(obj, keyName) {\n var m = obj[META_KEY],\n watching = (m && m.watching[keyName] > 0) || keyName === 'length',\n proto = m && m.proto,\n desc = m && m.descs[keyName];\n\n if (!watching) { return; }\n if (proto === obj) { return; }\n if (desc && desc.willChange) { desc.willChange(obj, keyName); }\n dependentKeysWillChange(obj, keyName, m);\n chainsWillChange(obj, keyName, m);\n notifyBeforeObservers(obj, keyName);\n }\n\n /**\n This function is called just after an object property has changed.\n It will notify any observers and clear caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyWillChange()` which you should call just\n before the property value changes.\n\n @method propertyDidChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n */\n function propertyDidChange(obj, keyName) {\n var m = obj[META_KEY],\n watching = (m && m.watching[keyName] > 0) || keyName === 'length',\n proto = m && m.proto,\n desc = m && m.descs[keyName];\n\n if (proto === obj) { return; }\n\n // shouldn't this mean that we're watching this key?\n if (desc && desc.didChange) { desc.didChange(obj, keyName); }\n if (!watching && keyName !== 'length') { return; }\n\n dependentKeysDidChange(obj, keyName, m);\n chainsDidChange(obj, keyName, m, false);\n notifyObservers(obj, keyName);\n }\n\n var WILL_SEEN, DID_SEEN;\n\n // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...)\n function dependentKeysWillChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = WILL_SEEN, top = !seen;\n if (top) { seen = WILL_SEEN = {}; }\n iterDeps(propertyWillChange, obj, depKey, seen, meta);\n if (top) { WILL_SEEN = null; }\n }\n\n // called whenever a property has just changed to update dependent keys\n function dependentKeysDidChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = DID_SEEN, top = !seen;\n if (top) { seen = DID_SEEN = {}; }\n iterDeps(propertyDidChange, obj, depKey, seen, meta);\n if (top) { DID_SEEN = null; }\n }\n\n function iterDeps(method, obj, depKey, seen, meta) {\n var guid = guidFor(obj);\n if (!seen[guid]) seen[guid] = {};\n if (seen[guid][depKey]) return;\n seen[guid][depKey] = true;\n\n var deps = meta.deps;\n deps = deps && deps[depKey];\n if (deps) {\n for(var key in deps) {\n var desc = meta.descs[key];\n if (desc && desc._suspended === obj) continue;\n method(obj, key);\n }\n }\n }\n\n function chainsWillChange(obj, keyName, m) {\n if (!(m.hasOwnProperty('chainWatchers') &&\n m.chainWatchers[keyName])) {\n return;\n }\n\n var nodes = m.chainWatchers[keyName],\n events = [],\n i, l;\n\n for(i = 0, l = nodes.length; i < l; i++) {\n nodes[i].willChange(events);\n }\n\n for (i = 0, l = events.length; i < l; i += 2) {\n propertyWillChange(events[i], events[i+1]);\n }\n }\n\n function chainsDidChange(obj, keyName, m, suppressEvents) {\n if (!(m && m.hasOwnProperty('chainWatchers') &&\n m.chainWatchers[keyName])) {\n return;\n }\n\n var nodes = m.chainWatchers[keyName],\n events = suppressEvents ? null : [],\n i, l;\n\n for(i = 0, l = nodes.length; i < l; i++) {\n nodes[i].didChange(events);\n }\n\n if (suppressEvents) {\n return;\n }\n\n for (i = 0, l = events.length; i < l; i += 2) {\n propertyDidChange(events[i], events[i+1]);\n }\n }\n\n function overrideChains(obj, keyName, m) {\n chainsDidChange(obj, keyName, m, true);\n };\n\n /**\n @method beginPropertyChanges\n @chainable\n @private\n */\n function beginPropertyChanges() {\n deferred++;\n }\n\n /**\n @method endPropertyChanges\n @private\n */\n function endPropertyChanges() {\n deferred--;\n if (deferred<=0) {\n beforeObserverSet.clear();\n observerSet.flush();\n }\n }\n\n /**\n Make a series of property changes together in an\n exception-safe way.\n\n ```javascript\n Ember.changeProperties(function() {\n obj1.set('foo', mayBlowUpWhenSet);\n obj2.set('bar', baz);\n });\n ```\n\n @method changeProperties\n @param {Function} callback\n @param [binding]\n */\n function changeProperties(cb, binding) {\n beginPropertyChanges();\n tryFinally(cb, endPropertyChanges, binding);\n };\n\n function notifyBeforeObservers(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = keyName + ':before', listeners, diff;\n if (deferred) {\n listeners = beforeObserverSet.add(obj, keyName, eventName);\n diff = listenersDiff(obj, eventName, listeners);\n sendEvent(obj, eventName, [obj, keyName], diff);\n } else {\n sendEvent(obj, eventName, [obj, keyName]);\n }\n }\n\n function notifyObservers(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = keyName + ':change', listeners;\n if (deferred) {\n listeners = observerSet.add(obj, keyName, eventName);\n listenersUnion(obj, eventName, listeners);\n } else {\n sendEvent(obj, eventName, [obj, keyName]);\n }\n }\n\n __exports__.propertyWillChange = propertyWillChange;\n __exports__.propertyDidChange = propertyDidChange;\n __exports__.overrideChains = overrideChains;\n __exports__.beginPropertyChanges = beginPropertyChanges;\n __exports__.endPropertyChanges = endPropertyChanges;\n __exports__.changeProperties = changeProperties;\n });\ndefine(\"ember-metal/property_get\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n\n var Ember = __dependency1__[\"default\"];\n var META_KEY = __dependency2__.META_KEY;\n var EmberError = __dependency3__[\"default\"];\n\n var get;\n\n var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n var IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\\.]/;\n var HAS_THIS = 'this.';\n var FIRST_KEY = /^([^\\.]+)/;\n\n // ..........................................................\n // GET AND SET\n //\n // If we are on a platform that supports accessors we can use those.\n // Otherwise simulate accessors by looking up the property directly on the\n // object.\n\n /**\n Gets the value of a property on an object. If the property is computed,\n the function will be invoked. If the property is not defined but the\n object implements the `unknownProperty` method then that will be invoked.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to retrieve a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to retrieve\n properties if the property might not be defined on the object and you want\n to respect the `unknownProperty` handler. Otherwise you can ignore this\n method.\n\n Note that if the object itself is `undefined`, this method will throw\n an error.\n\n @method get\n @for Ember\n @param {Object} obj The object to retrieve from.\n @param {String} keyName The property key to retrieve\n @return {Object} the property value or `null`.\n */\n get = function get(obj, keyName) {\n // Helpers that operate with 'this' within an #each\n if (keyName === '') {\n return obj;\n }\n\n if (!keyName && 'string'===typeof obj) {\n keyName = obj;\n obj = null;\n }\n\n Ember.assert(\"Cannot call get with \"+ keyName +\" key.\", !!keyName);\n Ember.assert(\"Cannot call get with '\"+ keyName +\"' on an undefined object.\", obj !== undefined);\n\n if (obj === null) { return _getPath(obj, keyName); }\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;\n\n if (desc === undefined && keyName.indexOf('.') !== -1) {\n return _getPath(obj, keyName);\n }\n\n if (desc) {\n return desc.get(obj, keyName);\n } else {\n if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {\n ret = meta.values[keyName];\n } else {\n ret = obj[keyName];\n }\n\n if (ret === undefined &&\n 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {\n return obj.unknownProperty(keyName);\n }\n\n return ret;\n }\n };\n\n // Currently used only by Ember Data tests\n if (Ember.config.overrideAccessors) {\n Ember.get = get;\n Ember.config.overrideAccessors();\n get = Ember.get;\n }\n\n /**\n Normalizes a target/path pair to reflect that actual target/path that should\n be observed, etc. This takes into account passing in global property\n paths (i.e. a path beginning with a captial letter not defined on the\n target).\n\n @private\n @method normalizeTuple\n @for Ember\n @param {Object} target The current target. May be `null`.\n @param {String} path A path on the target or a global property path.\n @return {Array} a temporary array with the normalized target/path pair.\n */\n function normalizeTuple(target, path) {\n var hasThis = path.indexOf(HAS_THIS) === 0,\n isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),\n key;\n\n if (!target || isGlobal) target = Ember.lookup;\n if (hasThis) path = path.slice(5);\n\n if (target === Ember.lookup) {\n key = path.match(FIRST_KEY)[0];\n target = get(target, key);\n path = path.slice(key.length+1);\n }\n\n // must return some kind of path to be valid else other things will break.\n if (!path || path.length===0) throw new EmberError('Path cannot be empty');\n\n return [ target, path ];\n };\n\n function _getPath(root, path) {\n var hasThis, parts, tuple, idx, len;\n\n // If there is no root and path is a key name, return that\n // property from the global object.\n // E.g. get('Ember') -> Ember\n if (root === null && path.indexOf('.') === -1) { return get(Ember.lookup, path); }\n\n // detect complicated paths and normalize them\n hasThis = path.indexOf(HAS_THIS) === 0;\n\n if (!root || hasThis) {\n tuple = normalizeTuple(root, path);\n root = tuple[0];\n path = tuple[1];\n tuple.length = 0;\n }\n\n parts = path.split(\".\");\n len = parts.length;\n for (idx = 0; root != null && idx < len; idx++) {\n root = get(root, parts[idx], true);\n if (root && root.isDestroyed) { return undefined; }\n }\n return root;\n };\n\n function getWithDefault(root, key, defaultValue) {\n var value = get(root, key);\n\n if (value === undefined) { return defaultValue; }\n return value;\n };\n\n __exports__[\"default\"] = get;\n __exports__.get = get;\n __exports__.getWithDefault = getWithDefault;\n __exports__.normalizeTuple = normalizeTuple;\n __exports__._getPath = _getPath;\n });\ndefine(\"ember-metal/property_set\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/utils\",\"ember-metal/property_events\",\"ember-metal/properties\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var getPath = __dependency2__._getPath;\n var META_KEY = __dependency3__.META_KEY;\n var propertyWillChange = __dependency4__.propertyWillChange;\n var propertyDidChange = __dependency4__.propertyDidChange;\n var defineProperty = __dependency5__.defineProperty;\n var EmberError = __dependency6__[\"default\"];\n\n var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;\n\n /**\n Sets the value of a property on an object, respecting computed properties\n and notifying observers and other listeners of the change. If the\n property is not defined but the object implements the `setUnknownProperty`\n method then that will be invoked as well.\n\n @method set\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} keyName The property key to set\n @param {Object} value The value to set\n @return {Object} the passed value.\n */\n var set = function set(obj, keyName, value, tolerant) {\n if (typeof obj === 'string') {\n Ember.assert(\"Path '\" + obj + \"' must be global if no obj is given.\", IS_GLOBAL.test(obj));\n value = keyName;\n keyName = obj;\n obj = null;\n }\n\n Ember.assert(\"Cannot call set with \"+ keyName +\" key.\", !!keyName);\n\n if (!obj) {\n return setPath(obj, keyName, value, tolerant);\n }\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName],\n isUnknown, currentValue;\n\n if (desc === undefined && keyName.indexOf('.') !== -1) {\n return setPath(obj, keyName, value, tolerant);\n }\n\n Ember.assert(\"You need to provide an object and key to `set`.\", !!obj && keyName !== undefined);\n Ember.assert('calling set on destroyed object', !obj.isDestroyed);\n\n if (desc !== undefined) {\n desc.set(obj, keyName, value);\n } else {\n\n if (typeof obj === 'object' && obj !== null && value !== undefined && obj[keyName] === value) {\n return value;\n }\n\n isUnknown = 'object' === typeof obj && !(keyName in obj);\n\n // setUnknownProperty is called if `obj` is an object,\n // the property does not already exist, and the\n // `setUnknownProperty` method exists on the object\n if (isUnknown && 'function' === typeof obj.setUnknownProperty) {\n obj.setUnknownProperty(keyName, value);\n } else if (meta && meta.watching[keyName] > 0) {\n if (MANDATORY_SETTER) {\n currentValue = meta.values[keyName];\n } else {\n currentValue = obj[keyName];\n }\n // only trigger a change if the value has changed\n if (value !== currentValue) {\n propertyWillChange(obj, keyName);\n if (MANDATORY_SETTER) {\n if ((currentValue === undefined && !(keyName in obj)) || !obj.propertyIsEnumerable(keyName)) {\n defineProperty(obj, keyName, null, value); // setup mandatory setter\n } else {\n meta.values[keyName] = value;\n }\n } else {\n obj[keyName] = value;\n }\n propertyDidChange(obj, keyName);\n }\n } else {\n obj[keyName] = value;\n }\n }\n return value;\n };\n\n // Currently used only by Ember Data tests\n // ES6TODO: Verify still true\n if (Ember.config.overrideAccessors) {\n Ember.set = set;\n Ember.config.overrideAccessors();\n set = Ember.set;\n }\n\n function setPath(root, path, value, tolerant) {\n var keyName;\n\n // get the last part of the path\n keyName = path.slice(path.lastIndexOf('.') + 1);\n\n // get the first part of the part\n path = (path === keyName) ? keyName : path.slice(0, path.length-(keyName.length+1));\n\n // unless the path is this, look up the first part to\n // get the root\n if (path !== 'this') {\n root = getPath(root, path);\n }\n\n if (!keyName || keyName.length === 0) {\n throw new EmberError('Property set failed: You passed an empty path');\n }\n\n if (!root) {\n if (tolerant) { return; }\n else { throw new EmberError('Property set failed: object in path \"'+path+'\" could not be found or was destroyed.'); }\n }\n\n return set(root, keyName, value);\n }\n\n /**\n Error-tolerant form of `Ember.set`. Will not blow up if any part of the\n chain is `undefined`, `null`, or destroyed.\n\n This is primarily used when syncing bindings, which may try to update after\n an object has been destroyed.\n\n @method trySet\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} path The property path to set\n @param {Object} value The value to set\n */\n function trySet(root, path, value) {\n return set(root, path, value, true);\n };\n\n __exports__.set = set;\n __exports__.trySet = trySet;\n });\ndefine(\"ember-metal/run_loop\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/array\",\"ember-metal/property_events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var apply = __dependency2__.apply;\n var indexOf = __dependency3__.indexOf;\n var beginPropertyChanges = __dependency4__.beginPropertyChanges;\n var endPropertyChanges = __dependency4__.endPropertyChanges;\n\n var onBegin = function(current) {\n run.currentRunLoop = current;\n };\n\n var onEnd = function(current, next) {\n run.currentRunLoop = next;\n };\n\n // ES6TODO: should Backburner become es6?\n var Backburner = requireModule('backburner').Backburner,\n backburner = new Backburner(['sync', 'actions', 'destroy'], {\n sync: {\n before: beginPropertyChanges,\n after: endPropertyChanges\n },\n defaultQueue: 'actions',\n onBegin: onBegin,\n onEnd: onEnd,\n onErrorTarget: Ember,\n onErrorMethod: 'onerror'\n }),\n slice = [].slice,\n concat = [].concat;\n\n // ..........................................................\n // run - this is ideally the only public API the dev sees\n //\n\n /**\n Runs the passed target and method inside of a RunLoop, ensuring any\n deferred actions including bindings and views updates are flushed at the\n end.\n\n Normally you should not need to invoke this method yourself. However if\n you are implementing raw event handlers when interfacing with other\n libraries or plugins, you should probably wrap all of your code inside this\n call.\n\n ```javascript\n run(function() {\n // code to be execute within a RunLoop\n });\n ```\n\n @class run\n @namespace Ember\n @static\n @constructor\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function.\n */\n var run = function() {\n return apply(backburner, backburner.run, arguments);\n };\n\n /**\n If no run-loop is present, it creates a new one. If a run loop is\n present it will queue itself to run on the existing run-loops action\n queue.\n\n Please note: This is not for normal usage, and should be used sparingly.\n\n If invoked when not within a run loop:\n\n ```javascript\n run.join(function() {\n // creates a new run-loop\n });\n ```\n\n Alternatively, if called within an existing run loop:\n\n ```javascript\n run(function() {\n // creates a new run-loop\n run.join(function() {\n // joins with the existing run-loop, and queues for invocation on\n // the existing run-loops action queue.\n });\n });\n ```\n\n @method join\n @namespace Ember\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} Return value from invoking the passed function. Please note,\n when called within an existing loop, no return value is possible.\n */\n run.join = function(target, method /* args */) {\n if (!run.currentRunLoop) {\n return apply(Ember, run, arguments);\n }\n\n var args = slice.call(arguments);\n args.unshift('actions');\n apply(run, run.schedule, args);\n };\n\n /**\n Provides a useful utility for when integrating with non-Ember libraries\n that provide asynchronous callbacks.\n\n Ember utilizes a run-loop to batch and coalesce changes. This works by\n marking the start and end of Ember-related Javascript execution.\n\n When using events such as a View's click handler, Ember wraps the event\n handler in a run-loop, but when integrating with non-Ember libraries this\n can be tedious.\n\n For example, the following is rather verbose but is the correct way to combine\n third-party events and Ember code.\n\n ```javascript\n var that = this;\n jQuery(window).on('resize', function(){\n run(function(){\n that.handleResize();\n });\n });\n ```\n\n To reduce the boilerplate, the following can be used to construct a\n run-loop-wrapped callback handler.\n\n ```javascript\n jQuery(window).on('resize', run.bind(this, this.handleResize));\n ```\n\n @method bind\n @namespace run\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function. Please note,\n when called within an existing loop, no return value is possible.\n @since 1.4.0\n */\n run.bind = function(target, method /* args*/) {\n var args = slice.call(arguments);\n return function() {\n return apply(run, run.join, args.concat(slice.call(arguments)));\n };\n };\n\n run.backburner = backburner;\n run.currentRunLoop = null;\n run.queues = backburner.queueNames;\n\n /**\n Begins a new RunLoop. Any deferred actions invoked after the begin will\n be buffered until you invoke a matching call to `run.end()`. This is\n a lower-level way to use a RunLoop instead of using `run()`.\n\n ```javascript\n run.begin();\n // code to be execute within a RunLoop\n run.end();\n ```\n\n @method begin\n @return {void}\n */\n run.begin = function() {\n backburner.begin();\n };\n\n /**\n Ends a RunLoop. This must be called sometime after you call\n `run.begin()` to flush any deferred actions. This is a lower-level way\n to use a RunLoop instead of using `run()`.\n\n ```javascript\n run.begin();\n // code to be execute within a RunLoop\n run.end();\n ```\n\n @method end\n @return {void}\n */\n run.end = function() {\n backburner.end();\n };\n\n /**\n Array of named queues. This array determines the order in which queues\n are flushed at the end of the RunLoop. You can define your own queues by\n simply adding the queue name to this array. Normally you should not need\n to inspect or modify this property.\n\n @property queues\n @type Array\n @default ['sync', 'actions', 'destroy']\n */\n\n /**\n Adds the passed target/method and any optional arguments to the named\n queue to be executed at the end of the RunLoop. If you have not already\n started a RunLoop when calling this method one will be started for you\n automatically.\n\n At the end of a RunLoop, any methods scheduled in this way will be invoked.\n Methods will be invoked in an order matching the named queues defined in\n the `run.queues` property.\n\n ```javascript\n run.schedule('sync', this, function() {\n // this will be executed in the first RunLoop queue, when bindings are synced\n console.log(\"scheduled on sync queue\");\n });\n\n run.schedule('actions', this, function() {\n // this will be executed in the 'actions' queue, after bindings have synced.\n console.log(\"scheduled on actions queue\");\n });\n\n // Note the functions will be run in order based on the run queues order.\n // Output would be:\n // scheduled on sync queue\n // scheduled on actions queue\n ```\n\n @method schedule\n @param {String} queue The name of the queue to schedule against.\n Default queues are 'sync' and 'actions'\n @param {Object} [target] target object to use as the context when invoking a method.\n @param {String|Function} method The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.\n @param {Object} [arguments*] Optional arguments to be passed to the queued method.\n @return {void}\n */\n run.schedule = function(queue, target, method) {\n checkAutoRun();\n apply(backburner, backburner.schedule, arguments);\n };\n\n // Used by global test teardown\n run.hasScheduledTimers = function() {\n return backburner.hasTimers();\n };\n\n // Used by global test teardown\n run.cancelTimers = function () {\n backburner.cancelTimers();\n };\n\n /**\n Immediately flushes any events scheduled in the 'sync' queue. Bindings\n use this queue so this method is a useful way to immediately force all\n bindings in the application to sync.\n\n You should call this method anytime you need any changed state to propagate\n throughout the app immediately without repainting the UI (which happens\n in the later 'render' queue added by the `ember-views` package).\n\n ```javascript\n run.sync();\n ```\n\n @method sync\n @return {void}\n */\n run.sync = function() {\n if (backburner.currentInstance) {\n backburner.currentInstance.queues.sync.flush();\n }\n };\n\n /**\n Invokes the passed target/method and optional arguments after a specified\n period if time. The last parameter of this method must always be a number\n of milliseconds.\n\n You should use this method whenever you need to run some action after a\n period of time instead of using `setTimeout()`. This method will ensure that\n items that expire during the same script execution cycle all execute\n together, which is often more efficient than using a real setTimeout.\n\n ```javascript\n run.later(myContext, function() {\n // code here will execute within a RunLoop in about 500ms with this == myContext\n }, 500);\n ```\n\n @method later\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait Number of milliseconds to wait.\n @return {String} a string you can use to cancel the timer in\n `run.cancel` later.\n */\n run.later = function(target, method) {\n return apply(backburner, backburner.later, arguments);\n };\n\n /**\n Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling `scheduleOnce` with the \"actions\" queue.\n\n @method once\n @param {Object} [target] The target of the method to invoke.\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} Timer information for use in cancelling, see `run.cancel`.\n */\n run.once = function(target, method) {\n checkAutoRun();\n var args = slice.call(arguments);\n args.unshift('actions');\n return apply(backburner, backburner.scheduleOnce, args);\n };\n\n /**\n Schedules a function to run one time in a given queue of the current RunLoop.\n Calling this method with the same queue/target/method combination will have\n no effect (past the initial call).\n\n Note that although you can pass optional arguments these will not be\n considered when looking for duplicates. New arguments will replace previous\n calls.\n\n ```javascript\n run(function() {\n var sayHi = function() { console.log('hi'); }\n run.scheduleOnce('afterRender', myContext, sayHi);\n run.scheduleOnce('afterRender', myContext, sayHi);\n // sayHi will only be executed once, in the afterRender queue of the RunLoop\n });\n ```\n\n Also note that passing an anonymous function to `run.scheduleOnce` will\n not prevent additional calls with an identical anonymous function from\n scheduling the items multiple times, e.g.:\n\n ```javascript\n function scheduleIt() {\n run.scheduleOnce('actions', myContext, function() { console.log(\"Closure\"); });\n }\n scheduleIt();\n scheduleIt();\n // \"Closure\" will print twice, even though we're using `run.scheduleOnce`,\n // because the function we pass to it is anonymous and won't match the\n // previously scheduled operation.\n ```\n\n Available queues, and their order, can be found at `run.queues`\n\n @method scheduleOnce\n @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'.\n @param {Object} [target] The target of the method to invoke.\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} Timer information for use in cancelling, see `run.cancel`.\n */\n run.scheduleOnce = function(queue, target, method) {\n checkAutoRun();\n return apply(backburner, backburner.scheduleOnce, arguments);\n };\n\n /**\n Schedules an item to run from within a separate run loop, after\n control has been returned to the system. This is equivalent to calling\n `run.later` with a wait time of 1ms.\n\n ```javascript\n run.next(myContext, function() {\n // code to be executed in the next run loop,\n // which will be scheduled after the current one\n });\n ```\n\n Multiple operations scheduled with `run.next` will coalesce\n into the same later run loop, along with any other operations\n scheduled by `run.later` that expire right around the same\n time that `run.next` operations will fire.\n\n Note that there are often alternatives to using `run.next`.\n For instance, if you'd like to schedule an operation to happen\n after all DOM element operations have completed within the current\n run loop, you can make use of the `afterRender` run loop queue (added\n by the `ember-views` package, along with the preceding `render` queue\n where all the DOM element operations happen). Example:\n\n ```javascript\n App.MyCollectionView = Ember.CollectionView.extend({\n didInsertElement: function() {\n run.scheduleOnce('afterRender', this, 'processChildElements');\n },\n processChildElements: function() {\n // ... do something with collectionView's child view\n // elements after they've finished rendering, which\n // can't be done within the CollectionView's\n // `didInsertElement` hook because that gets run\n // before the child elements have been added to the DOM.\n }\n });\n ```\n\n One benefit of the above approach compared to using `run.next` is\n that you will be able to perform DOM/CSS operations before unprocessed\n elements are rendered to the screen, which may prevent flickering or\n other artifacts caused by delaying processing until after rendering.\n\n The other major benefit to the above approach is that `run.next`\n introduces an element of non-determinism, which can make things much\n harder to test, due to its reliance on `setTimeout`; it's much harder\n to guarantee the order of scheduled operations when they are scheduled\n outside of the current run loop, i.e. with `run.next`.\n\n @method next\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} Timer information for use in cancelling, see `run.cancel`.\n */\n run.next = function() {\n var args = slice.call(arguments);\n args.push(1);\n return apply(backburner, backburner.later, args);\n };\n\n /**\n Cancels a scheduled item. Must be a value returned by `run.later()`,\n `run.once()`, `run.next()`, `run.debounce()`, or\n `run.throttle()`.\n\n ```javascript\n var runNext = run.next(myContext, function() {\n // will not be executed\n });\n run.cancel(runNext);\n\n var runLater = run.later(myContext, function() {\n // will not be executed\n }, 500);\n run.cancel(runLater);\n\n var runOnce = run.once(myContext, function() {\n // will not be executed\n });\n run.cancel(runOnce);\n\n var throttle = run.throttle(myContext, function() {\n // will not be executed\n }, 1, false);\n run.cancel(throttle);\n\n var debounce = run.debounce(myContext, function() {\n // will not be executed\n }, 1);\n run.cancel(debounce);\n\n var debounceImmediate = run.debounce(myContext, function() {\n // will be executed since we passed in true (immediate)\n }, 100, true);\n // the 100ms delay until this method can be called again will be cancelled\n run.cancel(debounceImmediate);\n ```\n\n @method cancel\n @param {Object} timer Timer object to cancel\n @return {Boolean} true if cancelled or false/undefined if it wasn't found\n */\n run.cancel = function(timer) {\n return backburner.cancel(timer);\n };\n\n /**\n Delay calling the target method until the debounce period has elapsed\n with no additional debounce calls. If `debounce` is called again before\n the specified time has elapsed, the timer is reset and the entire period\n must pass again before the target method is called.\n\n This method should be used when an event may be called multiple times\n but the action should only be called once when the event is done firing.\n A common example is for scroll events where you only want updates to\n happen once scrolling has ceased.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'debounce'};\n\n run.debounce(myContext, myFunc, 150);\n\n // less than 150ms passes\n\n run.debounce(myContext, myFunc, 150);\n\n // 150ms passes\n // myFunc is invoked with context myContext\n // console logs 'debounce ran.' one time.\n ```\n\n Immediate allows you to run the function immediately, but debounce\n other calls for this function until the wait time has elapsed. If\n `debounce` is called again before the specified time has elapsed,\n the timer is reset and the entire period must pass again before\n the method can be called again.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'debounce'};\n\n run.debounce(myContext, myFunc, 150, true);\n\n // console logs 'debounce ran.' one time immediately.\n // 100ms passes\n\n run.debounce(myContext, myFunc, 150, true);\n\n // 150ms passes and nothing else is logged to the console and\n // the debouncee is no longer being watched\n\n run.debounce(myContext, myFunc, 150, true);\n\n // console logs 'debounce ran.' one time immediately.\n // 150ms passes and nothing else is logged to the console and\n // the debouncee is no longer being watched\n\n ```\n\n @method debounce\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait Number of milliseconds to wait.\n @param {Boolean} immediate Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.\n @return {Array} Timer information for use in cancelling, see `run.cancel`.\n */\n run.debounce = function() {\n return apply(backburner, backburner.debounce, arguments);\n };\n\n /**\n Ensure that the target method is never called more frequently than\n the specified spacing period. The target method is called immediately.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'throttle'};\n\n run.throttle(myContext, myFunc, 150);\n // myFunc is invoked with context myContext\n // console logs 'throttle ran.'\n\n // 50ms passes\n run.throttle(myContext, myFunc, 150);\n\n // 50ms passes\n run.throttle(myContext, myFunc, 150);\n\n // 150ms passes\n run.throttle(myContext, myFunc, 150);\n // myFunc is invoked with context myContext\n // console logs 'throttle ran.'\n ```\n\n @method throttle\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} spacing Number of milliseconds to space out requests.\n @param {Boolean} immediate Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.\n @return {Array} Timer information for use in cancelling, see `run.cancel`.\n */\n run.throttle = function() {\n return apply(backburner, backburner.throttle, arguments);\n };\n\n // Make sure it's not an autorun during testing\n function checkAutoRun() {\n if (!run.currentRunLoop) {\n Ember.assert(\"You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an run\", !Ember.testing);\n }\n }\n\n /**\n Add a new named queue after the specified queue.\n\n The queue to add will only be added once.\n\n @method _addQueue\n @param {String} name the name of the queue to add.\n @param {String} after the name of the queue to add after.\n @private\n */\n run._addQueue = function(name, after) {\n if (indexOf.call(run.queues, name) === -1) {\n run.queues.splice(indexOf.call(run.queues, after)+1, 0, name);\n }\n }\n\n __exports__[\"default\"] = run\n });\ndefine(\"ember-metal/set_properties\",\n [\"ember-metal/property_events\",\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var changeProperties = __dependency1__.changeProperties;\n var set = __dependency2__.set;\n\n /**\n Set a list of properties on an object. These properties are set inside\n a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n observers will be buffered.\n\n ```javascript\n var anObject = Ember.Object.create();\n\n anObject.setProperties({\n firstName: 'Stanley',\n lastName: 'Stuart',\n age: 21\n });\n ```\n\n @method setProperties\n @param self\n @param {Object} hash\n @return self\n */\n function setProperties(self, hash) {\n changeProperties(function() {\n for(var prop in hash) {\n if (hash.hasOwnProperty(prop)) { set(self, prop, hash[prop]); }\n }\n });\n return self;\n };\n\n __exports__[\"default\"] = setProperties;\n });\ndefine(\"ember-metal/utils\",\n [\"ember-metal/core\",\"ember-metal/platform\",\"ember-metal/array\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var platform = __dependency2__.platform;\n var create = __dependency2__.create;\n var forEach = __dependency3__.forEach;\n\n /**\n @module ember-metal\n */\n\n /**\n Prefix used for guids through out Ember.\n @private\n @property GUID_PREFIX\n @for Ember\n @type String\n @final\n */\n var GUID_PREFIX = 'ember';\n\n\n var o_defineProperty = platform.defineProperty,\n o_create = create,\n // Used for guid generation...\n numberCache = [],\n stringCache = {},\n uuid = 0;\n\n var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n /**\n A unique key used to assign guids and other private metadata to objects.\n If you inspect an object in your browser debugger you will often see these.\n They can be safely ignored.\n\n On browsers that support it, these properties are added with enumeration\n disabled so they won't show up when you iterate over your properties.\n\n @private\n @property GUID_KEY\n @for Ember\n @type String\n @final\n */\n var GUID_KEY = '__ember' + (+ new Date());\n\n var GUID_DESC = {\n writable: false,\n configurable: false,\n enumerable: false,\n value: null\n };\n\n /**\n Generates a new guid, optionally saving the guid to the object that you\n pass in. You will rarely need to use this method. Instead you should\n call `Ember.guidFor(obj)`, which return an existing guid if available.\n\n @private\n @method generateGuid\n @for Ember\n @param {Object} [obj] Object the guid will be used for. If passed in, the guid will\n be saved on the object and reused whenever you pass the same object\n again.\n\n If no object is passed, just generate a new guid.\n @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to\n separate the guid into separate namespaces.\n @return {String} the guid\n */\n function generateGuid(obj, prefix) {\n if (!prefix) prefix = GUID_PREFIX;\n var ret = (prefix + (uuid++));\n if (obj) {\n if (obj[GUID_KEY] === null) {\n obj[GUID_KEY] = ret;\n } else {\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n }\n }\n return ret;\n }\n\n /**\n Returns a unique id for the object. If the object does not yet have a guid,\n one will be assigned to it. You can call this on any object,\n `Ember.Object`-based or not, but be aware that it will add a `_guid`\n property.\n\n You can also use this method on DOM Element objects.\n\n @private\n @method guidFor\n @for Ember\n @param {Object} obj any object, string, number, Element, or primitive\n @return {String} the unique guid for this instance.\n */\n function guidFor(obj) {\n\n // special cases where we don't want to add a key to object\n if (obj === undefined) return \"(undefined)\";\n if (obj === null) return \"(null)\";\n\n var ret;\n var type = typeof obj;\n\n // Don't allow prototype changes to String etc. to change the guidFor\n switch(type) {\n case 'number':\n ret = numberCache[obj];\n if (!ret) ret = numberCache[obj] = 'nu'+obj;\n return ret;\n\n case 'string':\n ret = stringCache[obj];\n if (!ret) ret = stringCache[obj] = 'st'+(uuid++);\n return ret;\n\n case 'boolean':\n return obj ? '(true)' : '(false)';\n\n default:\n if (obj[GUID_KEY]) return obj[GUID_KEY];\n if (obj === Object) return '(Object)';\n if (obj === Array) return '(Array)';\n ret = 'ember' + (uuid++);\n\n if (obj[GUID_KEY] === null) {\n obj[GUID_KEY] = ret;\n } else {\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n }\n return ret;\n }\n };\n\n // ..........................................................\n // META\n //\n\n var META_DESC = {\n writable: true,\n configurable: false,\n enumerable: false,\n value: null\n };\n\n\n /**\n The key used to store meta information on object for property observing.\n\n @property META_KEY\n @for Ember\n @private\n @final\n @type String\n */\n var META_KEY = '__ember_meta__';\n\n var isDefinePropertySimulated = platform.defineProperty.isSimulated;\n\n function Meta(obj) {\n this.descs = {};\n this.watching = {};\n this.cache = {};\n this.cacheMeta = {};\n this.source = obj;\n }\n\n Meta.prototype = {\n descs: null,\n deps: null,\n watching: null,\n listeners: null,\n cache: null,\n cacheMeta: null,\n source: null,\n mixins: null,\n bindings: null,\n chains: null,\n chainWatchers: null,\n values: null,\n proto: null\n };\n\n if (isDefinePropertySimulated) {\n // on platforms that don't support enumerable false\n // make meta fail jQuery.isPlainObject() to hide from\n // jQuery.extend() by having a property that fails\n // hasOwnProperty check.\n Meta.prototype.__preventPlainObject__ = true;\n\n // Without non-enumerable properties, meta objects will be output in JSON\n // unless explicitly suppressed\n Meta.prototype.toJSON = function () { };\n }\n\n // Placeholder for non-writable metas.\n var EMPTY_META = new Meta(null);\n\n if (MANDATORY_SETTER) { EMPTY_META.values = {}; }\n\n /**\n Retrieves the meta hash for an object. If `writable` is true ensures the\n hash is writable for this object as well.\n\n The meta object contains information about computed property descriptors as\n well as any watched properties and other information. You generally will\n not access this information directly but instead work with higher level\n methods that manipulate this hash indirectly.\n\n @method meta\n @for Ember\n @private\n\n @param {Object} obj The object to retrieve meta for\n @param {Boolean} [writable=true] Pass `false` if you do not intend to modify\n the meta hash, allowing the method to avoid making an unnecessary copy.\n @return {Object} the meta hash for an object\n */\n function meta(obj, writable) {\n\n var ret = obj[META_KEY];\n if (writable===false) return ret || EMPTY_META;\n\n if (!ret) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = new Meta(obj);\n\n if (MANDATORY_SETTER) { ret.values = {}; }\n\n obj[META_KEY] = ret;\n\n // make sure we don't accidentally try to create constructor like desc\n ret.descs.constructor = null;\n\n } else if (ret.source !== obj) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = o_create(ret);\n ret.descs = o_create(ret.descs);\n ret.watching = o_create(ret.watching);\n ret.cache = {};\n ret.cacheMeta = {};\n ret.source = obj;\n\n if (MANDATORY_SETTER) { ret.values = o_create(ret.values); }\n\n obj[META_KEY] = ret;\n }\n return ret;\n };\n\n function getMeta(obj, property) {\n var _meta = meta(obj, false);\n return _meta[property];\n };\n\n function setMeta(obj, property, value) {\n var _meta = meta(obj, true);\n _meta[property] = value;\n return value;\n };\n\n /**\n @deprecated\n @private\n\n In order to store defaults for a class, a prototype may need to create\n a default meta object, which will be inherited by any objects instantiated\n from the class's constructor.\n\n However, the properties of that meta object are only shallow-cloned,\n so if a property is a hash (like the event system's `listeners` hash),\n it will by default be shared across all instances of that class.\n\n This method allows extensions to deeply clone a series of nested hashes or\n other complex objects. For instance, the event system might pass\n `['listeners', 'foo:change', 'ember157']` to `prepareMetaPath`, which will\n walk down the keys provided.\n\n For each key, if the key does not exist, it is created. If it already\n exists and it was inherited from its constructor, the constructor's\n key is cloned.\n\n You can also pass false for `writable`, which will simply return\n undefined if `prepareMetaPath` discovers any part of the path that\n shared or undefined.\n\n @method metaPath\n @for Ember\n @param {Object} obj The object whose meta we are examining\n @param {Array} path An array of keys to walk down\n @param {Boolean} writable whether or not to create a new meta\n (or meta property) if one does not already exist or if it's\n shared with its constructor\n */\n function metaPath(obj, path, writable) {\n Ember.deprecate(\"Ember.metaPath is deprecated and will be removed from future releases.\");\n var _meta = meta(obj, writable), keyName, value;\n\n for (var i=0, l=path.length; i<l; i++) {\n keyName = path[i];\n value = _meta[keyName];\n\n if (!value) {\n if (!writable) { return undefined; }\n value = _meta[keyName] = { __ember_source__: obj };\n } else if (value.__ember_source__ !== obj) {\n if (!writable) { return undefined; }\n value = _meta[keyName] = o_create(value);\n value.__ember_source__ = obj;\n }\n\n _meta = value;\n }\n\n return value;\n };\n\n /**\n Wraps the passed function so that `this._super` will point to the superFunc\n when the function is invoked. This is the primitive we use to implement\n calls to super.\n\n @private\n @method wrap\n @for Ember\n @param {Function} func The function to call\n @param {Function} superFunc The super function.\n @return {Function} wrapped function.\n */\n function wrap(func, superFunc) {\n function superWrapper() {\n var ret, sup = this.__nextSuper;\n this.__nextSuper = superFunc;\n ret = apply(this, func, arguments);\n this.__nextSuper = sup;\n return ret;\n }\n\n superWrapper.wrappedFunction = func;\n superWrapper.wrappedFunction.__ember_arity__ = func.length;\n superWrapper.__ember_observes__ = func.__ember_observes__;\n superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__;\n superWrapper.__ember_listens__ = func.__ember_listens__;\n\n return superWrapper;\n };\n\n var EmberArray;\n\n /**\n Returns true if the passed object is an array or Array-like.\n\n Ember Array Protocol:\n\n - the object has an objectAt property\n - the object is a native Array\n - the object is an Object, and has a length property\n\n Unlike `Ember.typeOf` this method returns true even if the passed object is\n not formally array but appears to be array-like (i.e. implements `Ember.Array`)\n\n ```javascript\n Ember.isArray(); // false\n Ember.isArray([]); // true\n Ember.isArray(Ember.ArrayProxy.create({ content: [] })); // true\n ```\n\n @method isArray\n @for Ember\n @param {Object} obj The object to test\n @return {Boolean} true if the passed object is an array or Array-like\n */\n // ES6TODO: Move up to runtime? This is only use in ember-metal by concatenatedProperties\n function isArray(obj) {\n var modulePath, type;\n\n if (typeof EmberArray === \"undefined\") {\n modulePath = 'ember-runtime/mixins/array';\n if (requirejs._eak_seen[modulePath]) {\n EmberArray = requireModule(modulePath)['default'];\n }\n }\n\n if (!obj || obj.setInterval) { return false; }\n if (Array.isArray && Array.isArray(obj)) { return true; }\n if (EmberArray && EmberArray.detect(obj)) { return true; }\n\n type = typeOf(obj);\n if ('array' === type) { return true; }\n if ((obj.length !== undefined) && 'object' === type) { return true; }\n return false;\n };\n\n /**\n Forces the passed object to be part of an array. If the object is already\n an array or array-like, returns the object. Otherwise adds the object to\n an array. If obj is `null` or `undefined`, returns an empty array.\n\n ```javascript\n Ember.makeArray(); // []\n Ember.makeArray(null); // []\n Ember.makeArray(undefined); // []\n Ember.makeArray('lindsay'); // ['lindsay']\n Ember.makeArray([1, 2, 42]); // [1, 2, 42]\n\n var controller = Ember.ArrayProxy.create({ content: [] });\n\n Ember.makeArray(controller) === controller; // true\n ```\n\n @method makeArray\n @for Ember\n @param {Object} obj the object\n @return {Array}\n */\n function makeArray(obj) {\n if (obj === null || obj === undefined) { return []; }\n return isArray(obj) ? obj : [obj];\n };\n\n /**\n Checks to see if the `methodName` exists on the `obj`.\n\n ```javascript\n var foo = { bar: Ember.K, baz: null };\n\n Ember.canInvoke(foo, 'bar'); // true\n Ember.canInvoke(foo, 'baz'); // false\n Ember.canInvoke(foo, 'bat'); // false\n ```\n\n @method canInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @return {Boolean}\n */\n function canInvoke(obj, methodName) {\n return !!(obj && typeof obj[methodName] === 'function');\n }\n\n /**\n Checks to see if the `methodName` exists on the `obj`,\n and if it does, invokes it with the arguments passed.\n\n ```javascript\n var d = new Date('03/15/2013');\n\n Ember.tryInvoke(d, 'getTime'); // 1363320000000\n Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000\n Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined\n ```\n\n @method tryInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @param {Array} [args] The arguments to pass to the method\n @return {*} the return value of the invoked method or undefined if it cannot be invoked\n */\n function tryInvoke(obj, methodName, args) {\n if (canInvoke(obj, methodName)) {\n return args ? applyStr(obj, methodName, args) : applyStr(obj, methodName);\n }\n };\n\n // https://github.com/emberjs/ember.js/pull/1617\n var needsFinallyFix = (function() {\n var count = 0;\n try{\n try { }\n finally {\n count++;\n throw new Error('needsFinallyFixTest');\n }\n } catch (e) {}\n\n return count !== 1;\n })();\n\n /**\n Provides try/finally functionality, while working\n around Safari's double finally bug.\n\n ```javascript\n var tryable = function() {\n someResource.lock();\n runCallback(); // May throw error.\n };\n\n var finalizer = function() {\n someResource.unlock();\n };\n\n Ember.tryFinally(tryable, finalizer);\n ```\n\n @method tryFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} finalizer The function to run the finally callback\n @param {Object} [binding] The optional calling object. Defaults to 'this'\n @return {*} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable\n */\n\n var tryFinally;\n if (needsFinallyFix) {\n tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e) {\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n } else {\n tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n }\n\n /**\n Provides try/catch/finally functionality, while working\n around Safari's double finally bug.\n\n ```javascript\n var tryable = function() {\n for (i = 0, l = listeners.length; i < l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n };\n\n var catchable = function(e) {\n payload = payload || {};\n payload.exception = e;\n };\n\n var finalizer = function() {\n for (i = 0, l = listeners.length; i < l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n };\n\n Ember.tryCatchFinally(tryable, catchable, finalizer);\n ```\n\n @method tryCatchFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} catchable The function to run the catchable callback\n @param {Function} finalizer The function to run the finally callback\n @param {Object} [binding] The optional calling object. Defaults to 'this'\n @return {*} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable.\n */\n var tryCatchFinally;\n if (needsFinallyFix) {\n tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e) {\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n } else {\n tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n }\n\n // ........................................\n // TYPING & ARRAY MESSAGING\n //\n\n var TYPE_MAP = {};\n var t = \"Boolean Number String Function Array Date RegExp Object\".split(\" \");\n forEach.call(t, function(name) {\n TYPE_MAP[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n });\n\n var toString = Object.prototype.toString;\n\n var EmberObject;\n\n /**\n Returns a consistent type for the passed item.\n\n Use this instead of the built-in `typeof` to get the type of an item.\n It will return the same result across all browsers and includes a bit\n more detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive or String object. |\n | 'number' | Number primitive or Number object. |\n | 'boolean' | Boolean primitive or Boolean object. |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'regexp' | An instance of RegExp |\n | 'date' | An instance of Date |\n | 'class' | An Ember class (created using Ember.Object.extend()) |\n | 'instance' | An Ember object instance |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object not inheriting from Ember.Object |\n\n Examples:\n\n ```javascript\n Ember.typeOf(); // 'undefined'\n Ember.typeOf(null); // 'null'\n Ember.typeOf(undefined); // 'undefined'\n Ember.typeOf('michael'); // 'string'\n Ember.typeOf(new String('michael')); // 'string'\n Ember.typeOf(101); // 'number'\n Ember.typeOf(new Number(101)); // 'number'\n Ember.typeOf(true); // 'boolean'\n Ember.typeOf(new Boolean(true)); // 'boolean'\n Ember.typeOf(Ember.makeArray); // 'function'\n Ember.typeOf([1, 2, 90]); // 'array'\n Ember.typeOf(/abc/); // 'regexp'\n Ember.typeOf(new Date()); // 'date'\n Ember.typeOf(Ember.Object.extend()); // 'class'\n Ember.typeOf(Ember.Object.create()); // 'instance'\n Ember.typeOf(new Error('teamocil')); // 'error'\n\n // 'normal' JavaScript object\n Ember.typeOf({ a: 'b' }); // 'object'\n ```\n\n @method typeOf\n @for Ember\n @param {Object} item the item to check\n @return {String} the type\n */\n function typeOf(item) {\n var ret, modulePath;\n\n // ES6TODO: Depends on Ember.Object which is defined in runtime.\n if (typeof EmberObject === \"undefined\") {\n modulePath = 'ember-runtime/system/object';\n if (requirejs._eak_seen[modulePath]) {\n EmberObject = requireModule(modulePath)['default'];\n }\n }\n\n ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object';\n\n if (ret === 'function') {\n if (EmberObject && EmberObject.detect(item)) ret = 'class';\n } else if (ret === 'object') {\n if (item instanceof Error) ret = 'error';\n else if (EmberObject && item instanceof EmberObject) ret = 'instance';\n else if (item instanceof Date) ret = 'date';\n }\n\n return ret;\n };\n\n /**\n Convenience method to inspect an object. This method will attempt to\n convert the object into a useful string description.\n\n It is a pretty simple implementation. If you want something more robust,\n use something like JSDump: https://github.com/NV/jsDump\n\n @method inspect\n @for Ember\n @param {Object} obj The object you want to inspect.\n @return {String} A description of the object\n @since 1.4.0\n */\n function inspect(obj) {\n var type = typeOf(obj);\n if (type === 'array') {\n return '[' + obj + ']';\n }\n if (type !== 'object') {\n return obj + '';\n }\n\n var v, ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) {\n v = obj[key];\n if (v === 'toString') { continue; } // ignore useless items\n if (typeOf(v) === 'function') { v = \"function() { ... }\"; }\n ret.push(key + \": \" + v);\n }\n }\n return \"{\" + ret.join(\", \") + \"}\";\n };\n\n // The following functions are intentionally minified to keep the functions\n // below Chrome's function body size inlining limit of 600 chars.\n\n function apply(t /* target */, m /* method */, a /* args */) {\n var l = a && a.length;\n if (!a || !l) { return m.call(t); }\n switch (l) {\n case 1: return m.call(t, a[0]);\n case 2: return m.call(t, a[0], a[1]);\n case 3: return m.call(t, a[0], a[1], a[2]);\n case 4: return m.call(t, a[0], a[1], a[2], a[3]);\n case 5: return m.call(t, a[0], a[1], a[2], a[3], a[4]);\n default: return m.apply(t, a);\n }\n };\n\n function applyStr(t /* target */, m /* method */, a /* args */) {\n var l = a && a.length;\n if (!a || !l) { return t[m](); }\n switch (l) {\n case 1: return t[m](a[0]);\n case 2: return t[m](a[0], a[1]);\n case 3: return t[m](a[0], a[1], a[2]);\n case 4: return t[m](a[0], a[1], a[2], a[3]);\n case 5: return t[m](a[0], a[1], a[2], a[3], a[4]);\n default: return t[m].apply(t, a);\n }\n };\n\n __exports__.generateGuid = generateGuid;\n __exports__.GUID_KEY = GUID_KEY;\n __exports__.GUID_PREFIX = GUID_PREFIX;\n __exports__.guidFor = guidFor;\n __exports__.META_DESC = META_DESC;\n __exports__.EMPTY_META = EMPTY_META;\n __exports__.META_KEY = META_KEY;\n __exports__.meta = meta;\n __exports__.getMeta = getMeta;\n __exports__.setMeta = setMeta;\n __exports__.metaPath = metaPath;\n __exports__.inspect = inspect;\n __exports__.typeOf = typeOf;\n __exports__.tryCatchFinally = tryCatchFinally;\n __exports__.isArray = isArray;\n __exports__.makeArray = makeArray;\n __exports__.canInvoke = canInvoke;\n __exports__.tryInvoke = tryInvoke;\n __exports__.tryFinally = tryFinally;\n __exports__.wrap = wrap;\n __exports__.applyStr = applyStr;\n __exports__.apply = apply;\n });\ndefine(\"backburner\",\n [\"backburner/utils\",\"backburner/deferred_action_queues\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Utils = __dependency1__[\"default\"];\n var DeferredActionQueues = __dependency2__.DeferredActionQueues;\n\n var slice = [].slice,\n pop = [].pop,\n each = Utils.each,\n isString = Utils.isString,\n isFunction = Utils.isFunction,\n isNumber = Utils.isNumber,\n timers = [],\n global = this,\n NUMBER = /\\d+/;\n\n // In IE 6-8, try/finally doesn't work without a catch.\n // Unfortunately, this is impossible to test for since wrapping it in a parent try/catch doesn't trigger the bug.\n // This tests for another broken try/catch behavior that only exhibits in the same versions of IE.\n var needsIETryCatchFix = (function(e,x){\n try{ x(); }\n catch(e) { } // jshint ignore:line\n return !!e;\n })();\n\n function isCoercableNumber(number) {\n return isNumber(number) || NUMBER.test(number);\n }\n\n function Backburner(queueNames, options) {\n this.queueNames = queueNames;\n this.options = options || {};\n if (!this.options.defaultQueue) {\n this.options.defaultQueue = queueNames[0];\n }\n this.instanceStack = [];\n this._debouncees = [];\n this._throttlers = [];\n }\n\n Backburner.prototype = {\n queueNames: null,\n options: null,\n currentInstance: null,\n instanceStack: null,\n\n begin: function() {\n var options = this.options,\n onBegin = options && options.onBegin,\n previousInstance = this.currentInstance;\n\n if (previousInstance) {\n this.instanceStack.push(previousInstance);\n }\n\n this.currentInstance = new DeferredActionQueues(this.queueNames, options);\n if (onBegin) {\n onBegin(this.currentInstance, previousInstance);\n }\n },\n\n end: function() {\n var options = this.options,\n onEnd = options && options.onEnd,\n currentInstance = this.currentInstance,\n nextInstance = null;\n\n // Prevent double-finally bug in Safari 6.0.2 and iOS 6\n // This bug appears to be resolved in Safari 6.0.5 and iOS 7\n var finallyAlreadyCalled = false;\n try {\n currentInstance.flush();\n } finally {\n if (!finallyAlreadyCalled) {\n finallyAlreadyCalled = true;\n\n this.currentInstance = null;\n\n if (this.instanceStack.length) {\n nextInstance = this.instanceStack.pop();\n this.currentInstance = nextInstance;\n }\n\n if (onEnd) {\n onEnd(currentInstance, nextInstance);\n }\n }\n }\n },\n\n run: function(target, method /*, args */) {\n var onError = getOnError(this.options);\n\n this.begin();\n\n if (!method) {\n method = target;\n target = null;\n }\n\n if (isString(method)) {\n method = target[method];\n }\n\n var args = slice.call(arguments, 2);\n\n // guard against Safari 6's double-finally bug\n var didFinally = false;\n\n if (onError) {\n try {\n return method.apply(target, args);\n } catch(error) {\n onError(error);\n } finally {\n if (!didFinally) {\n didFinally = true;\n this.end();\n }\n }\n } else {\n try {\n return method.apply(target, args);\n } finally {\n if (!didFinally) {\n didFinally = true;\n this.end();\n }\n }\n }\n },\n\n defer: function(queueName, target, method /* , args */) {\n if (!method) {\n method = target;\n target = null;\n }\n\n if (isString(method)) {\n method = target[method];\n }\n\n var stack = this.DEBUG ? new Error() : undefined,\n args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;\n if (!this.currentInstance) { createAutorun(this); }\n return this.currentInstance.schedule(queueName, target, method, args, false, stack);\n },\n\n deferOnce: function(queueName, target, method /* , args */) {\n if (!method) {\n method = target;\n target = null;\n }\n\n if (isString(method)) {\n method = target[method];\n }\n\n var stack = this.DEBUG ? new Error() : undefined,\n args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;\n if (!this.currentInstance) { createAutorun(this); }\n return this.currentInstance.schedule(queueName, target, method, args, true, stack);\n },\n\n setTimeout: function() {\n var args = slice.call(arguments),\n length = args.length,\n method, wait, target,\n methodOrTarget, methodOrWait, methodOrArgs;\n\n if (length === 0) {\n return;\n } else if (length === 1) {\n method = args.shift();\n wait = 0;\n } else if (length === 2) {\n methodOrTarget = args[0];\n methodOrWait = args[1];\n\n if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) {\n target = args.shift();\n method = args.shift();\n wait = 0;\n } else if (isCoercableNumber(methodOrWait)) {\n method = args.shift();\n wait = args.shift();\n } else {\n method = args.shift();\n wait = 0;\n }\n } else {\n var last = args[args.length - 1];\n\n if (isCoercableNumber(last)) {\n wait = args.pop();\n } else {\n wait = 0;\n }\n\n methodOrTarget = args[0];\n methodOrArgs = args[1];\n\n if (isFunction(methodOrArgs) || (isString(methodOrArgs) &&\n methodOrTarget !== null &&\n methodOrArgs in methodOrTarget)) {\n target = args.shift();\n method = args.shift();\n } else {\n method = args.shift();\n }\n }\n\n var executeAt = (+new Date()) + parseInt(wait, 10);\n\n if (isString(method)) {\n method = target[method];\n }\n\n var onError = getOnError(this.options);\n\n function fn() {\n if (onError) {\n try {\n method.apply(target, args);\n } catch (e) {\n onError(e);\n }\n } else {\n method.apply(target, args);\n }\n }\n\n // find position to insert\n var i = searchTimer(executeAt, timers);\n\n timers.splice(i, 0, executeAt, fn);\n\n updateLaterTimer(this, executeAt, wait);\n\n return fn;\n },\n\n throttle: function(target, method /* , args, wait, [immediate] */) {\n var self = this,\n args = arguments,\n immediate = pop.call(args),\n wait,\n throttler,\n index,\n timer;\n\n if (isNumber(immediate) || isString(immediate)) {\n wait = immediate;\n immediate = true;\n } else {\n wait = pop.call(args);\n }\n\n wait = parseInt(wait, 10);\n\n index = findThrottler(target, method, this._throttlers);\n if (index > -1) { return this._throttlers[index]; } // throttled\n\n timer = global.setTimeout(function() {\n if (!immediate) {\n self.run.apply(self, args);\n }\n var index = findThrottler(target, method, self._throttlers);\n if (index > -1) {\n self._throttlers.splice(index, 1);\n }\n }, wait);\n\n if (immediate) {\n self.run.apply(self, args);\n }\n\n throttler = [target, method, timer];\n\n this._throttlers.push(throttler);\n\n return throttler;\n },\n\n debounce: function(target, method /* , args, wait, [immediate] */) {\n var self = this,\n args = arguments,\n immediate = pop.call(args),\n wait,\n index,\n debouncee,\n timer;\n\n if (isNumber(immediate) || isString(immediate)) {\n wait = immediate;\n immediate = false;\n } else {\n wait = pop.call(args);\n }\n\n wait = parseInt(wait, 10);\n // Remove debouncee\n index = findDebouncee(target, method, this._debouncees);\n\n if (index > -1) {\n debouncee = this._debouncees[index];\n this._debouncees.splice(index, 1);\n clearTimeout(debouncee[2]);\n }\n\n timer = global.setTimeout(function() {\n if (!immediate) {\n self.run.apply(self, args);\n }\n var index = findDebouncee(target, method, self._debouncees);\n if (index > -1) {\n self._debouncees.splice(index, 1);\n }\n }, wait);\n\n if (immediate && index === -1) {\n self.run.apply(self, args);\n }\n\n debouncee = [target, method, timer];\n\n self._debouncees.push(debouncee);\n\n return debouncee;\n },\n\n cancelTimers: function() {\n var clearItems = function(item) {\n clearTimeout(item[2]);\n };\n\n each(this._throttlers, clearItems);\n this._throttlers = [];\n\n each(this._debouncees, clearItems);\n this._debouncees = [];\n\n if (this._laterTimer) {\n clearTimeout(this._laterTimer);\n this._laterTimer = null;\n }\n timers = [];\n\n if (this._autorun) {\n clearTimeout(this._autorun);\n this._autorun = null;\n }\n },\n\n hasTimers: function() {\n return !!timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun;\n },\n\n cancel: function(timer) {\n var timerType = typeof timer;\n\n if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce\n return timer.queue.cancel(timer);\n } else if (timerType === 'function') { // we're cancelling a setTimeout\n for (var i = 0, l = timers.length; i < l; i += 2) {\n if (timers[i + 1] === timer) {\n timers.splice(i, 2); // remove the two elements\n return true;\n }\n }\n } else if (Object.prototype.toString.call(timer) === \"[object Array]\"){ // we're cancelling a throttle or debounce\n return this._cancelItem(findThrottler, this._throttlers, timer) ||\n this._cancelItem(findDebouncee, this._debouncees, timer);\n } else {\n return; // timer was null or not a timer\n }\n },\n\n _cancelItem: function(findMethod, array, timer){\n var item,\n index;\n\n if (timer.length < 3) { return false; }\n\n index = findMethod(timer[0], timer[1], array);\n\n if(index > -1) {\n\n item = array[index];\n\n if(item[2] === timer[2]){\n array.splice(index, 1);\n clearTimeout(timer[2]);\n return true;\n }\n }\n\n return false;\n }\n };\n\n Backburner.prototype.schedule = Backburner.prototype.defer;\n Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce;\n Backburner.prototype.later = Backburner.prototype.setTimeout;\n\n if (needsIETryCatchFix) {\n var originalRun = Backburner.prototype.run;\n Backburner.prototype.run = wrapInTryCatch(originalRun);\n\n var originalEnd = Backburner.prototype.end;\n Backburner.prototype.end = wrapInTryCatch(originalEnd);\n }\n\n function wrapInTryCatch(func) {\n return function () {\n try {\n return func.apply(this, arguments);\n } catch (e) {\n throw e;\n }\n };\n }\n\n function getOnError(options) {\n return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]);\n }\n\n\n function createAutorun(backburner) {\n backburner.begin();\n backburner._autorun = global.setTimeout(function() {\n backburner._autorun = null;\n backburner.end();\n });\n }\n\n function updateLaterTimer(self, executeAt, wait) {\n if (!self._laterTimer || executeAt < self._laterTimerExpiresAt) {\n self._laterTimer = global.setTimeout(function() {\n self._laterTimer = null;\n self._laterTimerExpiresAt = null;\n executeTimers(self);\n }, wait);\n self._laterTimerExpiresAt = executeAt;\n }\n }\n\n function executeTimers(self) {\n var now = +new Date(),\n time, fns, i, l;\n\n self.run(function() {\n i = searchTimer(now, timers);\n\n fns = timers.splice(0, i);\n\n for (i = 1, l = fns.length; i < l; i += 2) {\n self.schedule(self.options.defaultQueue, null, fns[i]);\n }\n });\n\n if (timers.length) {\n updateLaterTimer(self, timers[0], timers[0] - now);\n }\n }\n\n function findDebouncee(target, method, debouncees) {\n return findItem(target, method, debouncees);\n }\n\n function findThrottler(target, method, throttlers) {\n return findItem(target, method, throttlers);\n }\n\n function findItem(target, method, collection) {\n var item,\n index = -1;\n\n for (var i = 0, l = collection.length; i < l; i++) {\n item = collection[i];\n if (item[0] === target && item[1] === method) {\n index = i;\n break;\n }\n }\n\n return index;\n }\n\n function searchTimer(time, timers) {\n var start = 0,\n end = timers.length - 2,\n middle, l;\n\n while (start < end) {\n // since timers is an array of pairs 'l' will always\n // be an integer\n l = (end - start) / 2;\n\n // compensate for the index in case even number\n // of pairs inside timers\n middle = start + l - (l % 2);\n\n if (time >= timers[middle]) {\n start = middle + 2;\n } else {\n end = middle;\n }\n }\n\n return (time >= timers[start]) ? start + 2 : start;\n }\n\n __exports__.Backburner = Backburner;\n });\ndefine(\"backburner/deferred_action_queues\",\n [\"backburner/utils\",\"backburner/queue\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Utils = __dependency1__[\"default\"];\n var Queue = __dependency2__.Queue;\n\n var each = Utils.each,\n isString = Utils.isString;\n\n function DeferredActionQueues(queueNames, options) {\n var queues = this.queues = {};\n this.queueNames = queueNames = queueNames || [];\n\n this.options = options;\n\n each(queueNames, function(queueName) {\n queues[queueName] = new Queue(this, queueName, options);\n });\n }\n\n DeferredActionQueues.prototype = {\n queueNames: null,\n queues: null,\n options: null,\n\n schedule: function(queueName, target, method, args, onceFlag, stack) {\n var queues = this.queues,\n queue = queues[queueName];\n\n if (!queue) { throw new Error(\"You attempted to schedule an action in a queue (\" + queueName + \") that doesn't exist\"); }\n\n if (onceFlag) {\n return queue.pushUnique(target, method, args, stack);\n } else {\n return queue.push(target, method, args, stack);\n }\n },\n\n invoke: function(target, method, args, _) {\n if (args && args.length > 0) {\n method.apply(target, args);\n } else {\n method.call(target);\n }\n },\n\n invokeWithOnError: function(target, method, args, onError) {\n try {\n if (args && args.length > 0) {\n method.apply(target, args);\n } else {\n method.call(target);\n }\n } catch(error) {\n onError(error);\n }\n },\n\n flush: function() {\n var queues = this.queues,\n queueNames = this.queueNames,\n queueName, queue, queueItems, priorQueueNameIndex,\n queueNameIndex = 0, numberOfQueues = queueNames.length,\n options = this.options,\n onError = options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]),\n invoke = onError ? this.invokeWithOnError : this.invoke;\n\n outerloop:\n while (queueNameIndex < numberOfQueues) {\n queueName = queueNames[queueNameIndex];\n queue = queues[queueName];\n queueItems = queue._queueBeingFlushed = queue._queue.slice();\n queue._queue = [];\n\n var queueOptions = queue.options, // TODO: write a test for this\n before = queueOptions && queueOptions.before,\n after = queueOptions && queueOptions.after,\n target, method, args, stack,\n queueIndex = 0, numberOfQueueItems = queueItems.length;\n\n if (numberOfQueueItems && before) { before(); }\n\n while (queueIndex < numberOfQueueItems) {\n target = queueItems[queueIndex];\n method = queueItems[queueIndex+1];\n args = queueItems[queueIndex+2];\n stack = queueItems[queueIndex+3]; // Debugging assistance\n\n if (isString(method)) { method = target[method]; }\n\n // method could have been nullified / canceled during flush\n if (method) {\n invoke(target, method, args, onError);\n }\n\n queueIndex += 4;\n }\n\n queue._queueBeingFlushed = null;\n if (numberOfQueueItems && after) { after(); }\n\n if ((priorQueueNameIndex = indexOfPriorQueueWithActions(this, queueNameIndex)) !== -1) {\n queueNameIndex = priorQueueNameIndex;\n continue outerloop;\n }\n\n queueNameIndex++;\n }\n }\n };\n\n function indexOfPriorQueueWithActions(daq, currentQueueIndex) {\n var queueName, queue;\n\n for (var i = 0, l = currentQueueIndex; i <= l; i++) {\n queueName = daq.queueNames[i];\n queue = daq.queues[queueName];\n if (queue._queue.length) { return i; }\n }\n\n return -1;\n }\n\n __exports__.DeferredActionQueues = DeferredActionQueues;\n });\ndefine(\"backburner/queue\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n function Queue(daq, name, options) {\n this.daq = daq;\n this.name = name;\n this.globalOptions = options;\n this.options = options[name];\n this._queue = [];\n }\n\n Queue.prototype = {\n daq: null,\n name: null,\n options: null,\n onError: null,\n _queue: null,\n\n push: function(target, method, args, stack) {\n var queue = this._queue;\n queue.push(target, method, args, stack);\n return {queue: this, target: target, method: method};\n },\n\n pushUnique: function(target, method, args, stack) {\n var queue = this._queue, currentTarget, currentMethod, i, l;\n\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === target && currentMethod === method) {\n queue[i+2] = args; // replace args\n queue[i+3] = stack; // replace stack\n return {queue: this, target: target, method: method};\n }\n }\n\n queue.push(target, method, args, stack);\n return {queue: this, target: target, method: method};\n },\n\n // TODO: remove me, only being used for Ember.run.sync\n flush: function() {\n var queue = this._queue,\n globalOptions = this.globalOptions,\n options = this.options,\n before = options && options.before,\n after = options && options.after,\n onError = globalOptions.onError || (globalOptions.onErrorTarget && globalOptions.onErrorTarget[globalOptions.onErrorMethod]),\n target, method, args, stack, i, l = queue.length;\n\n if (l && before) { before(); }\n for (i = 0; i < l; i += 4) {\n target = queue[i];\n method = queue[i+1];\n args = queue[i+2];\n stack = queue[i+3]; // Debugging assistance\n\n // TODO: error handling\n if (args && args.length > 0) {\n if (onError) {\n try {\n method.apply(target, args);\n } catch (e) {\n onError(e);\n }\n } else {\n method.apply(target, args);\n }\n } else {\n if (onError) {\n try {\n method.call(target);\n } catch(e) {\n onError(e);\n }\n } else {\n method.call(target);\n }\n }\n }\n if (l && after) { after(); }\n\n // check if new items have been added\n if (queue.length > l) {\n this._queue = queue.slice(l);\n this.flush();\n } else {\n this._queue.length = 0;\n }\n },\n\n cancel: function(actionToCancel) {\n var queue = this._queue, currentTarget, currentMethod, i, l;\n\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === actionToCancel.target && currentMethod === actionToCancel.method) {\n queue.splice(i, 4);\n return true;\n }\n }\n\n // if not found in current queue\n // could be in the queue that is being flushed\n queue = this._queueBeingFlushed;\n if (!queue) {\n return;\n }\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === actionToCancel.target && currentMethod === actionToCancel.method) {\n // don't mess with array during flush\n // just nullify the method\n queue[i+1] = null;\n return true;\n }\n }\n }\n };\n\n __exports__.Queue = Queue;\n });\ndefine(\"backburner/utils\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = {\n each: function(collection, callback) {\n for (var i = 0; i < collection.length; i++) {\n callback(collection[i]);\n }\n },\n\n isString: function(suspect) {\n return typeof suspect === 'string';\n },\n\n isFunction: function(suspect) {\n return typeof suspect === 'function';\n },\n\n isNumber: function(suspect) {\n return typeof suspect === 'number';\n }\n };\n });\n\ndefine(\"ember-metal/watch_key\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var meta = __dependency2__.meta;\n var typeOf = __dependency2__.typeOf;\n var platform = __dependency3__.platform;\n\n var metaFor = meta, // utils.js\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n o_defineProperty = platform.defineProperty;\n\n function watchKey(obj, keyName, meta) {\n // can't watch length on Array - it is special...\n if (keyName === 'length' && typeOf(obj) === 'array') { return; }\n\n var m = meta || metaFor(obj), watching = m.watching;\n\n // activate watching first time\n if (!watching[keyName]) {\n watching[keyName] = 1;\n\n if ('function' === typeof obj.willWatchProperty) {\n obj.willWatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n m.values[keyName] = obj[keyName];\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: obj.propertyIsEnumerable(keyName),\n set: Ember.MANDATORY_SETTER_FUNCTION,\n get: Ember.DEFAULT_GETTER_FUNCTION(keyName)\n });\n }\n } else {\n watching[keyName] = (watching[keyName] || 0) + 1;\n }\n };\n\n function unwatchKey(obj, keyName, meta) {\n var m = meta || metaFor(obj), watching = m.watching;\n\n if (watching[keyName] === 1) {\n watching[keyName] = 0;\n\n if ('function' === typeof obj.didUnwatchProperty) {\n obj.didUnwatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: obj.propertyIsEnumerable(keyName),\n set: function(val) {\n // redefine to set as enumerable\n o_defineProperty(obj, keyName, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: val\n });\n delete m.values[keyName];\n },\n get: Ember.DEFAULT_GETTER_FUNCTION(keyName)\n });\n }\n } else if (watching[keyName] > 1) {\n watching[keyName]--;\n }\n };\n\n __exports__.watchKey = watchKey;\n __exports__.unwatchKey = unwatchKey;\n });\ndefine(\"ember-metal/watch_path\",\n [\"ember-metal/utils\",\"ember-metal/chains\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var meta = __dependency1__.meta;\n var typeOf = __dependency1__.typeOf;\n var ChainNode = __dependency2__.ChainNode;\n\n var metaFor = meta;\n\n // get the chains for the current object. If the current object has\n // chains inherited from the proto they will be cloned and reconfigured for\n // the current object.\n function chainsFor(obj, meta) {\n var m = meta || metaFor(obj), ret = m.chains;\n if (!ret) {\n ret = m.chains = new ChainNode(null, null, obj);\n } else if (ret.value() !== obj) {\n ret = m.chains = ret.copy(obj);\n }\n return ret;\n }\n\n function watchPath(obj, keyPath, meta) {\n // can't watch length on Array - it is special...\n if (keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n var m = meta || metaFor(obj), watching = m.watching;\n\n if (!watching[keyPath]) { // activate watching first time\n watching[keyPath] = 1;\n chainsFor(obj, m).add(keyPath);\n } else {\n watching[keyPath] = (watching[keyPath] || 0) + 1;\n }\n };\n\n function unwatchPath(obj, keyPath, meta) {\n var m = meta || metaFor(obj), watching = m.watching;\n\n if (watching[keyPath] === 1) {\n watching[keyPath] = 0;\n chainsFor(obj, m).remove(keyPath);\n } else if (watching[keyPath] > 1) {\n watching[keyPath]--;\n }\n };\n\n __exports__.watchPath = watchPath;\n __exports__.unwatchPath = unwatchPath;\n });\ndefine(\"ember-metal/watching\",\n [\"ember-metal/utils\",\"ember-metal/chains\",\"ember-metal/watch_key\",\"ember-metal/watch_path\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n\n var meta = __dependency1__.meta;\n var META_KEY = __dependency1__.META_KEY;\n var GUID_KEY = __dependency1__.GUID_KEY;\n var typeOf = __dependency1__.typeOf;\n var generateGuid = __dependency1__.generateGuid;\n var removeChainWatcher = __dependency2__.removeChainWatcher;\n var flushPendingChains = __dependency2__.flushPendingChains;\n var watchKey = __dependency3__.watchKey;\n var unwatchKey = __dependency3__.unwatchKey;\n var watchPath = __dependency4__.watchPath;\n var unwatchPath = __dependency4__.unwatchPath;\n\n var metaFor = meta; // utils.js\n\n // returns true if the passed path is just a keyName\n function isKeyName(path) {\n return path.indexOf('.') === -1;\n }\n\n /**\n Starts watching a property on an object. Whenever the property changes,\n invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the\n primitive used by observers and dependent keys; usually you will never call\n this method directly but instead use higher level methods like\n `Ember.addObserver()`\n\n @private\n @method watch\n @for Ember\n @param obj\n @param {String} keyName\n */\n function watch(obj, _keyPath, m) {\n // can't watch length on Array - it is special...\n if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n if (isKeyName(_keyPath)) {\n watchKey(obj, _keyPath, m);\n } else {\n watchPath(obj, _keyPath, m);\n }\n };\n\n function isWatching(obj, key) {\n var meta = obj[META_KEY];\n return (meta && meta.watching[key]) > 0;\n };\n\n watch.flushPending = flushPendingChains;\n\n function unwatch(obj, _keyPath, m) {\n // can't watch length on Array - it is special...\n if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n if (isKeyName(_keyPath)) {\n unwatchKey(obj, _keyPath, m);\n } else {\n unwatchPath(obj, _keyPath, m);\n }\n };\n\n /**\n Call on an object when you first beget it from another object. This will\n setup any chained watchers on the object instance as needed. This method is\n safe to call multiple times.\n\n @private\n @method rewatch\n @for Ember\n @param obj\n */\n function rewatch(obj) {\n var m = obj[META_KEY], chains = m && m.chains;\n\n // make sure the object has its own guid.\n if (GUID_KEY in obj && !obj.hasOwnProperty(GUID_KEY)) {\n generateGuid(obj);\n }\n\n // make sure any chained watchers update.\n if (chains && chains.value() !== obj) {\n m.chains = chains.copy(obj);\n }\n };\n\n var NODE_STACK = [];\n\n /**\n Tears down the meta on an object so that it can be garbage collected.\n Multiple calls will have no effect.\n\n @method destroy\n @for Ember\n @param {Object} obj the object to destroy\n @return {void}\n */\n function destroy(obj) {\n var meta = obj[META_KEY], node, nodes, key, nodeObject;\n if (meta) {\n obj[META_KEY] = null;\n // remove chainWatchers to remove circular references that would prevent GC\n node = meta.chains;\n if (node) {\n NODE_STACK.push(node);\n // process tree\n while (NODE_STACK.length > 0) {\n node = NODE_STACK.pop();\n // push children\n nodes = node._chains;\n if (nodes) {\n for (key in nodes) {\n if (nodes.hasOwnProperty(key)) {\n NODE_STACK.push(nodes[key]);\n }\n }\n }\n // remove chainWatcher in node object\n if (node._watching) {\n nodeObject = node._object;\n if (nodeObject) {\n removeChainWatcher(nodeObject, node._key, node);\n }\n }\n }\n }\n }\n };\n\n __exports__.watch = watch;\n __exports__.isWatching = isWatching;\n __exports__.unwatch = unwatch;\n __exports__.rewatch = rewatch;\n __exports__.destroy = destroy;\n });\n})();\n//@ sourceURL=ember-metal");minispade.register('ember-routing', "(function() {minispade.require(\"ember-handlebars\");\nminispade.require(\"ember-views\");\nminispade.require(\"ember-runtime\");\ndefine(\"ember-routing/ext/controller\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/enumerable_utils\",\"ember-runtime/controllers/controller\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, deprecate\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EnumerableUtils = __dependency4__[\"default\"];\n var map = EnumerableUtils.map;\n\n var ControllerMixin = __dependency5__.ControllerMixin;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n\n ControllerMixin.reopen({\n /**\n Transition the application into another route. The route may\n be either a single route or route path:\n\n ```javascript\n aController.transitionToRoute('blogPosts');\n aController.transitionToRoute('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n aController.transitionToRoute('blogPost', aPost);\n ```\n\n If a literal is passed (such as a number or a string), it will\n be treated as an identifier instead. In this case, the `model`\n hook of the route will be triggered:\n\n ```javascript\n aController.transitionToRoute('blogPost', 1);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n App.Router.map(function() {\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n });\n\n aController.transitionToRoute('blogComment', aPost, aComment);\n aController.transitionToRoute('blogComment', 1, 13);\n ```\n\n It is also possible to pass a URL (a string that starts with a\n `/`). This is intended for testing and debugging purposes and\n should rarely be used in production code.\n\n ```javascript\n aController.transitionToRoute('/');\n aController.transitionToRoute('/blog/post/1/comment/13');\n ```\n\n See also [replaceRoute](/api/classes/Ember.ControllerMixin.html#method_replaceRoute).\n\n @param {String} name the name of the route or a URL\n @param {...Object} models the model(s) or identifier(s) to be used\n while transitioning to the route.\n @for Ember.ControllerMixin\n @method transitionToRoute\n */\n transitionToRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.transitionToRoute || target.transitionTo;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method transitionTo\n */\n transitionTo: function() {\n Ember.deprecate(\"transitionTo is deprecated. Please use transitionToRoute.\");\n return this.transitionToRoute.apply(this, arguments);\n },\n\n /**\n Transition into another route while replacing the current URL, if possible.\n This will replace the current history entry instead of adding a new one.\n Beside that, it is identical to `transitionToRoute` in all other respects.\n\n ```javascript\n aController.replaceRoute('blogPosts');\n aController.replaceRoute('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n aController.replaceRoute('blogPost', aPost);\n ```\n\n If a literal is passed (such as a number or a string), it will\n be treated as an identifier instead. In this case, the `model`\n hook of the route will be triggered:\n\n ```javascript\n aController.replaceRoute('blogPost', 1);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n App.Router.map(function() {\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n });\n\n aController.replaceRoute('blogComment', aPost, aComment);\n aController.replaceRoute('blogComment', 1, 13);\n ```\n\n It is also possible to pass a URL (a string that starts with a\n `/`). This is intended for testing and debugging purposes and\n should rarely be used in production code.\n\n ```javascript\n aController.replaceRoute('/');\n aController.replaceRoute('/blog/post/1/comment/13');\n ```\n\n @param {String} name the name of the route or a URL\n @param {...Object} models the model(s) or identifier(s) to be used\n while transitioning to the route.\n @for Ember.ControllerMixin\n @method replaceRoute\n */\n replaceRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.replaceRoute || target.replaceWith;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method replaceWith\n */\n replaceWith: function() {\n Ember.deprecate(\"replaceWith is deprecated. Please use replaceRoute.\");\n return this.replaceRoute.apply(this, arguments);\n }\n });\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n ControllerMixin.reopen({\n concatenatedProperties: ['queryParams'],\n queryParams: null,\n _finalizingQueryParams: false,\n _queryParamChangesDuringSuspension: null\n });\n }\n\n __exports__[\"default\"] = ControllerMixin;\n });\ndefine(\"ember-routing/ext/run_loop\",\n [\"ember-metal/run_loop\"],\n function(__dependency1__) {\n \"use strict\";\n var run = __dependency1__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n\n // Add a new named queue after the 'actions' queue (where RSVP promises\n // resolve), which is used in router transitions to prevent unnecessary\n // loading state entry if all context promises resolve on the\n // 'actions' queue first.\n\n var queues = run.queues;\n run._addQueue('routerTransitions', 'actions');\n });\ndefine(\"ember-routing/ext/view\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/run_loop\",\"ember-views/views/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var run = __dependency3__[\"default\"];\n var EmberView = __dependency4__.View;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n EmberView.reopen({\n\n /**\n Sets the private `_outlets` object on the view.\n\n @method init\n */\n init: function() {\n set(this, '_outlets', {});\n this._super();\n },\n\n /**\n Manually fill any of a view's `{{outlet}}` areas with the\n supplied view.\n\n Example\n\n ```javascript\n var MyView = Ember.View.extend({\n template: Ember.Handlebars.compile('Child view: {{outlet \"main\"}} ')\n });\n var myView = MyView.create();\n myView.appendTo('body');\n // The html for myView now looks like:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n\n var FooView = Ember.View.extend({\n template: Ember.Handlebars.compile('<h1>Foo</h1> ')\n });\n var fooView = FooView.create();\n myView.connectOutlet('main', fooView);\n // The html for myView now looks like:\n // <div id=\"ember228\" class=\"ember-view\">Child view:\n // <div id=\"ember234\" class=\"ember-view\"><h1>Foo</h1> </div>\n // </div>\n ```\n @method connectOutlet\n @param {String} outletName A unique name for the outlet\n @param {Object} view An Ember.View\n */\n connectOutlet: function(outletName, view) {\n if (this._pendingDisconnections) {\n delete this._pendingDisconnections[outletName];\n }\n\n if (this._hasEquivalentView(outletName, view)) {\n view.destroy();\n return;\n }\n\n var outlets = get(this, '_outlets'),\n container = get(this, 'container'),\n router = container && container.lookup('router:main'),\n renderedName = get(view, 'renderedName');\n\n set(outlets, outletName, view);\n\n if (router && renderedName) {\n router._connectActiveView(renderedName, view);\n }\n },\n\n /**\n Determines if the view has already been created by checking if\n the view has the same constructor, template, and context as the\n view in the `_outlets` object.\n\n @private\n @method _hasEquivalentView\n @param {String} outletName The name of the outlet we are checking\n @param {Object} view An Ember.View\n @return {Boolean}\n */\n _hasEquivalentView: function(outletName, view) {\n var existingView = get(this, '_outlets.'+outletName);\n return existingView &&\n existingView.constructor === view.constructor &&\n existingView.get('template') === view.get('template') &&\n existingView.get('context') === view.get('context');\n },\n\n /**\n Removes an outlet from the view.\n\n Example\n\n ```javascript\n var MyView = Ember.View.extend({\n template: Ember.Handlebars.compile('Child view: {{outlet \"main\"}} ')\n });\n var myView = MyView.create();\n myView.appendTo('body');\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n\n var FooView = Ember.View.extend({\n template: Ember.Handlebars.compile('<h1>Foo</h1> ')\n });\n var fooView = FooView.create();\n myView.connectOutlet('main', fooView);\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view:\n // <div id=\"ember234\" class=\"ember-view\"><h1>Foo</h1> </div>\n // </div>\n\n myView.disconnectOutlet('main');\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n ```\n\n @method disconnectOutlet\n @param {String} outletName The name of the outlet to be removed\n */\n disconnectOutlet: function(outletName) {\n if (!this._pendingDisconnections) {\n this._pendingDisconnections = {};\n }\n this._pendingDisconnections[outletName] = true;\n run.once(this, '_finishDisconnections');\n },\n\n /**\n Gets an outlet that is pending disconnection and then\n nullifys the object on the `_outlet` object.\n\n @private\n @method _finishDisconnections\n */\n _finishDisconnections: function() {\n if (this.isDestroyed) return; // _outlets will be gone anyway\n var outlets = get(this, '_outlets');\n var pendingDisconnections = this._pendingDisconnections;\n this._pendingDisconnections = null;\n\n for (var outletName in pendingDisconnections) {\n set(outlets, outletName, null);\n }\n }\n });\n\n __exports__[\"default\"] = EmberView;\n });\ndefine(\"ember-routing/helpers/action\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/array\",\"ember-metal/run_loop\",\"ember-views/system/utils\",\"ember-handlebars\",\"ember-routing/system/router\",\"ember-handlebars/ext\",\"ember-handlebars/helpers/view\",\"ember-routing/helpers/shared\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Handlebars, uuid, FEATURES, assert, deprecate\n var get = __dependency2__.get;\n var forEach = __dependency3__.forEach;\n var run = __dependency4__[\"default\"];\n\n var isSimpleClick = __dependency5__.isSimpleClick;\n var EmberHandlebars = __dependency6__[\"default\"];\n var EmberRouter = __dependency7__[\"default\"];\n\n\n var EmberHandlebars = __dependency6__[\"default\"];\n var handlebarsGet = __dependency8__.handlebarsGet;\n var viewHelper = __dependency9__.viewHelper;\n var resolveParams = __dependency10__.resolveParams;\n var resolvePath = __dependency10__.resolvePath;\n\n // requireModule('ember-handlebars');\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var SafeString = EmberHandlebars.SafeString,\n a_slice = Array.prototype.slice;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return ret.concat(resolveParams(options.context, options.params, { types: types, data: data }));\n }\n\n var ActionHelper = {\n registeredActions: {}\n };\n\n var keys = [\"alt\", \"shift\", \"meta\", \"ctrl\"];\n\n var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/;\n\n var isAllowedEvent = function(event, allowedKeys) {\n if (typeof allowedKeys === \"undefined\") {\n if (POINTER_EVENT_TYPE_REGEX.test(event.type)) {\n return isSimpleClick(event);\n } else {\n allowedKeys = '';\n }\n }\n\n if (allowedKeys.indexOf(\"any\") >= 0) {\n return true;\n }\n\n var allowed = true;\n\n forEach.call(keys, function(key) {\n if (event[key + \"Key\"] && allowedKeys.indexOf(key) === -1) {\n allowed = false;\n }\n });\n\n return allowed;\n };\n\n ActionHelper.registerAction = function(actionNameOrPath, options, allowedKeys) {\n var actionId = ++Ember.uuid;\n\n ActionHelper.registeredActions[actionId] = {\n eventName: options.eventName,\n handler: function handleRegisteredAction(event) {\n if (!isAllowedEvent(event, allowedKeys)) { return true; }\n\n if (options.preventDefault !== false) {\n event.preventDefault();\n }\n\n if (options.bubbles === false) {\n event.stopPropagation();\n }\n\n var target = options.target,\n parameters = options.parameters,\n actionName;\n\n if (target.target) {\n target = handlebarsGet(target.root, target.target, target.options);\n } else {\n target = target.root;\n }\n\n if (options.boundProperty) {\n actionName = resolveParams(parameters.context, [actionNameOrPath], { types: ['ID'], data: parameters.options.data })[0];\n\n if(typeof actionName === 'undefined' || typeof actionName === 'function') {\n Ember.assert(\"You specified a quoteless path to the {{action}} helper '\" + actionNameOrPath + \"' which did not resolve to an actionName. Perhaps you meant to use a quoted actionName? (e.g. {{action '\" + actionNameOrPath + \"'}}).\", true);\n actionName = actionNameOrPath;\n }\n }\n\n if (!actionName) {\n actionName = actionNameOrPath;\n }\n\n run(function runRegisteredAction() {\n if (target.send) {\n target.send.apply(target, args(parameters, actionName));\n } else {\n Ember.assert(\"The action '\" + actionName + \"' did not exist on \" + target, typeof target[actionName] === 'function');\n target[actionName].apply(target, args(parameters));\n }\n });\n }\n };\n\n options.view.on('willClearRender', function() {\n delete ActionHelper.registeredActions[actionId];\n });\n\n return actionId;\n };\n\n /**\n The `{{action}}` helper registers an HTML element within a template for DOM\n event handling and forwards that interaction to the templates's controller\n or supplied `target` option (see 'Specifying a Target').\n\n If the controller does not implement the event, the event is sent\n to the current route, and it bubbles up the route hierarchy from there.\n\n User interaction with that element will invoke the supplied action name on\n the appropriate target. Specifying a non-quoted action name will result in\n a bound property lookup at the time the event will be triggered.\n\n Given the following application Handlebars template on the page\n\n ```handlebars\n <div {{action 'anActionName'}}>\n click me\n </div>\n ```\n\n And application code\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n anActionName: function() {\n }\n }\n });\n ```\n\n Will result in the following rendered HTML\n\n ```html\n <div class=\"ember-view\">\n <div data-ember-action=\"1\">\n click me\n </div>\n </div>\n ```\n\n Clicking \"click me\" will trigger the `anActionName` action of the\n `App.ApplicationController`. In this case, no additional parameters will be passed.\n\n If you provide additional parameters to the helper:\n\n ```handlebars\n <button {{action 'edit' post}}>Edit</button>\n ```\n\n Those parameters will be passed along as arguments to the JavaScript\n function implementing the action.\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers. If you need to allow event propagation (to handle file inputs for\n example) you can supply the `preventDefault=false` option to the `{{action}}` helper:\n\n ```handlebars\n <div {{action \"sayHello\" preventDefault=false}}>\n <input type=\"file\" />\n <input type=\"checkbox\" />\n </div>\n ```\n\n To disable bubbling, pass `bubbles=false` to the helper:\n\n ```handlebars\n <button {{action 'edit' post bubbles=false}}>Edit</button>\n ```\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See [Ember.View](/api/classes/Ember.View.html)\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n <div {{action \"anActionName\" on=\"doubleClick\"}}>\n click me\n </div>\n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n NOTE: Because `{{action}}` depends on Ember's event dispatch system it will\n only function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new `Ember.Application`\n is created. Having an instance of `Ember.Application` will satisfy this\n requirement.\n\n ### Specifying whitelisted modifier keys\n\n By default the `{{action}}` helper will ignore click event with pressed modifier\n keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.\n\n ```handlebars\n <div {{action \"anActionName\" allowedKeys=\"alt\"}}>\n click me\n </div>\n ```\n\n This way the `{{action}}` will fire when clicking with the alt key pressed down.\n\n Alternatively, supply \"any\" to the `allowedKeys` option to accept any combination of modifier keys.\n\n ```handlebars\n <div {{action \"anActionName\" allowedKeys=\"any\"}}>\n click me with any key pressed\n </div>\n ```\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical Ember application, where views are managed through use of the\n `{{outlet}}` helper, actions will bubble to the current controller, then\n to the current route, and then up the route hierarchy.\n\n Alternatively, a `target` option can be provided to the helper to change\n which object will receive the method call. This option must be a path\n to an object, accessible in the current context:\n\n ```handlebars\n {{! the application template }}\n <div {{action \"anActionName\" target=view}}>\n click me\n </div>\n ```\n\n ```javascript\n App.ApplicationView = Ember.View.extend({\n actions: {\n anActionName: function(){}\n }\n });\n\n ```\n\n ### Additional Parameters\n\n You may specify additional parameters to the `{{action}}` helper. These\n parameters are passed along as the arguments to the JavaScript function\n implementing the action.\n\n ```handlebars\n {{#each person in people}}\n <div {{action \"edit\" person}}>\n click me\n </div>\n {{/each}}\n ```\n\n Clicking \"click me\" will trigger the `edit` method on the current controller\n with the value of `person` as a parameter.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object} [context]*\n @param {Hash} options\n */\n function actionHelper(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n controller = options.data.keywords.controller;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\",\n parameters: {\n context: this,\n options: options,\n params: contexts\n },\n view: options.data.view,\n bubbles: hash.bubbles,\n preventDefault: hash.preventDefault,\n target: { options: options },\n boundProperty: options.types[0] === \"ID\"\n };\n\n if (hash.target) {\n action.target.root = this;\n action.target.target = hash.target;\n } else if (controller) {\n action.target.root = controller;\n }\n\n var actionId = ActionHelper.registerAction(actionName, action, hash.allowedKeys);\n return new SafeString('data-ember-action=\"' + actionId + '\"');\n };\n\n __exports__.ActionHelper = ActionHelper;\n __exports__.actionHelper = actionHelper;\n });\ndefine(\"ember-routing/helpers/link_to\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/merge\",\"ember-metal/run_loop\",\"ember-metal/computed\",\"ember-runtime/system/lazy_load\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-runtime/keys\",\"ember-views/system/utils\",\"ember-views/views/view\",\"ember-handlebars\",\"ember-handlebars/helpers/view\",\"ember-routing/system/router\",\"ember-routing/helpers/shared\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, Logger, Handlebars, warn, assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var merge = __dependency4__[\"default\"];\n var run = __dependency5__[\"default\"];\n var computed = __dependency6__.computed;\n\n var onLoad = __dependency7__.onLoad;\n var fmt = __dependency8__.fmt;\n var EmberObject = __dependency9__[\"default\"];\n var keys = __dependency10__[\"default\"];\n var isSimpleClick = __dependency11__.isSimpleClick;\n var EmberView = __dependency12__.View;\n var EmberHandlebars = __dependency13__[\"default\"];\n var viewHelper = __dependency14__.viewHelper;\n var EmberRouter = __dependency15__[\"default\"];\n var resolveParams = __dependency16__.resolveParams;\n var resolvePaths = __dependency16__.resolvePaths;\n\n // requireModule('ember-handlebars');\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var slice = [].slice;\n\n requireModule('ember-handlebars');\n\n var numberOfContextsAcceptedByHandler = function(handler, handlerInfos) {\n var req = 0;\n for (var i = 0, l = handlerInfos.length; i < l; i++) {\n req = req + handlerInfos[i].names.length;\n if (handlerInfos[i].handler === handler)\n break;\n }\n\n // query params adds an additional context\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n req = req + 1;\n }\n return req;\n };\n\n var QueryParams = EmberObject.extend({\n values: null\n });\n\n function computeQueryParams(linkView, stripDefaultValues) {\n var helperParameters = linkView.parameters,\n queryParamsObject = get(linkView, 'queryParamsObject'),\n suppliedParams = {};\n\n if (queryParamsObject) {\n merge(suppliedParams, queryParamsObject.values);\n }\n\n var resolvedParams = get(linkView, 'resolvedParams'),\n router = get(linkView, 'router'),\n routeName = resolvedParams[0],\n paramsForRoute = router._queryParamsFor(routeName),\n qps = paramsForRoute.qps,\n paramsForRecognizer = {};\n\n // We need to collect all non-default query params for this route.\n for (var i = 0, len = qps.length; i < len; ++i) {\n var qp = qps[i];\n\n // Check if the link-to provides a value for this qp.\n var providedType = null, value;\n if (qp.prop in suppliedParams) {\n value = suppliedParams[qp.prop];\n providedType = queryParamsObject.types[qp.prop];\n delete suppliedParams[qp.prop];\n } else if (qp.urlKey in suppliedParams) {\n value = suppliedParams[qp.urlKey];\n providedType = queryParamsObject.types[qp.urlKey];\n delete suppliedParams[qp.urlKey];\n }\n\n if (providedType) {\n if (providedType === 'ID') {\n var normalizedPath = EmberHandlebars.normalizePath(helperParameters.context, value, helperParameters.options.data);\n value = EmberHandlebars.get(normalizedPath.root, normalizedPath.path, helperParameters.options);\n }\n\n value = qp.route.serializeQueryParam(value, qp.urlKey, qp.type);\n } else {\n value = qp.svalue;\n }\n\n if (stripDefaultValues && value === qp.sdef) {\n continue;\n }\n\n paramsForRecognizer[qp.urlKey] = value;\n }\n\n return paramsForRecognizer;\n }\n\n function routeArgsWithoutDefaultQueryParams(linkView) {\n var routeArgs = linkView.get('routeArgs');\n\n if (!routeArgs[routeArgs.length-1].queryParams) {\n return routeArgs;\n }\n\n routeArgs = routeArgs.slice();\n routeArgs[routeArgs.length-1] = {\n queryParams: computeQueryParams(linkView, true)\n };\n return routeArgs;\n }\n\n function getResolvedPaths(options) {\n\n var types = options.options.types,\n data = options.options.data;\n\n return resolvePaths(options.context, options.params, { types: types, data: data });\n }\n\n /**\n `Ember.LinkView` renders an element whose `click` event triggers a\n transition of the application's instance of `Ember.Router` to\n a supplied route by name.\n\n Instances of `LinkView` will most likely be created through\n the `link-to` Handlebars helper, but properties of this class\n can be overridden to customize application-wide behavior.\n\n @class LinkView\n @namespace Ember\n @extends Ember.View\n @see {Handlebars.helpers.link-to}\n **/\n var LinkView = Ember.LinkView = EmberView.extend({\n tagName: 'a',\n currentWhen: null,\n\n /**\n Sets the `title` attribute of the `LinkView`'s HTML element.\n\n @property title\n @default null\n **/\n title: null,\n\n /**\n Sets the `rel` attribute of the `LinkView`'s HTML element.\n\n @property rel\n @default null\n **/\n rel: null,\n\n /**\n The CSS class to apply to `LinkView`'s element when its `active`\n property is `true`.\n\n @property activeClass\n @type String\n @default active\n **/\n activeClass: 'active',\n\n /**\n The CSS class to apply to `LinkView`'s element when its `loading`\n property is `true`.\n\n @property loadingClass\n @type String\n @default loading\n **/\n loadingClass: 'loading',\n\n /**\n The CSS class to apply to a `LinkView`'s element when its `disabled`\n property is `true`.\n\n @property disabledClass\n @type String\n @default disabled\n **/\n disabledClass: 'disabled',\n _isDisabled: false,\n\n /**\n Determines whether the `LinkView` will trigger routing via\n the `replaceWith` routing strategy.\n\n @property replace\n @type Boolean\n @default false\n **/\n replace: false,\n\n /**\n By default the `{{link-to}}` helper will bind to the `href` and\n `title` attributes. It's discourage that you override these defaults,\n however you can push onto the array if needed.\n\n @property attributeBindings\n @type Array | String\n @default ['href', 'title', 'rel']\n **/\n attributeBindings: ['href', 'title', 'rel'],\n\n /**\n By default the `{{link-to}}` helper will bind to the `active`, `loading`, and\n `disabled` classes. It is discouraged to override these directly.\n\n @property classNameBindings\n @type Array\n @default ['active', 'loading', 'disabled']\n **/\n classNameBindings: ['active', 'loading', 'disabled'],\n\n /**\n By default the `{{link-to}}` helper responds to the `click` event. You\n can override this globally by setting this property to your custom\n event name.\n\n This is particularly useful on mobile when one wants to avoid the 300ms\n click delay using some sort of custom `tap` event.\n\n @property eventName\n @type String\n @default click\n */\n eventName: 'click',\n\n // this is doc'ed here so it shows up in the events\n // section of the API documentation, which is where\n // people will likely go looking for it.\n /**\n Triggers the `LinkView`'s routing behavior. If\n `eventName` is changed to a value other than `click`\n the routing behavior will trigger on that custom event\n instead.\n\n @event click\n **/\n\n /**\n An overridable method called when LinkView objects are instantiated.\n\n Example:\n\n ```javascript\n App.MyLinkView = Ember.LinkView.extend({\n init: function() {\n this._super();\n Ember.Logger.log('Event is ' + this.get('eventName'));\n }\n });\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n @method init\n */\n init: function() {\n this._super.apply(this, arguments);\n\n // Map desired event name to invoke function\n var eventName = get(this, 'eventName');\n this.on(eventName, this, this._invoke);\n },\n\n /**\n This method is invoked by observers installed during `init` that fire\n whenever the params change\n\n @private\n @method _paramsChanged\n @since 1.3.0\n */\n _paramsChanged: function() {\n this.notifyPropertyChange('resolvedParams');\n },\n\n /**\n This is called to setup observers that will trigger a rerender.\n\n @private\n @method _setupPathObservers\n @since 1.3.0\n **/\n _setupPathObservers: function(){\n var helperParameters = this.parameters,\n linkTextPath = helperParameters.options.linkTextPath,\n paths = getResolvedPaths(helperParameters),\n length = paths.length,\n path, i, normalizedPath;\n\n if (linkTextPath) {\n normalizedPath = EmberHandlebars.normalizePath(helperParameters.context, linkTextPath, helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this.rerender);\n }\n\n for(i=0; i < length; i++) {\n path = paths[i];\n if (null === path) {\n // A literal value was provided, not a path, so nothing to observe.\n continue;\n }\n\n normalizedPath = EmberHandlebars.normalizePath(helperParameters.context, path, helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this._paramsChanged);\n }\n\n var queryParamsObject = this.queryParamsObject;\n if (queryParamsObject) {\n var values = queryParamsObject.values;\n\n // Install observers for all of the hash options\n // provided in the (query-params) subexpression.\n for (var k in values) {\n if (!values.hasOwnProperty(k)) { continue; }\n\n if (queryParamsObject.types[k] === 'ID') {\n normalizedPath = EmberHandlebars.normalizePath(helperParameters.context, values[k], helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this._paramsChanged);\n }\n }\n }\n },\n\n afterRender: function(){\n this._super.apply(this, arguments);\n this._setupPathObservers();\n },\n\n /**\n Even though this isn't a virtual view, we want to treat it as if it is\n so that you can access the parent with {{view.prop}}\n\n @private\n @method concreteView\n **/\n concreteView: computed(function() {\n return get(this, 'parentView');\n }).property('parentView'),\n\n /**\n\n Accessed as a classname binding to apply the `LinkView`'s `disabledClass`\n CSS `class` to the element when the link is disabled.\n\n When `true` interactions with the element will not trigger route changes.\n @property disabled\n */\n disabled: computed(function computeLinkViewDisabled(key, value) {\n if (value !== undefined) { this.set('_isDisabled', value); }\n\n return value ? get(this, 'disabledClass') : false;\n }),\n\n /**\n Accessed as a classname binding to apply the `LinkView`'s `activeClass`\n CSS `class` to the element when the link is active.\n\n A `LinkView` is considered active when its `currentWhen` property is `true`\n or the application's current route is the route the `LinkView` would trigger\n transitions into.\n\n @property active\n **/\n active: computed(function computeLinkViewActive() {\n if (get(this, 'loading')) { return false; }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs'),\n contexts = routeArgs.slice(1),\n resolvedParams = get(this, 'resolvedParams'),\n currentWhen = this.currentWhen || routeArgs[0],\n maximumContexts = numberOfContextsAcceptedByHandler(currentWhen, router.router.recognizer.handlersFor(currentWhen));\n\n // if we don't have enough contexts revert back to full route name\n // this is because the leaf route will use one of the contexts\n if (contexts.length > maximumContexts)\n currentWhen = routeArgs[0];\n\n var isActive = router.isActive.apply(router, [currentWhen].concat(contexts));\n\n if (isActive) { return get(this, 'activeClass'); }\n }).property('resolvedParams', 'routeArgs'),\n\n /**\n Accessed as a classname binding to apply the `LinkView`'s `loadingClass`\n CSS `class` to the element when the link is loading.\n\n A `LinkView` is considered loading when it has at least one\n parameter whose value is currently null or undefined. During\n this time, clicking the link will perform no transition and\n emit a warning that the link is still in a loading state.\n\n @property loading\n **/\n loading: computed(function computeLinkViewLoading() {\n if (!get(this, 'routeArgs')) { return get(this, 'loadingClass'); }\n }).property('routeArgs'),\n\n /**\n Returns the application's main router from the container.\n\n @private\n @property router\n **/\n router: computed(function() {\n return get(this, 'controller').container.lookup('router:main');\n }),\n\n /**\n Event handler that invokes the link, activating the associated route.\n\n @private\n @method _invoke\n @param {Event} event\n */\n _invoke: function(event) {\n if (!isSimpleClick(event)) { return true; }\n\n if (this.preventDefault !== false) { event.preventDefault(); }\n if (this.bubbles === false) { event.stopPropagation(); }\n\n if (get(this, '_isDisabled')) { return false; }\n\n if (get(this, 'loading')) {\n Ember.Logger.warn(\"This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.\");\n return false;\n }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs');\n\n var transition;\n if (get(this, 'replace')) {\n transition = router.replaceWith.apply(router, routeArgs);\n } else {\n transition = router.transitionTo.apply(router, routeArgs);\n }\n\n // Schedule eager URL update, but after we've given the transition\n // a chance to synchronously redirect.\n // We need to always generate the URL instead of using the href because\n // the href will include any rootURL set, but the router expects a URL\n // without it! Note that we don't use the first level router because it\n // calls location.formatURL(), which also would add the rootURL!\n var url = router.router.generate.apply(router.router, routeArgsWithoutDefaultQueryParams(this));\n run.scheduleOnce('routerTransitions', this, this._eagerUpdateUrl, transition, url);\n },\n\n /**\n @private\n @method _eagerUpdateUrl\n @param transition\n @param href\n */\n _eagerUpdateUrl: function(transition, href) {\n if (!transition.isActive || !transition.urlMethod) {\n // transition was aborted, already ran to completion,\n // or it has a null url-updated method.\n return;\n }\n\n if (href.indexOf('#') === 0) {\n href = href.slice(1);\n }\n\n // Re-use the routerjs hooks set up by the Ember router.\n var routerjs = get(this, 'router.router');\n if (transition.urlMethod === 'update') {\n routerjs.updateURL(href);\n } else if (transition.urlMethod === 'replace') {\n routerjs.replaceURL(href);\n }\n\n // Prevent later update url refire.\n transition.method(null);\n },\n\n /**\n Computed property that returns an array of the\n resolved parameters passed to the `link-to` helper,\n e.g.:\n\n ```hbs\n {{link-to a b '123' c}}\n ```\n\n will generate a `resolvedParams` of:\n\n ```js\n [aObject, bObject, '123', cObject]\n ```\n\n @private\n @property\n @return {Array}\n */\n resolvedParams: computed(function() {\n var parameters = this.parameters,\n options = parameters.options,\n types = options.types,\n data = options.data;\n\n if (parameters.params.length === 0) {\n var appController = this.container.lookup('controller:application');\n return [get(appController, 'currentRouteName')];\n } else {\n return resolveParams(parameters.context, parameters.params, { types: types, data: data });\n }\n }).property('router.url'),\n\n /**\n Computed property that returns the current route name and\n any dynamic segments.\n\n @private\n @property\n @return {Array} An array with the route name and any dynamic segments\n */\n routeArgs: computed(function computeLinkViewRouteArgs() {\n var resolvedParams = get(this, 'resolvedParams').slice(0),\n router = get(this, 'router'),\n namedRoute = resolvedParams[0];\n\n if (!namedRoute) { return; }\n\n Ember.assert(fmt(\"The attempt to link-to route '%@' failed. \" +\n \"The router did not find '%@' in its possible routes: '%@'\",\n [namedRoute, namedRoute, keys(router.router.recognizer.names).join(\"', '\")]),\n router.hasRoute(namedRoute));\n\n //normalize route name\n var handlers = router.router.recognizer.handlersFor(namedRoute);\n var normalizedPath = handlers[handlers.length - 1].handler;\n if (namedRoute !== normalizedPath) {\n //set namedRoute as currentWhen only when currentWhen is not given explicitly\n if (!this.currentWhen) {\n this.set('currentWhen', namedRoute);\n }\n namedRoute = handlers[handlers.length - 1].handler;\n resolvedParams[0] = namedRoute;\n }\n\n for (var i = 1, len = resolvedParams.length; i < len; ++i) {\n var param = resolvedParams[i];\n if (param === null || typeof param === 'undefined') {\n // If contexts aren't present, consider the linkView unloaded.\n return;\n }\n }\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n resolvedParams.push({ queryParams: get(this, 'queryParams') });\n }\n\n return resolvedParams;\n }).property('resolvedParams', 'queryParams'),\n\n queryParamsObject: null,\n queryParams: computed(function computeLinkViewQueryParams() {\n return computeQueryParams(this, false);\n }).property('resolvedParams.[]'),\n\n /**\n Sets the element's `href` attribute to the url for\n the `LinkView`'s targeted route.\n\n If the `LinkView`'s `tagName` is changed to a value other\n than `a`, this property will be ignored.\n\n @property href\n **/\n href: computed(function computeLinkViewHref() {\n if (get(this, 'tagName') !== 'a') { return; }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs');\n\n if (!routeArgs) {\n return get(this, 'loadingHref');\n }\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n routeArgs = routeArgsWithoutDefaultQueryParams(this);\n }\n\n return router.generate.apply(router, routeArgs);\n }).property('routeArgs'),\n\n /**\n The default href value to use while a link-to is loading.\n Only applies when tagName is 'a'\n\n @property loadingHref\n @type String\n @default #\n */\n loadingHref: '#'\n });\n\n LinkView.toString = function() { return \"LinkView\"; };\n\n /**\n The `{{link-to}}` helper renders a link to the supplied\n `routeName` passing an optionally supplied model to the\n route as its `model` context of the route. The block\n for `{{link-to}}` becomes the innerHTML of the rendered\n element:\n\n ```handlebars\n {{#link-to 'photoGallery'}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos\">\n Great Hamster Photos\n </a>\n ```\n\n ### Supplying a tagName\n By default `{{link-to}}` renders an `<a>` element. This can\n be overridden for a single use of `{{link-to}}` by supplying\n a `tagName` option:\n\n ```handlebars\n {{#link-to 'photoGallery' tagName=\"li\"}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n ```html\n <li>\n Great Hamster Photos\n </li>\n ```\n\n To override this option for your entire application, see\n \"Overriding Application-wide Defaults\".\n\n ### Disabling the `link-to` helper\n By default `{{link-to}}` is enabled.\n any passed value to `disabled` helper property will disable the `link-to` helper.\n\n static use: the `disabled` option:\n\n ```handlebars\n {{#link-to 'photoGallery' disabled=true}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n dynamic use: the `disabledWhen` option:\n\n ```handlebars\n {{#link-to 'photoGallery' disabledWhen=controller.someProperty}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n any passed value to `disabled` will disable it except `undefined`.\n to ensure that only `true` disable the `link-to` helper you can\n override the global behaviour of `Ember.LinkView`.\n\n ```javascript\n Ember.LinkView.reopen({\n disabled: Ember.computed(function(key, value) {\n if (value !== undefined) {\n this.set('_isDisabled', value === true);\n }\n return value === true ? get(this, 'disabledClass') : false;\n })\n });\n ```\n\n see \"Overriding Application-wide Defaults\" for more.\n\n ### Handling `href`\n `{{link-to}}` will use your application's Router to\n fill the element's `href` property with a url that\n matches the path to the supplied `routeName` for your\n routers's configured `Location` scheme, which defaults\n to Ember.HashLocation.\n\n ### Handling current route\n `{{link-to}}` will apply a CSS class name of 'active'\n when the application's current route matches\n the supplied routeName. For example, if the application's\n current route is 'photoGallery.recent' the following\n use of `{{link-to}}`:\n\n ```handlebars\n {{#link-to 'photoGallery.recent'}}\n Great Hamster Photos from the last week\n {{/link-to}}\n ```\n\n will result in\n\n ```html\n <a href=\"/hamster-photos/this-week\" class=\"active\">\n Great Hamster Photos\n </a>\n ```\n\n The CSS class name used for active classes can be customized\n for a single use of `{{link-to}}` by passing an `activeClass`\n option:\n\n ```handlebars\n {{#link-to 'photoGallery.recent' activeClass=\"current-url\"}}\n Great Hamster Photos from the last week\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/this-week\" class=\"current-url\">\n Great Hamster Photos\n </a>\n ```\n\n To override this option for your entire application, see\n \"Overriding Application-wide Defaults\".\n\n ### Supplying a model\n An optional model argument can be used for routes whose\n paths contain dynamic segments. This argument will become\n the model context of the linked route:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n });\n ```\n\n ```handlebars\n {{#link-to 'photoGallery' aPhoto}}\n {{aPhoto.title}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42\">\n Tomster\n </a>\n ```\n\n ### Supplying multiple models\n For deep-linking to route paths that contain multiple\n dynamic segments, multiple model arguments can be used.\n As the router transitions through the route path, each\n supplied model argument will become the context for the\n route with the dynamic segments:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"}, function() {\n this.route(\"comment\", {path: \"comments/:comment_id\"});\n });\n });\n ```\n This argument will become the model context of the linked route:\n\n ```handlebars\n {{#link-to 'photoGallery.comment' aPhoto comment}}\n {{comment.body}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42/comment/718\">\n A+++ would snuggle again.\n </a>\n ```\n\n ### Supplying an explicit dynamic segment value\n If you don't have a model object available to pass to `{{link-to}}`,\n an optional string or integer argument can be passed for routes whose\n paths contain dynamic segments. This argument will become the value\n of the dynamic segment:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n });\n ```\n\n ```handlebars\n {{#link-to 'photoGallery' aPhotoId}}\n {{aPhoto.title}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42\">\n Tomster\n </a>\n ```\n\n When transitioning into the linked route, the `model` hook will\n be triggered with parameters including this passed identifier.\n\n ### Allowing Default Action\n\n By default the `{{link-to}}` helper prevents the default browser action\n by calling `preventDefault()` as this sort of action bubbling is normally\n handled internally and we do not want to take the browser to a new URL (for\n example).\n\n If you need to override this behavior specify `preventDefault=false` in\n your template:\n\n ```handlebars\n {{#link-to 'photoGallery' aPhotoId preventDefault=false}}\n {{aPhotoId.title}}\n {{/link-to}}\n ```\n\n ### Overriding attributes\n You can override any given property of the Ember.LinkView\n that is generated by the `{{link-to}}` helper by passing\n key/value pairs, like so:\n\n ```handlebars\n {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames='pic sweet'}}\n Uh-mazing!\n {{/link-to}}\n ```\n\n See [Ember.LinkView](/api/classes/Ember.LinkView.html) for a\n complete list of overrideable properties. Be sure to also\n check out inherited properties of `LinkView`.\n\n ### Overriding Application-wide Defaults\n ``{{link-to}}`` creates an instance of Ember.LinkView\n for rendering. To override options for your entire\n application, reopen Ember.LinkView and supply the\n desired values:\n\n ``` javascript\n Ember.LinkView.reopen({\n activeClass: \"is-active\",\n tagName: 'li'\n })\n ```\n\n It is also possible to override the default event in\n this manner:\n\n ``` javascript\n Ember.LinkView.reopen({\n eventName: 'customEventName'\n });\n ```\n\n @method link-to\n @for Ember.Handlebars.helpers\n @param {String} routeName\n @param {Object} [context]*\n @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkView\n @return {String} HTML string\n @see {Ember.LinkView}\n */\n function linkToHelper(name) {\n var options = slice.call(arguments, -1)[0],\n params = slice.call(arguments, 0, -1),\n hash = options.hash;\n\n if (params[params.length - 1] instanceof QueryParams) {\n hash.queryParamsObject = params.pop();\n }\n\n hash.disabledBinding = hash.disabledWhen;\n\n if (!options.fn) {\n var linkTitle = params.shift();\n var linkType = options.types.shift();\n var context = this;\n if (linkType === 'ID') {\n options.linkTextPath = linkTitle;\n options.fn = function() {\n return EmberHandlebars.getEscaped(context, linkTitle, options);\n };\n } else {\n options.fn = function() {\n return linkTitle;\n };\n }\n }\n\n hash.parameters = {\n context: this,\n options: options,\n params: params\n };\n\n options.helperName = options.helperName || 'link-to';\n\n return viewHelper.call(this, LinkView, options);\n };\n\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n EmberHandlebars.registerHelper('query-params', function queryParamsHelper(options) {\n Ember.assert(fmt(\"The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName='%@') as opposed to just (query-params '%@')\", [options, options]), arguments.length === 1);\n\n return QueryParams.create({\n values: options.hash,\n types: options.hashTypes\n });\n });\n }\n\n /**\n See [link-to](/api/classes/Ember.Handlebars.helpers.html#method_link-to)\n\n @method linkTo\n @for Ember.Handlebars.helpers\n @deprecated\n @param {String} routeName\n @param {Object} [context]*\n @return {String} HTML string\n */\n function deprecatedLinkToHelper() {\n Ember.warn(\"The 'linkTo' view helper is deprecated in favor of 'link-to'\");\n return linkToHelper.apply(this, arguments);\n };\n\n __exports__.LinkView = LinkView;\n __exports__.deprecatedLinkToHelper = deprecatedLinkToHelper;\n __exports__.linkToHelper = linkToHelper;\n });\ndefine(\"ember-routing/helpers/outlet\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/lazy_load\",\"ember-views/views/container_view\",\"ember-handlebars/views/metamorph_view\",\"ember-handlebars/helpers/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var onLoad = __dependency4__.onLoad;\n var ContainerView = __dependency5__[\"default\"];\n var _Metamorph = __dependency6__._Metamorph;\n var viewHelper = __dependency7__.viewHelper;\n\n // requireModule('ember-handlebars');\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var OutletView = ContainerView.extend(_Metamorph);\n\n /**\n The `outlet` helper is a placeholder that the router will fill in with\n the appropriate template based on the current state of the application.\n\n ``` handlebars\n {{outlet}}\n ```\n\n By default, a template based on Ember's naming conventions will be rendered\n into the `outlet` (e.g. `App.PostsRoute` will render the `posts` template).\n\n You can render a different template by using the `render()` method in the\n route's `renderTemplate` hook. The following will render the `favoritePost`\n template into the `outlet`.\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost');\n }\n });\n ```\n\n You can create custom named outlets for more control.\n\n ``` handlebars\n {{outlet 'favoritePost'}}\n {{outlet 'posts'}}\n ```\n\n Then you can define what template is rendered into each outlet in your\n route.\n\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost', { outlet: 'favoritePost' });\n this.render('posts', { outlet: 'posts' });\n }\n });\n ```\n\n You can specify the view that the outlet uses to contain and manage the\n templates rendered into it.\n\n ``` handlebars\n {{outlet view='sectionContainer'}}\n ```\n\n ``` javascript\n App.SectionContainer = Ember.ContainerView.extend({\n tagName: 'section',\n classNames: ['special']\n });\n ```\n\n @method outlet\n @for Ember.Handlebars.helpers\n @param {String} property the property on the controller\n that holds the view for this outlet\n @return {String} HTML string\n */\n function outletHelper(property, options) {\n\n var outletSource,\n container,\n viewName,\n viewClass,\n viewFullName;\n\n if (property && property.data && property.data.isRenderData) {\n options = property;\n property = 'main';\n }\n\n container = options.data.view.container;\n\n outletSource = options.data.view;\n while (!outletSource.get('template.isTop')) {\n outletSource = outletSource.get('_parentView');\n }\n\n // provide controller override\n viewName = options.hash.view;\n\n if (viewName) {\n viewFullName = 'view:' + viewName;\n Ember.assert(\"Using a quoteless view parameter with {{outlet}} is not supported. Please update to quoted usage '{{outlet \\\"\" + viewName + \"\\\"}}.\", options.hashTypes.view !== 'ID');\n Ember.assert(\"The view name you supplied '\" + viewName + \"' did not resolve to a view.\", container.has(viewFullName));\n }\n\n viewClass = viewName ? container.lookupFactory(viewFullName) : options.hash.viewClass || OutletView;\n\n options.data.view.set('outletSource', outletSource);\n options.hash.currentViewBinding = '_view.outletSource._outlets.' + property;\n\n options.helperName = options.helperName || 'outlet';\n\n return viewHelper.call(this, viewClass, options);\n };\n\n __exports__.outletHelper = outletHelper;\n __exports__.OutletView = OutletView;\n });\ndefine(\"ember-routing/helpers/render\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/string\",\"ember-routing/system/controller_for\",\"ember-handlebars/ext\",\"ember-handlebars/helpers/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // assert, deprecate\n var EmberError = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var camelize = __dependency5__.camelize;\n var generateControllerFactory = __dependency6__.generateControllerFactory;\n var generateController = __dependency6__.generateController;\n var handlebarsGet = __dependency7__.handlebarsGet;\n var viewHelper = __dependency8__.viewHelper;\n\n\n // requireModule('ember-handlebars');\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n Calling ``{{render}}`` from within a template will insert another\n template that matches the provided name. The inserted template will\n access its properties on its own controller (rather than the controller\n of the parent template).\n\n If a view class with the same name exists, the view class also will be used.\n\n Note: A given controller may only be used *once* in your app in this manner.\n A singleton instance of the controller will be created for you.\n\n Example:\n\n ```javascript\n App.NavigationController = Ember.Controller.extend({\n who: \"world\"\n });\n ```\n\n ```handlebars\n <!-- navigation.hbs -->\n Hello, {{who}}.\n ```\n\n ```handelbars\n <!-- application.hbs -->\n <h1>My great app</h1>\n {{render \"navigation\"}}\n ```\n\n ```html\n <h1>My great app</h1>\n <div class='ember-view'>\n Hello, world.\n </div>\n ```\n\n Optionally you may provide a second argument: a property path\n that will be bound to the `model` property of the controller.\n\n If a `model` property path is specified, then a new instance of the\n controller will be created and `{{render}}` can be used multiple times\n with the same name.\n\n For example if you had this `author` template.\n\n ```handlebars\n <div class=\"author\">\n Written by {{firstName}} {{lastName}}.\n Total Posts: {{postCount}}\n </div>\n ```\n\n You could render it inside the `post` template using the `render` helper.\n\n ```handlebars\n <div class=\"post\">\n <h1>{{title}}</h1>\n <div>{{body}}</div>\n {{render \"author\" author}}\n </div>\n ```\n\n @method render\n @for Ember.Handlebars.helpers\n @param {String} name\n @param {Object?} contextString\n @param {Hash} options\n @return {String} HTML string\n */\n function renderHelper(name, contextString, options) {\n var length = arguments.length;\n\n var contextProvided = length === 3,\n container, router, controller, view, context, lookupOptions;\n\n container = (options || contextString).data.keywords.controller.container;\n router = container.lookup('router:main');\n\n if (length === 2) {\n // use the singleton controller\n options = contextString;\n contextString = undefined;\n Ember.assert(\"You can only use the {{render}} helper once without a model object as its second argument, as in {{render \\\"post\\\" post}}.\", !router || !router._lookupActiveView(name));\n } else if (length === 3) {\n // create a new controller\n context = handlebarsGet(options.contexts[1], contextString, options);\n } else {\n throw EmberError(\"You must pass a templateName to render\");\n }\n\n Ember.deprecate(\"Using a quoteless parameter with {{render}} is deprecated. Please update to quoted usage '{{render \\\"\" + name + \"\\\"}}.\", options.types[0] !== 'ID');\n\n // # legacy namespace\n name = name.replace(/\\//g, '.');\n // \\ legacy slash as namespace support\n\n\n view = container.lookup('view:' + name) || container.lookup('view:default');\n\n // provide controller override\n var controllerName = options.hash.controller || name;\n var controllerFullName = 'controller:' + controllerName;\n\n if (options.hash.controller) {\n Ember.assert(\"The controller name you supplied '\" + controllerName + \"' did not resolve to a controller.\", container.has(controllerFullName));\n }\n\n var parentController = options.data.keywords.controller;\n\n // choose name\n if (length > 2) {\n var factory = container.lookupFactory(controllerFullName) ||\n generateControllerFactory(container, controllerName, context);\n\n controller = factory.create({\n model: context,\n parentController: parentController,\n target: parentController\n });\n\n view.one('willDestroyElement', function() {\n controller.destroy();\n });\n } else {\n controller = container.lookup(controllerFullName) ||\n generateController(container, controllerName);\n\n controller.setProperties({\n target: parentController,\n parentController: parentController\n });\n }\n\n var root = options.contexts[1];\n\n if (root) {\n view.registerObserver(root, contextString, function() {\n controller.set('model', handlebarsGet(root, contextString, options));\n });\n }\n\n options.hash.viewName = camelize(name);\n\n var templateName = 'template:' + name;\n Ember.assert(\"You used `{{render '\" + name + \"'}}`, but '\" + name + \"' can not be found as either a template or a view.\", container.has(\"view:\" + name) || container.has(templateName) || options.fn);\n options.hash.template = container.lookup(templateName);\n\n options.hash.controller = controller;\n\n if (router && !context) {\n router._connectActiveView(name, view);\n }\n\n options.helperName = options.helperName || ('render \"' + name + '\"');\n\n viewHelper.call(this, view, options);\n };\n\n __exports__[\"default\"] = renderHelper;\n });\ndefine(\"ember-routing/helpers/shared\",\n [\"ember-metal/property_get\",\"ember-metal/array\",\"ember-runtime/system/lazy_load\",\"ember-runtime/controllers/controller\",\"ember-routing/system/router\",\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var map = __dependency2__.map;\n var onLoad = __dependency3__.onLoad;\n var ControllerMixin = __dependency4__.ControllerMixin;\n var EmberRouter = __dependency5__[\"default\"];\n var handlebarsResolve = __dependency6__.resolveParams;\n var handlebarsGet = __dependency6__.handlebarsGet;\n\n function resolveParams(context, params, options) {\n return map.call(resolvePaths(context, params, options), function(path, i) {\n if (null === path) {\n // Param was string/number, not a path, so just return raw string/number.\n return params[i];\n } else {\n return handlebarsGet(context, path, options);\n }\n });\n }\n\n function resolvePaths(context, params, options) {\n var resolved = handlebarsResolve(context, params, options),\n types = options.types;\n\n return map.call(resolved, function(object, i) {\n if (types[i] === 'ID') {\n return unwrap(object, params[i]);\n } else {\n return null;\n }\n });\n\n function unwrap(object, path) {\n if (path === 'controller') { return path; }\n\n if (ControllerMixin.detect(object)) {\n return unwrap(get(object, 'model'), path ? path + '.model' : 'model');\n } else {\n return path;\n }\n }\n }\n\n __exports__.resolveParams = resolveParams;\n __exports__.resolvePaths = resolvePaths;\n });\ndefine(\"ember-routing/location/api\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // deprecate, assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n ## Implementations\n\n You can pass an implementation name (`hash`, `history`, `none`) to force a\n particular implementation to be used in your application.\n\n ### HashLocation\n\n Using `HashLocation` results in URLs with a `#` (hash sign) separating the\n server side URL portion of the URL from the portion that is used by Ember.\n This relies upon the `hashchange` event existing in the browser.\n\n Example:\n\n ```javascript\n App.Router.map(function() {\n this.resource('posts', function() {\n this.route('new');\n });\n });\n\n App.Router.reopen({\n location: 'hash'\n });\n ```\n\n This will result in a posts.new url of `/#/posts/new`.\n\n ### HistoryLocation\n\n Using `HistoryLocation` results in URLs that are indistinguishable from a\n standard URL. This relies upon the browser's `history` API.\n\n Example:\n\n ```javascript\n App.Router.map(function() {\n this.resource('posts', function() {\n this.route('new');\n });\n });\n\n App.Router.reopen({\n location: 'history'\n });\n ```\n\n This will result in a posts.new url of `/posts/new`.\n\n Keep in mind that your server must serve the Ember app at all the routes you\n define.\n\n ### AutoLocation\n\n Using `AutoLocation`, the router will use the best Location class supported by\n the browser it is running in.\n\n Browsers that support the `history` API will use `HistoryLocation`, those that\n do not, but still support the `hashchange` event will use `HashLocation`, and\n in the rare case neither is supported will use `NoneLocation`.\n\n Example:\n\n ```javascript\n App.Router.map(function() {\n this.resource('posts', function() {\n this.route('new');\n });\n });\n\n App.Router.reopen({\n location: 'auto'\n });\n ```\n\n This will result in a posts.new url of `/posts/new` for modern browsers that\n support the `history` api or `/#/posts/new` for older ones, like Internet\n Explorer 9 and below.\n\n When a user visits a link to your application, they will be automatically\n upgraded or downgraded to the appropriate `Location` class, with the URL\n transformed accordingly, if needed.\n\n Keep in mind that since some of your users will use `HistoryLocation`, your\n server must serve the Ember app at all the routes you define.\n\n ### NoneLocation\n\n Using `NoneLocation` causes Ember to not store the applications URL state\n in the actual URL. This is generally used for testing purposes, and is one\n of the changes made when calling `App.setupForTesting()`.\n\n ## Location API\n\n Each location implementation must provide the following methods:\n\n * implementation: returns the string name used to reference the implementation.\n * getURL: returns the current URL.\n * setURL(path): sets the current URL.\n * replaceURL(path): replace the current URL (optional).\n * onUpdateURL(callback): triggers the callback when the URL changes.\n * formatURL(url): formats `url` to be placed into `href` attribute.\n\n Calling setURL or replaceURL will not trigger onUpdateURL callbacks.\n\n @class Location\n @namespace Ember\n @static\n */\n var EmberLocation = {\n /**\n This is deprecated in favor of using the container to lookup the location\n implementation as desired.\n\n For example:\n\n ```javascript\n // Given a location registered as follows:\n container.register('location:history-test', HistoryTestLocation);\n\n // You could create a new instance via:\n container.lookup('location:history-test');\n ```\n\n @method create\n @param {Object} options\n @return {Object} an instance of an implementation of the `location` API\n @deprecated Use the container to lookup the location implementation that you\n need.\n */\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n /**\n This is deprecated in favor of using the container to register the\n location implementation as desired.\n\n Example:\n\n ```javascript\n Application.initializer({\n name: \"history-test-location\",\n\n initialize: function(container, application) {\n application.register('location:history-test', HistoryTestLocation);\n }\n });\n ```\n\n @method registerImplementation\n @param {String} name\n @param {Object} implementation of the `location` API\n @deprecated Register your custom location implementation with the\n container directly.\n */\n registerImplementation: function(name, implementation) {\n Ember.deprecate('Using the Ember.Location.registerImplementation is no longer supported. Register your custom location implementation with the container instead.', false);\n\n this.implementations[name] = implementation;\n },\n\n implementations: {},\n _location: window.location,\n\n /**\n Returns the current `location.hash` by parsing location.href since browsers\n inconsistently URL-decode `location.hash`.\n\n https://bugzilla.mozilla.org/show_bug.cgi?id=483304\n\n @private\n @method getHash\n @since 1.4.0\n */\n _getHash: function () {\n // AutoLocation has it at _location, HashLocation at .location.\n // Being nice and not changing\n var href = (this._location || this.location).href,\n hashIndex = href.indexOf('#');\n\n if (hashIndex === -1) {\n return '';\n } else {\n return href.substr(hashIndex);\n }\n }\n };\n\n __exports__[\"default\"] = EmberLocation;\n });\ndefine(\"ember-routing/location/auto_location\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-routing/location/api\",\"ember-routing/location/history_location\",\"ember-routing/location/hash_location\",\"ember-routing/location/none_location\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n\n var EmberLocation = __dependency4__[\"default\"];\n var HistoryLocation = __dependency5__[\"default\"];\n var HashLocation = __dependency6__[\"default\"];\n var NoneLocation = __dependency7__[\"default\"];\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n Ember.AutoLocation will select the best location option based off browser\n support with the priority order: history, hash, none.\n\n Clean pushState paths accessed by hashchange-only browsers will be redirected\n to the hash-equivalent and vice versa so future transitions are consistent.\n\n Keep in mind that since some of your users will use `HistoryLocation`, your\n server must serve the Ember app at all the routes you define.\n\n @class AutoLocation\n @namespace Ember\n @static\n */\n var AutoLocation = {\n\n /**\n @private\n\n This property is used by router:main to know whether to cancel the routing\n setup process, which is needed while we redirect the browser.\n\n @since 1.5.1\n @property cancelRouterSetup\n @default false\n */\n cancelRouterSetup: false,\n\n /**\n @private\n\n Will be pre-pended to path upon state change.\n\n @since 1.5.1\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _window\n @default window\n */\n _window: window,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @property location\n @default window.location\n */\n _location: window.location,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _history\n @default window.history\n */\n _history: window.history,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _HistoryLocation\n @default Ember.HistoryLocation\n */\n _HistoryLocation: HistoryLocation,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _HashLocation\n @default Ember.HashLocation\n */\n _HashLocation: HashLocation,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _NoneLocation\n @default Ember.NoneLocation\n */\n _NoneLocation: NoneLocation,\n\n /**\n @private\n\n Returns location.origin or builds it if device doesn't support it.\n\n @method _getOrigin\n */\n _getOrigin: function () {\n var location = this._location,\n origin = location.origin;\n\n // Older browsers, especially IE, don't have origin\n if (!origin) {\n origin = location.protocol + '//' + location.hostname;\n\n if (location.port) {\n origin += ':' + location.port;\n }\n }\n\n return origin;\n },\n\n /**\n @private\n\n We assume that if the history object has a pushState method, the host should\n support HistoryLocation.\n\n @method _getSupportsHistory\n */\n _getSupportsHistory: function () {\n // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n // The stock browser on Android 2.2 & 2.3 returns positive on history support\n // Unfortunately support is really buggy and there is no clean way to detect\n // these bugs, so we fall back to a user agent sniff :(\n var userAgent = this._window.navigator.userAgent;\n\n // We only want Android 2, stock browser, and not Chrome which identifies\n // itself as 'Mobile Safari' as well\n if (userAgent.indexOf('Android 2') !== -1 &&\n userAgent.indexOf('Mobile Safari') !== -1 &&\n userAgent.indexOf('Chrome') === -1) {\n return false;\n }\n\n return !!(this._history && 'pushState' in this._history);\n },\n\n /**\n @private\n\n IE8 running in IE7 compatibility mode gives false positive, so we must also\n check documentMode.\n\n @method _getSupportsHashChange\n */\n _getSupportsHashChange: function () {\n var _window = this._window,\n documentMode = _window.document.documentMode;\n\n return ('onhashchange' in _window && (documentMode === undefined || documentMode > 7 ));\n },\n\n /**\n @private\n\n Redirects the browser using location.replace, prepending the locatin.origin\n to prevent phishing attempts\n\n @method _replacePath\n */\n _replacePath: function (path) {\n this._location.replace(this._getOrigin() + path);\n },\n\n /**\n @since 1.5.1\n @private\n @method _getRootURL\n */\n _getRootURL: function () {\n return this.rootURL;\n },\n\n /**\n @private\n\n Returns the current `location.pathname`, normalized for IE inconsistencies.\n\n @method _getPath\n */\n _getPath: function () {\n var pathname = this._location.pathname;\n // Various versions of IE/Opera don't always return a leading slash\n if (pathname.charAt(0) !== '/') {\n pathname = '/' + pathname;\n }\n\n return pathname;\n },\n\n /**\n @private\n\n Returns normalized location.hash as an alias to Ember.Location._getHash\n\n @since 1.5.1\n @method _getHash\n */\n _getHash: EmberLocation._getHash,\n\n /**\n @private\n\n Returns location.search\n\n @since 1.5.1\n @method _getQuery\n */\n _getQuery: function () {\n return this._location.search;\n },\n\n /**\n @private\n\n Returns the full pathname including query and hash\n\n @method _getFullPath\n */\n _getFullPath: function () {\n return this._getPath() + this._getQuery() + this._getHash();\n },\n\n /**\n @private\n\n Returns the current path as it should appear for HistoryLocation supported\n browsers. This may very well differ from the real current path (e.g. if it\n starts off as a hashed URL)\n\n @method _getHistoryPath\n */\n _getHistoryPath: function () {\n var rootURL = this._getRootURL(),\n path = this._getPath(),\n hash = this._getHash(),\n query = this._getQuery(),\n rootURLIndex = path.indexOf(rootURL),\n routeHash, hashParts;\n\n Ember.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0);\n\n // By convention, Ember.js routes using HashLocation are required to start\n // with `#/`. Anything else should NOT be considered a route and should\n // be passed straight through, without transformation.\n if (hash.substr(0, 2) === '#/') {\n // There could be extra hash segments after the route\n hashParts = hash.substr(1).split('#');\n // The first one is always the route url\n routeHash = hashParts.shift();\n\n // If the path already has a trailing slash, remove the one\n // from the hashed route so we don't double up.\n if (path.slice(-1) === '/') {\n routeHash = routeHash.substr(1);\n }\n\n // This is the \"expected\" final order\n path += routeHash;\n path += query;\n\n if (hashParts.length) {\n path += '#' + hashParts.join('#');\n }\n } else {\n path += query;\n path += hash;\n }\n\n return path;\n },\n\n /**\n @private\n\n Returns the current path as it should appear for HashLocation supported\n browsers. This may very well differ from the real current path.\n\n @method _getHashPath\n */\n _getHashPath: function () {\n var rootURL = this._getRootURL(),\n path = rootURL,\n historyPath = this._getHistoryPath(),\n routePath = historyPath.substr(rootURL.length);\n\n if (routePath !== '') {\n if (routePath.charAt(0) !== '/') {\n routePath = '/' + routePath;\n }\n\n path += '#' + routePath;\n }\n\n return path;\n },\n\n /**\n Selects the best location option based off browser support and returns an\n instance of that Location class.\n\n @see Ember.AutoLocation\n @method create\n */\n create: function (options) {\n if (options && options.rootURL) {\n Ember.assert('rootURL must end with a trailing forward slash e.g. \"/app/\"', options.rootURL.charAt(options.rootURL.length-1) === '/');\n this.rootURL = options.rootURL;\n }\n\n var historyPath, hashPath,\n cancelRouterSetup = false,\n implementationClass = this._NoneLocation,\n currentPath = this._getFullPath();\n\n if (this._getSupportsHistory()) {\n historyPath = this._getHistoryPath();\n\n // Since we support history paths, let's be sure we're using them else\n // switch the location over to it.\n if (currentPath === historyPath) {\n implementationClass = this._HistoryLocation;\n } else {\n cancelRouterSetup = true;\n this._replacePath(historyPath);\n }\n\n } else if (this._getSupportsHashChange()) {\n hashPath = this._getHashPath();\n\n // Be sure we're using a hashed path, otherwise let's switch over it to so\n // we start off clean and consistent. We'll count an index path with no\n // hash as \"good enough\" as well.\n if (currentPath === hashPath || (currentPath === '/' && hashPath === '/#/')) {\n implementationClass = this._HashLocation;\n } else {\n // Our URL isn't in the expected hash-supported format, so we want to\n // cancel the router setup and replace the URL to start off clean\n cancelRouterSetup = true;\n this._replacePath(hashPath);\n }\n }\n\n var implementation = implementationClass.create.apply(implementationClass, arguments);\n\n if (cancelRouterSetup) {\n set(implementation, 'cancelRouterSetup', true);\n }\n\n return implementation;\n }\n };\n\n __exports__[\"default\"] = AutoLocation;\n });\ndefine(\"ember-routing/location/hash_location\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/run_loop\",\"ember-metal/utils\",\"ember-runtime/system/object\",\"ember-routing/location/api\",\"ember-views/system/jquery\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var run = __dependency3__[\"default\"];\n var guidFor = __dependency4__.guidFor;\n\n var EmberObject = __dependency5__[\"default\"];\n var EmberLocation = __dependency6__[\"default\"];\n var jQuery = __dependency7__[\"default\"];\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n `Ember.HashLocation` implements the location API using the browser's\n hash. At present, it relies on a `hashchange` event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n */\n var HashLocation = EmberObject.extend({\n implementation: 'hash',\n\n init: function() {\n set(this, 'location', get(this, '_location') || window.location);\n },\n\n /**\n @private\n\n Returns normalized location.hash\n\n @since 1.5.1\n @method getHash\n */\n getHash: EmberLocation._getHash,\n\n /**\n Returns the current `location.hash`, minus the '#' at the front.\n\n @private\n @method getURL\n */\n getURL: function() {\n return this.getHash().substr(1);\n },\n\n /**\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @private\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n Uses location.replace to update the url without a page reload\n or history modification.\n\n @private\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n get(this, 'location').replace('#' + path);\n set(this, 'lastSetURL', path);\n },\n\n /**\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @private\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = guidFor(this);\n\n jQuery(window).on('hashchange.ember-location-'+guid, function() {\n run(function() {\n var path = self.getURL();\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(path);\n });\n });\n },\n\n /**\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @private\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n /**\n Cleans up the HashLocation event listener.\n\n @private\n @method willDestroy\n */\n willDestroy: function() {\n var guid = guidFor(this);\n\n jQuery(window).off('hashchange.ember-location-'+guid);\n }\n });\n\n __exports__[\"default\"] = HashLocation;\n });\ndefine(\"ember-routing/location/history_location\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-runtime/system/object\",\"ember-views/system/jquery\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n\n var EmberObject = __dependency5__[\"default\"];\n var jQuery = __dependency6__[\"default\"];\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var popstateFired = false;\n var supportsHistoryState = window.history && 'state' in window.history;\n\n /**\n Ember.HistoryLocation implements the location API using the browser's\n history.pushState API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n */\n var HistoryLocation = EmberObject.extend({\n implementation: 'history',\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n set(this, 'baseURL', jQuery('base').attr('href') || '');\n },\n\n /**\n Used to set state on first call to setURL\n\n @private\n @method initState\n */\n initState: function() {\n set(this, 'history', get(this, 'history') || window.history);\n this.replaceState(this.formatURL(this.getURL()));\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n Returns the current `location.pathname` without `rootURL` or `baseURL`\n\n @private\n @method getURL\n @return url {String}\n */\n getURL: function() {\n var rootURL = get(this, 'rootURL'),\n location = get(this, 'location'),\n path = location.pathname,\n baseURL = get(this, 'baseURL');\n\n rootURL = rootURL.replace(/\\/$/, '');\n baseURL = baseURL.replace(/\\/$/, '');\n var url = path.replace(baseURL, '').replace(rootURL, '');\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n var search = location.search || '';\n url += search;\n }\n\n return url;\n },\n\n /**\n Uses `history.pushState` to update the url without a page reload.\n\n @private\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n var state = this.getState();\n path = this.formatURL(path);\n\n if (!state || state.path !== path) {\n this.pushState(path);\n }\n },\n\n /**\n Uses `history.replaceState` to update the url without a page reload\n or history modification.\n\n @private\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n var state = this.getState();\n path = this.formatURL(path);\n\n if (!state || state.path !== path) {\n this.replaceState(path);\n }\n },\n\n /**\n Get the current `history.state`. Checks for if a polyfill is\n required and if so fetches this._historyState. The state returned\n from getState may be null if an iframe has changed a window's\n history.\n\n @private\n @method getState\n @return state {Object}\n */\n getState: function() {\n return supportsHistoryState ? get(this, 'history').state : this._historyState;\n },\n\n /**\n Pushes a new state.\n\n @private\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n var state = { path: path };\n\n get(this, 'history').pushState(state, null, path);\n\n // store state if browser doesn't support `history.state`\n if (!supportsHistoryState) {\n this._historyState = state;\n }\n\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n Replaces the current state.\n\n @private\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n var state = { path: path };\n\n get(this, 'history').replaceState(state, null, path);\n\n // store state if browser doesn't support `history.state`\n if (!supportsHistoryState) {\n this._historyState = state;\n }\n\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @private\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = guidFor(this),\n self = this;\n\n jQuery(window).on('popstate.ember-location-'+guid, function(e) {\n // Ignore initial page load popstate event in Chrome\n if (!popstateFired) {\n popstateFired = true;\n if (self.getURL() === self._previousURL) { return; }\n }\n callback(self.getURL());\n });\n },\n\n /**\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @private\n @method formatURL\n @param url {String}\n @return formatted url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL'),\n baseURL = get(this, 'baseURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n baseURL = baseURL.replace(/\\/$/, '');\n } else if(baseURL.match(/^\\//) && rootURL.match(/^\\//)) {\n baseURL = baseURL.replace(/\\/$/, '');\n }\n\n return baseURL + rootURL + url;\n },\n\n /**\n Cleans up the HistoryLocation event listener.\n\n @private\n @method willDestroy\n */\n willDestroy: function() {\n var guid = guidFor(this);\n\n jQuery(window).off('popstate.ember-location-'+guid);\n }\n });\n\n __exports__[\"default\"] = HistoryLocation;\n });\ndefine(\"ember-routing/location/none_location\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var EmberObject = __dependency3__[\"default\"];\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n Ember.NoneLocation does not interact with the browser. It is useful for\n testing, or when you need to manage state with your Router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n */\n var NoneLocation = EmberObject.extend({\n implementation: 'none',\n path: '',\n\n /**\n Returns the current path.\n\n @private\n @method getURL\n @return {String} path\n */\n getURL: function() {\n return get(this, 'path');\n },\n\n /**\n Set the path and remembers what was set. Using this method\n to change the path will not invoke the `updateURL` callback.\n\n @private\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n /**\n Register a callback to be invoked when the path changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @private\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n this.updateCallback = callback;\n },\n\n /**\n Sets the path and calls the `updateURL` callback.\n\n @private\n @method handleURL\n @param callback {Function}\n */\n handleURL: function(url) {\n set(this, 'path', url);\n this.updateCallback(url);\n },\n\n /**\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @private\n @method formatURL\n @param url {String}\n @return {String} url\n */\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n });\n\n __exports__[\"default\"] = NoneLocation;\n });\ndefine(\"ember-routing\",\n [\"ember-handlebars\",\"ember-metal/core\",\"ember-routing/ext/run_loop\",\"ember-routing/ext/controller\",\"ember-routing/ext/view\",\"ember-routing/helpers/shared\",\"ember-routing/helpers/link_to\",\"ember-routing/location/api\",\"ember-routing/location/none_location\",\"ember-routing/location/hash_location\",\"ember-routing/location/history_location\",\"ember-routing/location/auto_location\",\"ember-routing/system/controller_for\",\"ember-routing/system/dsl\",\"ember-routing/system/router\",\"ember-routing/system/route\",\"ember-routing/helpers/outlet\",\"ember-routing/helpers/render\",\"ember-routing/helpers/action\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __exports__) {\n \"use strict\";\n // require('ember-runtime');\n // require('ember-views');\n // require('ember-handlebars');\n\n /**\n Ember Routing\n\n @module ember\n @submodule ember-routing\n @requires ember-views\n */\n\n var EmberHandlebars = __dependency1__[\"default\"];\n var Ember = __dependency2__[\"default\"];\n\n // ES6TODO: Cleanup modules with side-effects below\n\n var resolvePaths = __dependency6__.resolvePaths;\n var resolveParams = __dependency6__.resolveParams;\n var deprecatedLinkToHelper = __dependency7__.deprecatedLinkToHelper;\n var linkToHelper = __dependency7__.linkToHelper;\n var LinkView = __dependency7__.LinkView;\n\n\n // require('ember-views');\n var EmberLocation = __dependency8__[\"default\"];\n var NoneLocation = __dependency9__[\"default\"];\n var HashLocation = __dependency10__[\"default\"];\n var HistoryLocation = __dependency11__[\"default\"];\n var AutoLocation = __dependency12__[\"default\"];\n\n var controllerFor = __dependency13__.controllerFor;\n var generateControllerFactory = __dependency13__.generateControllerFactory;\n var generateController = __dependency13__.generateController;\n var RouterDSL = __dependency14__[\"default\"];\n var Router = __dependency15__[\"default\"];\n var Route = __dependency16__[\"default\"];\n var outletHelper = __dependency17__.outletHelper;\n var OutletView = __dependency17__.OutletView;\n var renderHelper = __dependency18__[\"default\"];\n var ActionHelper = __dependency19__.ActionHelper;\n var actionHelper = __dependency19__.actionHelper;\n\n\n Ember.Location = EmberLocation;\n Ember.AutoLocation = AutoLocation;\n Ember.HashLocation = HashLocation;\n Ember.HistoryLocation = HistoryLocation;\n Ember.NoneLocation = NoneLocation;\n\n Ember.controllerFor = controllerFor;\n Ember.generateControllerFactory = generateControllerFactory;\n Ember.generateController = generateController;\n Ember.RouterDSL = RouterDSL;\n Ember.Router = Router;\n Ember.Route = Route;\n Ember.LinkView = LinkView;\n\n Router.resolveParams = resolveParams;\n Router.resolvePaths = resolvePaths;\n\n EmberHandlebars.ActionHelper = ActionHelper;\n EmberHandlebars.OutletView = OutletView;\n\n EmberHandlebars.registerHelper('render', renderHelper)\n EmberHandlebars.registerHelper('action', actionHelper);\n EmberHandlebars.registerHelper('outlet', outletHelper);\n EmberHandlebars.registerHelper('link-to', linkToHelper);\n EmberHandlebars.registerHelper('linkTo', deprecatedLinkToHelper);\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-routing/system/controller_for\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Logger\n var get = __dependency2__.get;\n var isArray = __dependency3__.isArray;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n\n Finds a controller instance.\n\n @for Ember\n @method controllerFor\n @private\n */\n var controllerFor = function(container, controllerName, lookupOptions) {\n return container.lookup('controller:' + controllerName, lookupOptions);\n };\n\n /**\n Generates a controller factory\n\n The type of the generated controller factory is derived\n from the context. If the context is an array an array controller\n is generated, if an object, an object controller otherwise, a basic\n controller is generated.\n\n You can customize your generated controllers by defining\n `App.ObjectController` or `App.ArrayController`.\n\n @for Ember\n @method generateControllerFactory\n @private\n */\n var generateControllerFactory = function(container, controllerName, context) {\n var Factory, fullName, instance, name, factoryName, controllerType;\n\n if (context && isArray(context)) {\n controllerType = 'array';\n } else if (context) {\n controllerType = 'object';\n } else {\n controllerType = 'basic';\n }\n\n factoryName = 'controller:' + controllerType;\n\n Factory = container.lookupFactory(factoryName).extend({\n isGenerated: true,\n toString: function() {\n return \"(generated \" + controllerName + \" controller)\";\n }\n });\n\n fullName = 'controller:' + controllerName;\n\n container.register(fullName, Factory);\n\n return Factory;\n };\n\n /**\n Generates and instantiates a controller.\n\n The type of the generated controller factory is derived\n from the context. If the context is an array an array controller\n is generated, if an object, an object controller otherwise, a basic\n controller is generated.\n\n @for Ember\n @method generateController\n @private\n @since 1.3.0\n */\n var generateController = function(container, controllerName, context) {\n generateControllerFactory(container, controllerName, context);\n var fullName = 'controller:' + controllerName;\n var instance = container.lookup(fullName);\n\n if (get(instance, 'namespace.LOG_ACTIVE_GENERATION')) {\n Ember.Logger.info(\"generated -> \" + fullName, { fullName: fullName });\n }\n\n return instance;\n };\n\n __exports__.controllerFor = controllerFor;\n __exports__.generateControllerFactory = generateControllerFactory;\n __exports__.generateController = generateController;\n });\ndefine(\"ember-routing/system/dsl\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, assert\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n function DSL(name) {\n this.parent = name;\n this.matches = [];\n }\n\n DSL.prototype = {\n resource: function(name, options, callback) {\n Ember.assert(\"'basic' cannot be used as a resource name.\", name !== 'basic');\n\n if (arguments.length === 2 && typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n if (arguments.length === 1) {\n options = {};\n }\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (callback) {\n var dsl = new DSL(name);\n route(dsl, 'loading');\n route(dsl, 'error', { path: \"/_unused_dummy_error_path_route_\" + name + \"/:error\" });\n callback.call(dsl);\n this.push(options.path, name, dsl.generate());\n } else {\n this.push(options.path, name, null);\n }\n\n\n if (Ember.FEATURES.isEnabled(\"ember-routing-named-substates\")) {\n // For namespace-preserving nested resource (e.g. resource('foo.bar') within\n // resource('foo')) we only want to use the last route name segment to determine\n // the names of the error/loading substates (e.g. 'bar_loading')\n name = name.split('.').pop();\n route(this, name + '_loading');\n route(this, name + '_error', { path: \"/_unused_dummy_error_path_route_\" + name + \"/:error\" });\n }\n },\n\n push: function(url, name, callback) {\n var parts = name.split('.');\n if (url === \"\" || url === \"/\" || parts[parts.length-1] === \"index\") { this.explicitIndex = true; }\n\n this.matches.push([url, name, callback]);\n },\n\n route: function(name, options) {\n Ember.assert(\"'basic' cannot be used as a route name.\", name !== 'basic');\n\n route(this, name, options);\n if (Ember.FEATURES.isEnabled(\"ember-routing-named-substates\")) {\n route(this, name + '_loading');\n route(this, name + '_error', { path: \"/_unused_dummy_error_path_route_\" + name + \"/:error\" });\n }\n },\n\n generate: function() {\n var dslMatches = this.matches;\n\n if (!this.explicitIndex) {\n this.route(\"index\", { path: \"/\" });\n }\n\n return function(match) {\n for (var i=0, l=dslMatches.length; i<l; i++) {\n var dslMatch = dslMatches[i];\n var matchObj = match(dslMatch[0]).to(dslMatch[1], dslMatch[2]);\n }\n };\n }\n };\n\n function route(dsl, name, options) {\n Ember.assert(\"You must use `this.resource` to nest\", typeof options !== 'function');\n\n options = options || {};\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (dsl.parent && dsl.parent !== 'application') {\n name = dsl.parent + \".\" + name;\n }\n\n dsl.push(options.path, name, null);\n }\n\n DSL.map = function(callback) {\n var dsl = new DSL();\n callback.call(dsl);\n return dsl;\n };\n\n __exports__[\"default\"] = DSL;\n });\ndefine(\"ember-routing/system/route\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/get_properties\",\"ember-metal/enumerable_utils\",\"ember-metal/is_none\",\"ember-metal/computed\",\"ember-metal/utils\",\"ember-metal/run_loop\",\"ember-runtime/keys\",\"ember-runtime/copy\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-runtime/mixins/action_handler\",\"ember-routing/system/controller_for\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, K, A, deprecate, assert, Logger\n var EmberError = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var getProperties = __dependency5__[\"default\"];\n var EnumerableUtils = __dependency6__[\"default\"];\n var isNone = __dependency7__.isNone;\n var computed = __dependency8__.computed;\n var typeOf = __dependency9__.typeOf;\n var run = __dependency10__[\"default\"];\n\n var keys = __dependency11__[\"default\"];\n var copy = __dependency12__[\"default\"];\n var classify = __dependency13__.classify;\n var fmt = __dependency13__.fmt;\n var EmberObject = __dependency14__[\"default\"];\n var ActionHandler = __dependency15__[\"default\"];\n var generateController = __dependency16__.generateController;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var a_forEach = EnumerableUtils.forEach,\n a_replace = EnumerableUtils.replace;\n\n /**\n The `Ember.Route` class is used to define individual routes. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Route\n @namespace Ember\n @extends Ember.Object\n @uses Ember.ActionHandler\n */\n var Route = EmberObject.extend(ActionHandler, {\n\n /**\n @private\n\n @method exit\n */\n exit: function() {\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n toggleQueryParamObservers(this, this.controller, false);\n }\n this.deactivate();\n this.teardownViews();\n },\n\n /**\n @private\n\n @method enter\n */\n enter: function() {\n this.activate();\n },\n\n /**\n The name of the view to use by default when rendering this routes template.\n\n When rendering a template, the route will, by default, determine the\n template and view to use from the name of the route itself. If you need to\n define a specific view, set this property.\n\n This is useful when multiple routes would benefit from using the same view\n because it doesn't require a custom `renderTemplate` method. For example,\n the following routes will all render using the `App.PostsListView` view:\n\n ```js\n var PostsList = Ember.Route.extend({\n viewName: 'postsList',\n });\n\n App.PostsIndexRoute = PostsList.extend();\n App.PostsArchivedRoute = PostsList.extend();\n ```\n\n @property viewName\n @type String\n @default null\n @since 1.4.0\n */\n viewName: null,\n\n /**\n The name of the template to use by default when rendering this routes\n template.\n\n This is similar with `viewName`, but is useful when you just want a custom\n template without a view.\n\n ```js\n var PostsList = Ember.Route.extend({\n templateName: 'posts/list'\n });\n\n App.PostsIndexRoute = PostsList.extend();\n App.PostsArchivedRoute = PostsList.extend();\n ```\n\n @property templateName\n @type String\n @default null\n @since 1.4.0\n */\n templateName: null,\n\n /**\n The name of the controller to associate with this route.\n\n By default, Ember will lookup a route's controller that matches the name\n of the route (i.e. `App.PostController` for `App.PostRoute`). However,\n if you would like to define a specific controller to use, you can do so\n using this property.\n\n This is useful in many ways, as the controller specified will be:\n\n * passed to the `setupController` method.\n * used as the controller for the view being rendered by the route.\n * returned from a call to `controllerFor` for the route.\n\n @property controllerName\n @type String\n @default null\n @since 1.4.0\n */\n controllerName: null,\n\n /**\n The `willTransition` action is fired at the beginning of any\n attempted transition with a `Transition` object as the sole\n argument. This action can be used for aborting, redirecting,\n or decorating the transition from the currently active routes.\n\n A good example is preventing navigation when a form is\n half-filled out:\n\n ```js\n App.ContactFormRoute = Ember.Route.extend({\n actions: {\n willTransition: function(transition) {\n if (this.controller.get('userHasEnteredData')) {\n this.controller.displayNavigationConfirm();\n transition.abort();\n }\n }\n }\n });\n ```\n\n You can also redirect elsewhere by calling\n `this.transitionTo('elsewhere')` from within `willTransition`.\n Note that `willTransition` will not be fired for the\n redirecting `transitionTo`, since `willTransition` doesn't\n fire when there is already a transition underway. If you want\n subsequent `willTransition` actions to fire for the redirecting\n transition, you must first explicitly call\n `transition.abort()`.\n\n @event willTransition\n @param {Transition} transition\n */\n\n /**\n The `didTransition` action is fired after a transition has\n successfully been completed. This occurs after the normal model\n hooks (`beforeModel`, `model`, `afterModel`, `setupController`)\n have resolved. The `didTransition` action has no arguments,\n however, it can be useful for tracking page views or resetting\n state on the controller.\n\n ```js\n App.LoginRoute = Ember.Route.extend({\n actions: {\n didTransition: function() {\n this.controller.get('errors.base').clear();\n return true; // Bubble the didTransition event\n }\n }\n });\n ```\n\n @event didTransition\n @since 1.2.0\n */\n\n /**\n The `loading` action is fired on the route when a route's `model`\n hook returns a promise that is not already resolved. The current\n `Transition` object is the first parameter and the route that\n triggered the loading event is the second parameter.\n\n ```js\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n loading: function(transition, route) {\n var view = Ember.View.create({\n classNames: ['app-loading']\n })\n .append();\n\n this.router.one('didTransition', function () {\n view.destroy();\n });\n return true; // Bubble the loading event\n }\n }\n });\n ```\n\n @event loading\n @param {Transition} transition\n @param {Ember.Route} route The route that triggered the loading event\n @since 1.2.0\n */\n\n /**\n When attempting to transition into a route, any of the hooks\n may return a promise that rejects, at which point an `error`\n action will be fired on the partially-entered routes, allowing\n for per-route error handling logic, or shared error handling\n logic defined on a parent route.\n\n Here is an example of an error handler that will be invoked\n for rejected promises from the various hooks on the route,\n as well as any unhandled errors from child routes:\n\n ```js\n App.AdminRoute = Ember.Route.extend({\n beforeModel: function() {\n return Ember.RSVP.reject(\"bad things!\");\n },\n\n actions: {\n error: function(error, transition) {\n // Assuming we got here due to the error in `beforeModel`,\n // we can expect that error === \"bad things!\",\n // but a promise model rejecting would also\n // call this hook, as would any errors encountered\n // in `afterModel`.\n\n // The `error` hook is also provided the failed\n // `transition`, which can be stored and later\n // `.retry()`d if desired.\n\n this.transitionTo('login');\n }\n }\n });\n ```\n\n `error` actions that bubble up all the way to `ApplicationRoute`\n will fire a default error handler that logs the error. You can\n specify your own global default error handler by overriding the\n `error` handler on `ApplicationRoute`:\n\n ```js\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n error: function(error, transition) {\n this.controllerFor('banner').displayError(error.message);\n }\n }\n });\n ```\n @event error\n @param {Error} error\n @param {Transition} transition\n */\n\n /**\n The controller associated with this route.\n\n Example\n\n ```javascript\n App.FormRoute = Ember.Route.extend({\n actions: {\n willTransition: function(transition) {\n if (this.controller.get('userHasEnteredData') &&\n !confirm(\"Are you sure you want to abandon progress?\")) {\n transition.abort();\n } else {\n // Bubble the `willTransition` action so that\n // parent routes can decide whether or not to abort.\n return true;\n }\n }\n }\n });\n ```\n\n @property controller\n @type Ember.Controller\n @since 1.6.0\n */\n\n _actions: {\n\n queryParamsDidChange: function(changed, totalPresent, removed) {\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n var totalChanged = keys(changed).concat(keys(removed));\n for (var i = 0, len = totalChanged.length; i < len; ++i) {\n var urlKey = totalChanged[i],\n options = get(this.queryParams, urlKey) || {};\n if (get(options, 'refreshModel')) {\n this.refresh();\n }\n }\n return true;\n }\n },\n\n finalizeQueryParamChange: function(params, finalParams, transition) {\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n // In this hook we receive all the current values of\n // serialized query params. We need to take these values\n // and distribute them in their deserialized form into\n // controllers and remove any that no longer belong in\n // this route hierarchy.\n\n var controller = this.controller,\n changes = controller._queryParamChangesDuringSuspension,\n qpMeta = get(this, '_qp');\n\n // Loop through all the query params that\n // this controller knows about.\n\n if (qpMeta) {\n for (var i = 0, len = qpMeta.qps.length; i < len; ++i) {\n var qp = qpMeta.qps[i],\n qpProvided = qp.urlKey in params;\n\n // Do a reverse lookup to see if the changed query\n // param URL key corresponds to a QP property on\n // this controller.\n var value, svalue;\n if (changes && qp.urlKey in changes) {\n // Controller overrode this value in setupController\n svalue = get(controller, qp.prop);\n value = this.deserializeQueryParam(svalue, qp.urlKey, qp.type);\n } else {\n if (qpProvided) {\n svalue = params[qp.urlKey];\n value = this.deserializeQueryParam(svalue, qp.urlKey, qp.type);\n } else {\n // No QP provided; use default value.\n svalue = qp.sdef;\n value = qp.def;\n }\n }\n\n // Delete from params so that parent routes\n // don't also try to respond to changes to\n // non-fully-qualified query param name changes\n // (e.g. if two controllers in the same hiearchy\n // specify a `page` query param)\n delete params[qp.urlKey];\n\n // Now check if this value actually changed.\n if (svalue !== qp.svalue) {\n var options = get(this.queryParams, qp.urlKey) || {};\n if (get(options, 'replace')) {\n transition.method('replace');\n }\n\n // Update QP cache\n qp.svalue = svalue;\n qp.value = value;\n\n // Update controller without firing QP observers.\n controller._finalizingQueryParams = true;\n set(controller, qp.prop, qp.value);\n controller._finalizingQueryParams = false;\n }\n\n finalParams.push({\n value: qp.svalue,\n visible: qp.svalue !== qp.sdef,\n key: qp.urlKey\n });\n }\n controller._queryParamChangesDuringSuspension = null;\n }\n // Bubble so that parent routes can claim QPs.\n return true;\n }\n }\n },\n\n /**\n @deprecated\n\n Please use `actions` instead.\n @method events\n */\n events: null,\n\n mergedProperties: ['events'],\n\n /**\n This hook is executed when the router completely exits this route. It is\n not executed when the model for the route changes.\n\n @method deactivate\n */\n deactivate: Ember.K,\n\n /**\n This hook is executed when the router enters the route. It is not executed\n when the model for the route changes.\n\n @method activate\n */\n activate: Ember.K,\n\n /**\n Transition the application into another route. The route may\n be either a single route or route path:\n\n ```javascript\n this.transitionTo('blogPosts');\n this.transitionTo('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n this.transitionTo('blogPost', aPost);\n ```\n\n If a literal is passed (such as a number or a string), it will\n be treated as an identifier instead. In this case, the `model`\n hook of the route will be triggered:\n\n ```javascript\n this.transitionTo('blogPost', 1);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n App.Router.map(function() {\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n });\n\n this.transitionTo('blogComment', aPost, aComment);\n this.transitionTo('blogComment', 1, 13);\n ```\n\n It is also possible to pass a URL (a string that starts with a\n `/`). This is intended for testing and debugging purposes and\n should rarely be used in production code.\n\n ```javascript\n this.transitionTo('/');\n this.transitionTo('/blog/post/1/comment/13');\n ```\n\n See also 'replaceWith'.\n\n Simple Transition Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.route(\"secret\");\n this.route(\"fourOhFour\", { path: \"*:\"});\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n moveToSecret: function(context){\n if (authorized()){\n this.transitionTo('secret', context);\n }\n this.transitionTo('fourOhFour');\n }\n }\n });\n ```\n\n Transition to a nested route\n\n ```javascript\n App.Router.map(function() {\n this.resource('articles', { path: '/articles' }, function() {\n this.route('new');\n });\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n transitionToNewArticle: function() {\n this.transitionTo('articles.new');\n }\n }\n });\n ```\n\n Multiple Models Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.resource('breakfast', {path:':breakfastId'}, function(){\n this.resource('cereal', {path: ':cerealId'});\n });\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n moveToChocolateCereal: function(){\n var cereal = { cerealId: \"ChocolateYumminess\"},\n breakfast = {breakfastId: \"CerealAndMilk\"};\n\n this.transitionTo('cereal', breakfast, cereal);\n }\n }\n });\n ```\n\n @method transitionTo\n @param {String} name the name of the route or a URL\n @param {...Object} models the model(s) or identifier(s) to be used while\n transitioning to the route.\n @return {Transition} the transition object associated with this\n attempted transition\n */\n transitionTo: function(name, context) {\n var router = this.router;\n return router.transitionTo.apply(router, arguments);\n },\n\n /**\n Perform a synchronous transition into another route without attempting\n to resolve promises, update the URL, or abort any currently active\n asynchronous transitions (i.e. regular transitions caused by\n `transitionTo` or URL changes).\n\n This method is handy for performing intermediate transitions on the\n way to a final destination route, and is called internally by the\n default implementations of the `error` and `loading` handlers.\n\n @method intermediateTransitionTo\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n @since 1.2.0\n */\n intermediateTransitionTo: function() {\n var router = this.router;\n router.intermediateTransitionTo.apply(router, arguments);\n },\n\n /**\n Refresh the model on this route and any child routes, firing the\n `beforeModel`, `model`, and `afterModel` hooks in a similar fashion\n to how routes are entered when transitioning in from other route.\n The current route params (e.g. `article_id`) will be passed in\n to the respective model hooks, and if a different model is returned,\n `setupController` and associated route hooks will re-fire as well.\n\n An example usage of this method is re-querying the server for the\n latest information using the same parameters as when the route\n was first entered.\n\n Note that this will cause `model` hooks to fire even on routes\n that were provided a model object when the route was initially\n entered.\n\n @method refresh\n @return {Transition} the transition object associated with this\n attempted transition\n @since 1.4.0\n */\n refresh: function() {\n return this.router.router.refresh(this);\n },\n\n /**\n Transition into another route while replacing the current URL, if possible.\n This will replace the current history entry instead of adding a new one.\n Beside that, it is identical to `transitionTo` in all other respects. See\n 'transitionTo' for additional information regarding multiple models.\n\n Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.route(\"secret\");\n });\n\n App.SecretRoute = Ember.Route.extend({\n afterModel: function() {\n if (!authorized()){\n this.replaceWith('index');\n }\n }\n });\n ```\n\n @method replaceWith\n @param {String} name the name of the route or a URL\n @param {...Object} models the model(s) or identifier(s) to be used while\n transitioning to the route.\n @return {Transition} the transition object associated with this\n attempted transition\n */\n replaceWith: function() {\n var router = this.router;\n return router.replaceWith.apply(router, arguments);\n },\n\n /**\n Sends an action to the router, which will delegate it to the currently\n active route hierarchy per the bubbling rules explained under `actions`.\n\n Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n });\n\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n track: function(arg) {\n console.log(arg, 'was clicked');\n }\n }\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n trackIfDebug: function(arg) {\n if (debug) {\n this.send('track', arg);\n }\n }\n }\n });\n ```\n\n @method send\n @param {String} name the name of the action to trigger\n @param {...*} args\n */\n send: function() {\n return this.router.send.apply(this.router, arguments);\n },\n\n /**\n This hook is the entry point for router.js\n\n @private\n @method setup\n */\n setup: function(context, transition) {\n var controllerName = this.controllerName || this.routeName,\n controller = this.controllerFor(controllerName, true);\n if (!controller) {\n controller = this.generateController(controllerName, context);\n }\n\n // Assign the route's controller so that it can more easily be\n // referenced in action handlers\n this.controller = controller;\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n toggleQueryParamObservers(this, controller, true);\n }\n\n if (this.setupControllers) {\n Ember.deprecate(\"Ember.Route.setupControllers is deprecated. Please use Ember.Route.setupController(controller, model) instead.\");\n this.setupControllers(controller, context);\n } else {\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n // Prevent updates to query params in setupController\n // from firing another transition. Updating QPs in\n // setupController will only affect the final\n // generated URL.\n controller._finalizingQueryParams = true;\n controller._queryParamChangesDuringSuspension = {};\n this.setupController(controller, context, transition);\n controller._finalizingQueryParams = false;\n } else {\n this.setupController(controller, context);\n }\n }\n\n if (this.renderTemplates) {\n Ember.deprecate(\"Ember.Route.renderTemplates is deprecated. Please use Ember.Route.renderTemplate(controller, model) instead.\");\n this.renderTemplates(context);\n } else {\n this.renderTemplate(controller, context);\n }\n },\n\n /**\n This hook is the first of the route entry validation hooks\n called when an attempt is made to transition into a route\n or one of its children. It is called before `model` and\n `afterModel`, and is appropriate for cases when:\n\n 1) A decision can be made to redirect elsewhere without\n needing to resolve the model first.\n 2) Any async operations need to occur first before the\n model is attempted to be resolved.\n\n This hook is provided the current `transition` attempt\n as a parameter, which can be used to `.abort()` the transition,\n save it for a later `.retry()`, or retrieve values set\n on it from a previous hook. You can also just call\n `this.transitionTo` to another route to implicitly\n abort the `transition`.\n\n You can return a promise from this hook to pause the\n transition until the promise resolves (or rejects). This could\n be useful, for instance, for retrieving async code from\n the server that is required to enter a route.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n beforeModel: function(transition) {\n if (!App.Post) {\n return Ember.$.getScript('/models/post.js');\n }\n }\n });\n ```\n\n If `App.Post` doesn't exist in the above example,\n `beforeModel` will use jQuery's `getScript`, which\n returns a promise that resolves after the server has\n successfully retrieved and executed the code from the\n server. Note that if an error were to occur, it would\n be passed to the `error` hook on `Ember.Route`, but\n it's also possible to handle errors specific to\n `beforeModel` right from within the hook (to distinguish\n from the shared error handling behavior of the `error`\n hook):\n\n ```js\n App.PostRoute = Ember.Route.extend({\n beforeModel: function(transition) {\n if (!App.Post) {\n var self = this;\n return Ember.$.getScript('post.js').then(null, function(e) {\n self.transitionTo('help');\n\n // Note that the above transitionTo will implicitly\n // halt the transition. If you were to return\n // nothing from this promise reject handler,\n // according to promise semantics, that would\n // convert the reject into a resolve and the\n // transition would continue. To propagate the\n // error so that it'd be handled by the `error`\n // hook, you would have to either\n return Ember.RSVP.reject(e);\n });\n }\n }\n });\n ```\n\n @method beforeModel\n @param {Transition} transition\n @param {Object} queryParams the active query params for this route\n @return {Promise} if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.\n */\n beforeModel: Ember.K,\n\n /**\n This hook is called after this route's model has resolved.\n It follows identical async/promise semantics to `beforeModel`\n but is provided the route's resolved model in addition to\n the `transition`, and is therefore suited to performing\n logic that can only take place after the model has already\n resolved.\n\n ```js\n App.PostsRoute = Ember.Route.extend({\n afterModel: function(posts, transition) {\n if (posts.get('length') === 1) {\n this.transitionTo('post.show', posts.get('firstObject'));\n }\n }\n });\n ```\n\n Refer to documentation for `beforeModel` for a description\n of transition-pausing semantics when a promise is returned\n from this hook.\n\n @method afterModel\n @param {Object} resolvedModel the value returned from `model`,\n or its resolved value if it was a promise\n @param {Transition} transition\n @param {Object} queryParams the active query params for this handler\n @return {Promise} if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.\n */\n afterModel: Ember.K,\n\n /**\n A hook you can implement to optionally redirect to another route.\n\n If you call `this.transitionTo` from inside of this hook, this route\n will not be entered in favor of the other hook.\n\n `redirect` and `afterModel` behave very similarly and are\n called almost at the same time, but they have an important\n distinction in the case that, from one of these hooks, a\n redirect into a child route of this route occurs: redirects\n from `afterModel` essentially invalidate the current attempt\n to enter this route, and will result in this route's `beforeModel`,\n `model`, and `afterModel` hooks being fired again within\n the new, redirecting transition. Redirects that occur within\n the `redirect` hook, on the other hand, will _not_ cause\n these hooks to be fired again the second time around; in\n other words, by the time the `redirect` hook has been called,\n both the resolved model and attempted entry into this route\n are considered to be fully validated.\n\n @method redirect\n @param {Object} model the model for this route\n */\n redirect: Ember.K,\n\n /**\n Called when the context is changed by router.js.\n\n @private\n @method contextDidChange\n */\n contextDidChange: function() {\n this.currentModel = this.context;\n },\n\n /**\n A hook you can implement to convert the URL into the model for\n this route.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n The model for the `post` route is `App.Post.find(params.post_id)`.\n\n By default, if your route has a dynamic segment ending in `_id`:\n\n * The model class is determined from the segment (`post_id`'s\n class is `App.Post`)\n * The find method is called on the model class with the value of\n the dynamic segment.\n\n Note that for routes with dynamic segments, this hook is only\n executed when entered via the URL. If the route is entered\n through a transition (e.g. when using the `link-to` Handlebars\n helper), then a model context is already provided and this hook\n is not called. Routes without dynamic segments will always\n execute the model hook.\n\n This hook follows the asynchronous/promise semantics\n described in the documentation for `beforeModel`. In particular,\n if a promise returned from `model` fails, the error will be\n handled by the `error` hook on `Ember.Route`.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n return App.Post.find(params.post_id);\n }\n });\n ```\n\n @method model\n @param {Object} params the parameters extracted from the URL\n @param {Transition} transition\n @param {Object} queryParams the query params for this route\n @return {Object|Promise} the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.\n */\n model: function(params, transition) {\n var match, name, sawParams, value;\n\n for (var prop in params) {\n if (prop === 'queryParams') { continue; }\n\n if (match = prop.match(/^(.*)_id$/)) {\n name = match[1];\n value = params[prop];\n }\n sawParams = true;\n }\n\n if (!name && sawParams) { return copy(params); }\n else if (!name) {\n if (transition.resolveIndex !== transition.state.handlerInfos.length-1) { return; }\n\n var parentModel = transition.state.handlerInfos[transition.resolveIndex-1].context;\n\n return parentModel;\n }\n\n return this.findModel(name, value);\n },\n\n /**\n @private\n @method deserialize\n @param {Object} params the parameters extracted from the URL\n @param {Transition} transition\n @return {Object|Promise} the model for this route.\n\n Router.js hook.\n */\n deserialize: function(params, transition) {\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n return this.model(this.paramsFor(this.routeName), transition);\n } else {\n return this.model(params, transition);\n }\n },\n\n /**\n\n @method findModel\n @param {String} type the model type\n @param {Object} value the value passed to find\n */\n findModel: function(){\n var store = get(this, 'store');\n return store.find.apply(store, arguments);\n },\n\n /**\n Store property provides a hook for data persistence libraries to inject themselves.\n\n By default, this store property provides the exact same functionality previously\n in the model hook.\n\n Currently, the required interface is:\n\n `store.find(modelName, findArguments)`\n\n @method store\n @param {Object} store\n */\n store: computed(function(){\n var container = this.container;\n var routeName = this.routeName;\n var namespace = get(this, 'router.namespace');\n\n return {\n find: function(name, value) {\n var modelClass = container.lookupFactory('model:' + name);\n\n Ember.assert(\"You used the dynamic segment \" + name + \"_id in your route \" +\n routeName + \", but \" + namespace + \".\" + classify(name) +\n \" did not exist and you did not override your route's `model` \" +\n \"hook.\", modelClass);\n\n if (!modelClass) { return; }\n\n Ember.assert(classify(name) + ' has no method `find`.', typeof modelClass.find === 'function');\n\n return modelClass.find(value);\n }\n };\n }),\n\n /**\n A hook you can implement to convert the route's model into parameters\n for the URL.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n // the server returns `{ id: 12 }`\n return jQuery.getJSON(\"/posts/\" + params.post_id);\n },\n\n serialize: function(model) {\n // this will make the URL `/posts/12`\n return { post_id: model.id };\n }\n });\n ```\n\n The default `serialize` method will insert the model's `id` into the\n route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.\n If the route has multiple dynamic segments or does not contain '_id', `serialize`\n will return `Ember.getProperties(model, params)`\n\n This method is called when `transitionTo` is called with a context\n in order to populate the URL.\n\n @method serialize\n @param {Object} model the route's model\n @param {Array} params an Array of parameter names for the current\n route (in the example, `['post_id']`.\n @return {Object} the serialized parameters\n */\n serialize: function(model, params) {\n if (params.length < 1) { return; }\n if (!model) { return; }\n\n var name = params[0], object = {};\n\n if (/_id$/.test(name) && params.length === 1) {\n object[name] = get(model, \"id\");\n } else {\n object = getProperties(model, params);\n }\n\n return object;\n },\n\n /**\n A hook you can use to setup the controller for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook.\n\n By default, the `setupController` hook sets the `content` property of\n the controller to the `model`.\n\n If you implement the `setupController` hook in your Route, it will\n prevent this default behavior. If you want to preserve that behavior\n when implementing your `setupController` function, make sure to call\n `_super`:\n\n ```js\n App.PhotosRoute = Ember.Route.extend({\n model: function() {\n return App.Photo.find();\n },\n\n setupController: function (controller, model) {\n // Call _super for default behavior\n this._super(controller, model);\n // Implement your custom setup after\n this.controllerFor('application').set('showingPhotos', true);\n }\n });\n ```\n\n This means that your template will get a proxy for the model as its\n context, and you can act as though the model itself was the context.\n\n The provided controller will be one resolved based on the name\n of this route.\n\n If no explicit controller is defined, Ember will automatically create\n an appropriate controller for the model.\n\n * if the model is an `Ember.Array` (including record arrays from Ember\n Data), the controller is an `Ember.ArrayController`.\n * otherwise, the controller is an `Ember.ObjectController`.\n\n As an example, consider the router:\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n For the `post` route, a controller named `App.PostController` would\n be used if it is defined. If it is not defined, an `Ember.ObjectController`\n instance would be used.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, model) {\n controller.set('model', model);\n }\n });\n ```\n\n @method setupController\n @param {Controller} controller instance\n @param {Object} model\n */\n setupController: function(controller, context, transition) {\n if (controller && (context !== undefined)) {\n set(controller, 'model', context);\n }\n },\n\n /**\n Returns the controller for a particular route or name.\n\n The controller instance must already have been created, either through entering the\n associated route or using `generateController`.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.controllerFor('posts').set('currentPost', post);\n }\n });\n ```\n\n @method controllerFor\n @param {String} name the name of the route or controller\n @return {Ember.Controller}\n */\n controllerFor: function(name, _skipAssert) {\n var container = this.container,\n route = container.lookup('route:'+name),\n controller;\n\n if (route && route.controllerName) {\n name = route.controllerName;\n }\n\n controller = container.lookup('controller:' + name);\n\n // NOTE: We're specifically checking that skipAssert is true, because according\n // to the old API the second parameter was model. We do not want people who\n // passed a model to skip the assertion.\n Ember.assert(\"The controller named '\"+name+\"' could not be found. Make sure \" +\n \"that this route exists and has already been entered at least \" +\n \"once. If you are accessing a controller not associated with a \" +\n \"route, make sure the controller class is explicitly defined.\",\n controller || _skipAssert === true);\n\n return controller;\n },\n\n /**\n Generates a controller for a route.\n\n If the optional model is passed then the controller type is determined automatically,\n e.g., an ArrayController for arrays.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.generateController('posts', post);\n }\n });\n ```\n\n @method generateController\n @param {String} name the name of the controller\n @param {Object} model the model to infer the type of the controller (optional)\n */\n generateController: function(name, model) {\n var container = this.container;\n\n model = model || this.modelFor(name);\n\n return generateController(container, name, model);\n },\n\n /**\n Returns the model of a parent (or any ancestor) route\n in a route hierarchy. During a transition, all routes\n must resolve a model object, and if a route\n needs access to a parent route's model in order to\n resolve a model (or just reuse the model from a parent),\n it can call `this.modelFor(theNameOfParentRoute)` to\n retrieve it.\n\n Example\n\n ```js\n App.Router.map(function() {\n this.resource('post', { path: '/post/:post_id' }, function() {\n this.resource('comments');\n });\n });\n\n App.CommentsRoute = Ember.Route.extend({\n afterModel: function() {\n this.set('post', this.modelFor('post'));\n }\n });\n ```\n\n @method modelFor\n @param {String} name the name of the route\n @return {Object} the model object\n */\n modelFor: function(name) {\n var route = this.container.lookup('route:' + name),\n transition = this.router ? this.router.router.activeTransition : null;\n\n // If we are mid-transition, we want to try and look up\n // resolved parent contexts on the current transitionEvent.\n if (transition) {\n var modelLookupName = (route && route.routeName) || name;\n if (transition.resolvedModels.hasOwnProperty(modelLookupName)) {\n return transition.resolvedModels[modelLookupName];\n }\n }\n\n return route && route.currentModel;\n },\n\n /**\n A hook you can use to render the template for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook. By default, it renders the route's\n template, configured with the controller for the route.\n\n This method can be overridden to set up and render additional or\n alternative templates.\n\n ```js\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function(controller, model) {\n var favController = this.controllerFor('favoritePost');\n\n // Render the `favoritePost` template into\n // the outlet `posts`, and display the `favoritePost`\n // controller.\n this.render('favoritePost', {\n outlet: 'posts',\n controller: favController\n });\n }\n });\n ```\n\n @method renderTemplate\n @param {Object} controller the route's controller\n @param {Object} model the route's model\n */\n renderTemplate: function(controller, model) {\n this.render();\n },\n\n /**\n Renders a template into an outlet.\n\n This method has a number of defaults, based on the name of the\n route specified in the router.\n\n For example:\n\n ```js\n App.Router.map(function() {\n this.route('index');\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render();\n }\n });\n ```\n\n The name of the `PostRoute`, as defined by the router, is `post`.\n\n By default, render will:\n\n * render the `post` template\n * with the `post` view (`PostView`) for event handling, if one exists\n * and the `post` controller (`PostController`), if one exists\n * into the `main` outlet of the `application` template\n\n You can override this behavior:\n\n ```js\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render('myPost', { // the template to render\n into: 'index', // the template to render into\n outlet: 'detail', // the name of the outlet in that template\n controller: 'blogPost' // the controller to use for the template\n });\n }\n });\n ```\n\n Remember that the controller's `content` will be the route's model. In\n this case, the default model will be `App.Post.find(params.post_id)`.\n\n @method render\n @param {String} name the name of the template to render\n @param {Object} options the options\n */\n render: function(name, options) {\n Ember.assert(\"The name in the given arguments is undefined\", arguments.length > 0 ? !isNone(arguments[0]) : true);\n\n var namePassed = typeof name === 'string' && !!name;\n\n if (typeof name === 'object' && !options) {\n options = name;\n name = this.routeName;\n }\n\n options = options || {};\n\n var templateName;\n\n if (name) {\n name = name.replace(/\\//g, '.');\n templateName = name;\n } else {\n name = this.routeName;\n templateName = this.templateName || name;\n }\n\n var viewName = options.view || namePassed && name || this.viewName || name;\n\n var container = this.container,\n view = container.lookup('view:' + viewName),\n template = view ? view.get('template') : null;\n\n if (!template) {\n template = container.lookup('template:' + templateName);\n }\n\n if (!view && !template) {\n Ember.assert(\"Could not find \\\"\" + name + \"\\\" template or view.\", Ember.isEmpty(arguments[0]));\n if (get(this.router, 'namespace.LOG_VIEW_LOOKUPS')) {\n Ember.Logger.info(\"Could not find \\\"\" + name + \"\\\" template or view. Nothing will be rendered\", { fullName: 'template:' + name });\n }\n return;\n }\n\n options = normalizeOptions(this, name, template, options);\n view = setupView(view, container, options);\n\n if (options.outlet === 'main') { this.lastRenderedTemplate = name; }\n\n appendView(this, view, options);\n },\n\n /**\n Disconnects a view that has been rendered into an outlet.\n\n You may pass any or all of the following options to `disconnectOutlet`:\n\n * `outlet`: the name of the outlet to clear (default: 'main')\n * `parentView`: the name of the view containing the outlet to clear\n (default: the view rendered by the parent route)\n\n Example:\n\n ```js\n App.ApplicationRoute = App.Route.extend({\n actions: {\n showModal: function(evt) {\n this.render(evt.modalName, {\n outlet: 'modal',\n into: 'application'\n });\n },\n hideModal: function(evt) {\n this.disconnectOutlet({\n outlet: 'modal',\n parentView: 'application'\n });\n }\n }\n });\n ```\n\n Alternatively, you can pass the `outlet` name directly as a string.\n\n Example:\n\n ```js\n hideModal: function(evt) {\n this.disconnectOutlet('modal');\n }\n ```\n\n @method disconnectOutlet\n @param {Object|String} options the options hash or outlet name\n */\n disconnectOutlet: function(options) {\n if (!options || typeof options === \"string\") {\n var outletName = options;\n options = {};\n options.outlet = outletName;\n }\n options.parentView = options.parentView ? options.parentView.replace(/\\//g, '.') : parentTemplate(this);\n options.outlet = options.outlet || 'main';\n\n var parentView = this.router._lookupActiveView(options.parentView);\n if (parentView) { parentView.disconnectOutlet(options.outlet); }\n },\n\n willDestroy: function() {\n this.teardownViews();\n },\n\n /**\n @private\n\n @method teardownViews\n */\n teardownViews: function() {\n // Tear down the top level view\n if (this.teardownTopLevelView) { this.teardownTopLevelView(); }\n\n // Tear down any outlets rendered with 'into'\n var teardownOutletViews = this.teardownOutletViews || [];\n a_forEach(teardownOutletViews, function(teardownOutletView) {\n teardownOutletView();\n });\n\n delete this.teardownTopLevelView;\n delete this.teardownOutletViews;\n delete this.lastRenderedTemplate;\n }\n });\n\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n Route.reopen({\n /**\n Configuration hash for this route's queryParams. The possible\n configuration options and their defaults are as follows\n (assuming a query param whose URL key is `page`):\n\n ```js\n queryParams: {\n page: {\n // By default, controller query param properties don't\n // cause a full transition when they are changed, but\n // rather only cause the URL to update. Setting\n // `refreshModel` to true will cause an \"in-place\"\n // transition to occur, whereby the model hooks for\n // this route (and any child routes) will re-fire, allowing\n // you to reload models (e.g., from the server) using the\n // updated query param values.\n refreshModel: false,\n\n // By default, changes to controller query param properties\n // cause the URL to update via `pushState`, which means an\n // item will be added to the browser's history, allowing\n // you to use the back button to restore the app to the\n // previous state before the query param property was changed.\n // Setting `replace` to true will use `replaceState` (or its\n // hash location equivalent), which causes no browser history\n // item to be added. This options name and default value are\n // the same as the `link-to` helper's `replace` option.\n replace: false\n }\n }\n ```\n\n @property queryParams\n @for Ember.Route\n @type Hash\n */\n queryParams: {},\n\n _qp: computed(function() {\n var controllerName = this.controllerName || this.routeName,\n fullName = this.container.normalize('controller:' + controllerName),\n controllerClass = this.container.lookupFactory(fullName);\n\n if (!controllerClass) { return; }\n\n var controllerProto = controllerClass.proto(),\n queryParams = get(controllerProto, 'queryParams');\n\n if (!queryParams || queryParams.length === 0) { return; }\n\n var qps = [], map = {};\n for (var i = 0, len = queryParams.length; i < len; ++i) {\n var queryParamMapping = queryParams[i],\n parts = queryParamMapping.split(':'),\n propName = parts[0],\n urlKey = parts[1] || propName,\n defaultValue = get(controllerProto, propName),\n type = typeOf(defaultValue),\n defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type),\n qp = {\n def: defaultValue,\n sdef: defaultValueSerialized,\n type: type,\n urlKey: urlKey,\n prop: propName,\n ctrl: controllerName,\n value: defaultValue,\n svalue: defaultValueSerialized,\n route: this\n };\n\n // Construct all the different ways this query param\n // can be referenced, either from link-to or transitionTo:\n // - {{link-to (query-params page=5)}}\n // - {{link-to (query-params articles:page=5)}}\n // - {{link-to (query-params articles_page=5)}}\n // - {{link-to (query-params articles:articles_page=5)}}\n // - transitionTo({ queryParams: { page: 5 } })\n // ... etc.\n\n map[propName] = map[urlKey] = map[controllerName + ':' + propName] = qp;\n qps.push(qp);\n }\n\n return {\n qps: qps,\n map: map\n };\n }),\n\n mergedProperties: ['queryParams'],\n\n paramsFor: function(name) {\n var route = this.container.lookup('route:' + name);\n\n if (!route) {\n return {};\n }\n\n var transition = this.router.router.activeTransition,\n params, queryParams;\n\n if (transition) {\n params = transition.params[name] || {};\n queryParams = transition.queryParams;\n } else {\n var state = this.router.router.state;\n params = state.params[name] || {};\n queryParams = state.queryParams;\n }\n\n var qpMeta = get(route, '_qp');\n\n if (!qpMeta) {\n // No query params specified on the controller.\n return params;\n }\n\n var qps = qpMeta.qps, map = qpMeta.map, qp;\n\n // Loop through all the query params defined on the controller\n for (var i = 0, len = qps.length; i < len; ++i) {\n // Put deserialized qp on params hash.\n qp = qps[i];\n params[qp.urlKey] = qp.value;\n }\n\n // Override params hash values with any input query params\n // from the transition attempt.\n for (var urlKey in queryParams) {\n // Ignore any params not for this route.\n if (!(urlKey in map)) { continue; }\n\n var svalue = queryParams[urlKey];\n qp = map[urlKey];\n if (svalue === null) {\n // Query param was removed from address bar.\n svalue = qp.sdef;\n }\n\n // Deserialize and stash on params.\n params[urlKey] = route.deserializeQueryParam(svalue, urlKey, qp.type);\n }\n\n return params;\n },\n\n serializeQueryParam: function(value, urlKey, defaultValueType) {\n // urlKey isn't used here, but anyone overriding\n // can use it to provide serialization specific\n // to a certain query param.\n if (defaultValueType === 'array') {\n return JSON.stringify(value);\n }\n return '' + value;\n },\n\n deserializeQueryParam: function(value, urlKey, defaultValueType) {\n // urlKey isn't used here, but anyone overriding\n // can use it to provide deserialization specific\n // to a certain query param.\n\n // Use the defaultValueType of the default value (the initial value assigned to a\n // controller query param property), to intelligently deserialize and cast.\n if (defaultValueType === 'boolean') {\n return (value === 'true') ? true : false;\n } else if (defaultValueType === 'number') {\n return (Number(value)).valueOf();\n } else if (defaultValueType === 'array') {\n return Ember.A(JSON.parse(value));\n }\n return value;\n },\n\n _qpChanged: function(controller, propName) {\n // Normalize array observer firings.\n if (propName.slice(propName.length - 3) === '.[]') {\n propName = propName.substr(0, propName.length-3);\n }\n\n var qpMeta = get(this, '_qp'),\n qp = qpMeta.map[propName];\n\n if (controller._finalizingQueryParams) {\n var changes = controller._queryParamChangesDuringSuspension;\n if (changes) {\n changes[qp.urlKey] = true;\n }\n return;\n }\n\n var value = copy(get(controller, propName));\n\n this.router._queuedQPChanges[qp.prop] = value;\n run.once(this, this._fireQueryParamTransition);\n },\n\n _fireQueryParamTransition: function() {\n this.transitionTo({ queryParams: this.router._queuedQPChanges });\n this.router._queuedQPChanges = {};\n }\n });\n }\n\n function parentRoute(route) {\n var handlerInfos = route.router.router.state.handlerInfos;\n\n if (!handlerInfos) { return; }\n\n var parent, current;\n\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n current = handlerInfos[i].handler;\n if (current === route) { return parent; }\n parent = current;\n }\n }\n\n function parentTemplate(route) {\n var parent = parentRoute(route), template;\n\n if (!parent) { return; }\n\n if (template = parent.lastRenderedTemplate) {\n return template;\n } else {\n return parentTemplate(parent);\n }\n }\n\n function normalizeOptions(route, name, template, options) {\n options = options || {};\n options.into = options.into ? options.into.replace(/\\//g, '.') : parentTemplate(route);\n options.outlet = options.outlet || 'main';\n options.name = name;\n options.template = template;\n options.LOG_VIEW_LOOKUPS = get(route.router, 'namespace.LOG_VIEW_LOOKUPS');\n\n Ember.assert(\"An outlet (\"+options.outlet+\") was specified but was not found.\", options.outlet === 'main' || options.into);\n\n var controller = options.controller,\n model = options.model,\n namedController;\n\n if (options.controller) {\n controller = options.controller;\n } else if (namedController = route.container.lookup('controller:' + name)) {\n controller = namedController;\n } else {\n controller = route.controllerName || route.routeName;\n }\n\n if (typeof controller === 'string') {\n var controllerName = controller;\n controller = route.container.lookup('controller:' + controllerName);\n if (!controller) {\n throw new EmberError(\"You passed `controller: '\" + controllerName + \"'` into the `render` method, but no such controller could be found.\");\n }\n }\n\n if (model) {\n controller.set('model', model);\n }\n\n options.controller = controller;\n\n return options;\n }\n\n function setupView(view, container, options) {\n if (view) {\n if (options.LOG_VIEW_LOOKUPS) {\n Ember.Logger.info(\"Rendering \" + options.name + \" with \" + view, { fullName: 'view:' + options.name });\n }\n } else {\n var defaultView = options.into ? 'view:default' : 'view:toplevel';\n view = container.lookup(defaultView);\n if (options.LOG_VIEW_LOOKUPS) {\n Ember.Logger.info(\"Rendering \" + options.name + \" with default view \" + view, { fullName: 'view:' + options.name });\n }\n }\n\n if (!get(view, 'templateName')) {\n set(view, 'template', options.template);\n\n set(view, '_debugTemplateName', options.name);\n }\n\n set(view, 'renderedName', options.name);\n set(view, 'controller', options.controller);\n\n return view;\n }\n\n function appendView(route, view, options) {\n if (options.into) {\n var parentView = route.router._lookupActiveView(options.into);\n var teardownOutletView = generateOutletTeardown(parentView, options.outlet);\n if (!route.teardownOutletViews) { route.teardownOutletViews = []; }\n a_replace(route.teardownOutletViews, 0, 0, [teardownOutletView]);\n parentView.connectOutlet(options.outlet, view);\n } else {\n var rootElement = get(route, 'router.namespace.rootElement');\n // tear down view if one is already rendered\n if (route.teardownTopLevelView) {\n route.teardownTopLevelView();\n }\n route.router._connectActiveView(options.name, view);\n route.teardownTopLevelView = generateTopLevelTeardown(view);\n view.appendTo(rootElement);\n }\n }\n\n function generateTopLevelTeardown(view) {\n return function() { view.destroy(); };\n }\n\n function generateOutletTeardown(parentView, outlet) {\n return function() { parentView.disconnectOutlet(outlet); };\n }\n\n function toggleQueryParamObservers(route, controller, enable) {\n var queryParams = get(controller, 'queryParams'), i, len,\n method = enable ? 'addObserver' : 'removeObserver';\n\n for (i = 0, len = queryParams.length; i < len; ++i) {\n var prop = queryParams[i].split(':')[0];\n controller[method](prop, route, route._qpChanged);\n controller[method](prop + '.[]', route, route._qpChanged);\n }\n }\n\n __exports__[\"default\"] = Route;\n });\ndefine(\"ember-routing/system/router\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/array\",\"ember-metal/properties\",\"ember-metal/computed\",\"ember-metal/merge\",\"ember-metal/run_loop\",\"ember-metal/enumerable_utils\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-runtime/mixins/evented\",\"ember-routing/system/dsl\",\"ember-views/views/view\",\"ember-routing/location/api\",\"ember-handlebars/views/metamorph_view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, Logger, K, assert\n var EmberError = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var forEach = __dependency5__.forEach;\n var defineProperty = __dependency6__.defineProperty;\n var computed = __dependency7__.computed;\n var merge = __dependency8__[\"default\"];\n var run = __dependency9__[\"default\"];\n var EnumerableUtils = __dependency10__[\"default\"];\n\n var fmt = __dependency11__.fmt;\n var EmberObject = __dependency12__[\"default\"];\n var Evented = __dependency13__[\"default\"];\n var EmberRouterDSL = __dependency14__[\"default\"];\n var EmberView = __dependency15__.View;\n var EmberLocation = __dependency16__[\"default\"];\n var _MetamorphView = __dependency17__._MetamorphView;\n\n // requireModule(\"ember-handlebars\");\n // requireModule(\"ember-runtime\");\n // requireModule(\"ember-views\");\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n // // side effect of loading some Ember globals, for now\n // requireModule(\"ember-handlebars\");\n // requireModule(\"ember-runtime\");\n // requireModule(\"ember-views\");\n\n var Router = requireModule(\"router\")['default'];\n var Transition = requireModule(\"router/transition\").Transition;\n\n var slice = [].slice;\n var forEach = EnumerableUtils.forEach;\n\n var DefaultView = _MetamorphView;\n\n /**\n The `Ember.Router` class manages the application state and URLs. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Router\n @namespace Ember\n @extends Ember.Object\n */\n var EmberRouter = EmberObject.extend(Evented, {\n /**\n The `location` property determines the type of URL's that your\n application will use.\n\n The following location types are currently available:\n\n * `hash`\n * `history`\n * `none`\n\n @property location\n @default 'hash'\n @see {Ember.Location}\n */\n location: 'hash',\n\n /**\n Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n init: function() {\n this.router = this.constructor.router || this.constructor.map(Ember.K);\n this._activeViews = {};\n this._setupLocation();\n this._qpCache = {};\n this._queuedQPChanges = {};\n\n if (get(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) {\n this.router.log = Ember.Logger.debug;\n }\n },\n\n /**\n Represents the current URL.\n\n @method url\n @return {String} The current URL.\n */\n url: computed(function() {\n return get(this, 'location').getURL();\n }),\n\n /**\n Initializes the current router instance and sets up the change handling\n event listeners used by the instances `location` implementation.\n\n A property named `initialURL` will be used to determine the initial URL.\n If no value is found `/` will be used.\n\n @method startRouting\n @private\n */\n startRouting: function() {\n this.router = this.router || this.constructor.map(Ember.K);\n\n var router = this.router,\n location = get(this, 'location'),\n container = this.container,\n self = this,\n initialURL = get(this, 'initialURL');\n\n // Allow the Location class to cancel the router setup while it refreshes\n // the page\n if (get(location, 'cancelRouterSetup')) {\n return;\n }\n\n this._setupRouter(router, location);\n\n container.register('view:default', DefaultView);\n container.register('view:toplevel', EmberView.extend());\n\n location.onUpdateURL(function(url) {\n self.handleURL(url);\n });\n\n if (typeof initialURL === \"undefined\") {\n initialURL = location.getURL();\n }\n\n this.handleURL(initialURL);\n },\n\n /**\n Handles updating the paths and notifying any listeners of the URL\n change.\n\n Triggers the router level `didTransition` hook.\n\n @method didTransition\n @private\n @since 1.2.0\n */\n didTransition: function(infos) {\n updatePaths(this);\n\n this._cancelLoadingEvent();\n\n this.notifyPropertyChange('url');\n\n // Put this in the runloop so url will be accurate. Seems\n // less surprising than didTransition being out of sync.\n run.once(this, this.trigger, 'didTransition');\n\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Transitioned into '\" + EmberRouter._routePath(infos) + \"'\");\n }\n },\n\n handleURL: function(url) {\n return this._doTransition('handleURL', [url]);\n },\n\n transitionTo: function() {\n return this._doTransition('transitionTo', arguments);\n },\n\n intermediateTransitionTo: function() {\n this.router.intermediateTransitionTo.apply(this.router, arguments);\n\n updatePaths(this);\n\n var infos = this.router.currentHandlerInfos;\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Intermediate-transitioned into '\" + EmberRouter._routePath(infos) + \"'\");\n }\n },\n\n replaceWith: function() {\n return this._doTransition('replaceWith', arguments);\n },\n\n generate: function() {\n var url = this.router.generate.apply(this.router, arguments);\n return this.location.formatURL(url);\n },\n\n /**\n Determines if the supplied route is currently active.\n\n @method isActive\n @param routeName\n @return {Boolean}\n @private\n */\n isActive: function(routeName) {\n var router = this.router;\n return router.isActive.apply(router, arguments);\n },\n\n send: function(name, context) {\n this.router.trigger.apply(this.router, arguments);\n },\n\n /**\n Does this router instance have the given route.\n\n @method hasRoute\n @return {Boolean}\n @private\n */\n hasRoute: function(route) {\n return this.router.hasRoute(route);\n },\n\n /**\n Resets the state of the router by clearing the current route\n handlers and deactivating them.\n\n @private\n @method reset\n */\n reset: function() {\n this.router.reset();\n },\n\n _lookupActiveView: function(templateName) {\n var active = this._activeViews[templateName];\n return active && active[0];\n },\n\n _connectActiveView: function(templateName, view) {\n var existing = this._activeViews[templateName];\n\n if (existing) {\n existing[0].off('willDestroyElement', this, existing[1]);\n }\n\n function disconnectActiveView() {\n delete this._activeViews[templateName];\n }\n\n this._activeViews[templateName] = [view, disconnectActiveView];\n view.one('willDestroyElement', this, disconnectActiveView);\n },\n\n _setupLocation: function() {\n var location = get(this, 'location'),\n rootURL = get(this, 'rootURL');\n\n if (rootURL && !this.container.has('-location-setting:root-url')) {\n this.container.register('-location-setting:root-url', rootURL, { instantiate: false });\n }\n\n if ('string' === typeof location && this.container) {\n var resolvedLocation = this.container.lookup('location:' + location);\n\n if ('undefined' !== typeof resolvedLocation) {\n location = set(this, 'location', resolvedLocation);\n } else {\n // Allow for deprecated registration of custom location API's\n var options = {implementation: location};\n\n location = set(this, 'location', EmberLocation.create(options));\n }\n }\n\n if (rootURL && typeof rootURL === 'string') {\n location.rootURL = rootURL;\n }\n\n // ensure that initState is called AFTER the rootURL is set on\n // the location instance\n if (typeof location.initState === 'function') { location.initState(); }\n },\n\n _getHandlerFunction: function() {\n var seen = {}, container = this.container,\n DefaultRoute = container.lookupFactory('route:basic'),\n self = this;\n\n return function(name) {\n var routeName = 'route:' + name,\n handler = container.lookup(routeName);\n\n if (seen[name]) { return handler; }\n\n seen[name] = true;\n\n if (!handler) {\n container.register(routeName, DefaultRoute.extend());\n handler = container.lookup(routeName);\n\n if (get(self, 'namespace.LOG_ACTIVE_GENERATION')) {\n Ember.Logger.info(\"generated -> \" + routeName, { fullName: routeName });\n }\n }\n\n handler.routeName = name;\n return handler;\n };\n },\n\n _setupRouter: function(router, location) {\n var lastURL, emberRouter = this;\n\n router.getHandler = this._getHandlerFunction();\n\n var doUpdateURL = function() {\n location.setURL(lastURL);\n };\n\n router.updateURL = function(path) {\n lastURL = path;\n run.once(doUpdateURL);\n };\n\n if (location.replaceURL) {\n var doReplaceURL = function() {\n location.replaceURL(lastURL);\n };\n\n router.replaceURL = function(path) {\n lastURL = path;\n run.once(doReplaceURL);\n };\n }\n\n router.didTransition = function(infos) {\n emberRouter.didTransition(infos);\n };\n },\n\n _doTransition: function(method, args) {\n // Normalize blank route to root URL.\n args = slice.call(args);\n args[0] = args[0] || '/';\n\n var name = args[0], self = this,\n isQueryParamsOnly = false, queryParams;\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n\n var possibleQueryParamArg = args[args.length - 1];\n if (possibleQueryParamArg && possibleQueryParamArg.hasOwnProperty('queryParams')) {\n if (args.length === 1) {\n isQueryParamsOnly = true;\n name = null;\n }\n queryParams = args[args.length - 1].queryParams;\n }\n }\n\n if (!isQueryParamsOnly && name.charAt(0) !== '/') {\n Ember.assert(\"The route \" + name + \" was not found\", this.router.hasRoute(name));\n }\n\n if (queryParams) {\n // router.js expects queryParams to be passed in in\n // their final serialized form, so we need to translate.\n\n if (!name) {\n // Need to determine destination route name.\n var handlerInfos = this.router.activeTransition ?\n this.router.activeTransition.state.handlerInfos :\n this.router.state.handlerInfos;\n name = handlerInfos[handlerInfos.length - 1].name;\n args.unshift(name);\n }\n\n var qpCache = this._queryParamsFor(name), qps = qpCache.qps;\n\n var finalParams = {};\n for (var key in queryParams) {\n if (!queryParams.hasOwnProperty(key)) { continue; }\n var inputValue = queryParams[key],\n qp = qpCache.map[key];\n\n if (!qp) {\n throw new EmberError(\"Unrecognized query param \" + key + \" provided as transition argument\");\n }\n finalParams[qp.urlKey] = qp.route.serializeQueryParam(inputValue, qp.urlKey, qp.type);\n }\n\n // Perform any necessary serialization.\n args[args.length-1].queryParams = finalParams;\n }\n\n var transitionPromise = this.router[method].apply(this.router, args);\n\n transitionPromise.then(null, function(error) {\n if (!error || !error.name) { return; }\n\n if (error.name === \"UnrecognizedURLError\") {\n Ember.assert(\"The URL '\" + error.message + \"' did not match any routes in your application\");\n } else if (error.name === 'TransitionAborted') {\n // just ignore TransitionAborted here\n } else {\n throw error;\n }\n\n return error;\n }, 'Ember: Process errors from Router');\n\n // We want to return the configurable promise object\n // so that callers of this function can use `.method()` on it,\n // which obviously doesn't exist for normal RSVP promises.\n return transitionPromise;\n },\n\n _queryParamsFor: function(leafRouteName) {\n if (this._qpCache[leafRouteName]) {\n return this._qpCache[leafRouteName];\n }\n\n var map = {}, qps = [], qpCache = this._qpCache[leafRouteName] = {\n map: map,\n qps: qps\n };\n\n var routerjs = this.router,\n recogHandlerInfos = routerjs.recognizer.handlersFor(leafRouteName);\n\n for (var i = 0, len = recogHandlerInfos.length; i < len; ++i) {\n var recogHandler = recogHandlerInfos[i],\n route = routerjs.getHandler(recogHandler.handler),\n qpMeta = get(route, '_qp');\n\n if (!qpMeta) { continue; }\n\n merge(map, qpMeta.map);\n qps.push.apply(qps, qpMeta.qps);\n }\n\n return {\n qps: qps,\n map: map\n };\n },\n\n _scheduleLoadingEvent: function(transition, originRoute) {\n this._cancelLoadingEvent();\n this._loadingStateTimer = run.scheduleOnce('routerTransitions', this, '_fireLoadingEvent', transition, originRoute);\n },\n\n _fireLoadingEvent: function(transition, originRoute) {\n if (!this.router.activeTransition) {\n // Don't fire an event if we've since moved on from\n // the transition that put us in a loading state.\n return;\n }\n\n transition.trigger(true, 'loading', transition, originRoute);\n },\n\n _cancelLoadingEvent: function () {\n if (this._loadingStateTimer) {\n run.cancel(this._loadingStateTimer);\n }\n this._loadingStateTimer = null;\n }\n });\n\n function controllerOrProtoFor(controllerName, container, getProto) {\n var fullName = container.normalize('controller:' + controllerName);\n if (!getProto && container.cache.has(fullName)) {\n return container.lookup(fullName);\n } else {\n // Controller hasn't been instantiated yet; just return its proto.\n var controllerClass = container.lookupFactory(fullName);\n if (controllerClass && typeof controllerClass.proto === 'function') {\n return controllerClass.proto();\n } else {\n return {};\n }\n }\n }\n\n /*\n Helper function for iterating root-ward, starting\n from (but not including) the provided `originRoute`.\n\n Returns true if the last callback fired requested\n to bubble upward.\n\n @private\n */\n function forEachRouteAbove(originRoute, transition, callback) {\n var handlerInfos = transition.state.handlerInfos,\n originRouteFound = false;\n\n for (var i = handlerInfos.length - 1; i >= 0; --i) {\n var handlerInfo = handlerInfos[i],\n route = handlerInfo.handler;\n\n if (!originRouteFound) {\n if (originRoute === route) {\n originRouteFound = true;\n }\n continue;\n }\n\n if (callback(route, handlerInfos[i + 1].handler) !== true) {\n return false;\n }\n }\n return true;\n }\n\n // These get invoked when an action bubbles above ApplicationRoute\n // and are not meant to be overridable.\n var defaultActionHandlers = {\n\n willResolveModel: function(transition, originRoute) {\n originRoute.router._scheduleLoadingEvent(transition, originRoute);\n },\n\n error: function(error, transition, originRoute) {\n // Attempt to find an appropriate error substate to enter.\n var router = originRoute.router;\n\n var tryTopLevel = forEachRouteAbove(originRoute, transition, function(route, childRoute) {\n var childErrorRouteName = findChildRouteName(route, childRoute, 'error');\n if (childErrorRouteName) {\n router.intermediateTransitionTo(childErrorRouteName, error);\n return;\n }\n return true;\n });\n\n if (tryTopLevel) {\n // Check for top-level error state to enter.\n if (routeHasBeenDefined(originRoute.router, 'application_error')) {\n router.intermediateTransitionTo('application_error', error);\n return;\n }\n } else {\n // Don't fire an assertion if we found an error substate.\n return;\n }\n\n var errorArgs = ['Error while processing route: ' + transition.targetName];\n\n if (error) {\n if (error.message) { errorArgs.push(error.message); }\n if (error.stack) { errorArgs.push(error.stack); }\n\n if (typeof error === \"string\") { errorArgs.push(error); }\n }\n\n Ember.Logger.error.apply(this, errorArgs);\n },\n\n loading: function(transition, originRoute) {\n // Attempt to find an appropriate loading substate to enter.\n var router = originRoute.router;\n\n var tryTopLevel = forEachRouteAbove(originRoute, transition, function(route, childRoute) {\n var childLoadingRouteName = findChildRouteName(route, childRoute, 'loading');\n\n if (childLoadingRouteName) {\n router.intermediateTransitionTo(childLoadingRouteName);\n return;\n }\n\n // Don't bubble above pivot route.\n if (transition.pivotHandler !== route) {\n return true;\n }\n });\n\n if (tryTopLevel) {\n // Check for top-level loading state to enter.\n if (routeHasBeenDefined(originRoute.router, 'application_loading')) {\n router.intermediateTransitionTo('application_loading');\n return;\n }\n }\n }\n };\n\n function findChildRouteName(parentRoute, originatingChildRoute, name) {\n var router = parentRoute.router,\n childName,\n targetChildRouteName = originatingChildRoute.routeName.split('.').pop(),\n namespace = parentRoute.routeName === 'application' ? '' : parentRoute.routeName + '.';\n\n if (Ember.FEATURES.isEnabled(\"ember-routing-named-substates\")) {\n // First, try a named loading state, e.g. 'foo_loading'\n childName = namespace + targetChildRouteName + '_' + name;\n if (routeHasBeenDefined(router, childName)) {\n return childName;\n }\n }\n\n // Second, try general loading state, e.g. 'loading'\n childName = namespace + name;\n if (routeHasBeenDefined(router, childName)) {\n return childName;\n }\n }\n\n function routeHasBeenDefined(router, name) {\n var container = router.container;\n return router.hasRoute(name) &&\n (container.has('template:' + name) || container.has('route:' + name));\n }\n\n function triggerEvent(handlerInfos, ignoreFailure, args) {\n var name = args.shift();\n\n if (!handlerInfos) {\n if (ignoreFailure) { return; }\n throw new EmberError(\"Can't trigger action '\" + name + \"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.\");\n }\n\n var eventWasHandled = false;\n\n for (var i = handlerInfos.length - 1; i >= 0; i--) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler._actions && handler._actions[name]) {\n if (handler._actions[name].apply(handler, args) === true) {\n eventWasHandled = true;\n } else {\n return;\n }\n }\n }\n\n if (defaultActionHandlers[name]) {\n defaultActionHandlers[name].apply(null, args);\n return;\n }\n\n if (!eventWasHandled && !ignoreFailure) {\n throw new EmberError(\"Nothing handled the action '\" + name + \"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.\");\n }\n }\n\n function updatePaths(router) {\n var appController = router.container.lookup('controller:application');\n\n if (!appController) {\n // appController might not exist when top-level loading/error\n // substates have been entered since ApplicationRoute hasn't\n // actually been entered at that point.\n return;\n }\n\n var infos = router.router.currentHandlerInfos,\n path = EmberRouter._routePath(infos);\n\n if (!('currentPath' in appController)) {\n defineProperty(appController, 'currentPath');\n }\n\n set(appController, 'currentPath', path);\n\n if (!('currentRouteName' in appController)) {\n defineProperty(appController, 'currentRouteName');\n }\n\n set(appController, 'currentRouteName', infos[infos.length - 1].name);\n }\n\n EmberRouter.reopenClass({\n router: null,\n map: function(callback) {\n var router = this.router;\n if (!router) {\n router = new Router();\n router.callbacks = [];\n router.triggerEvent = triggerEvent;\n this.reopenClass({ router: router });\n }\n\n var dsl = EmberRouterDSL.map(function() {\n this.resource('application', { path: \"/\" }, function() {\n for (var i=0; i < router.callbacks.length; i++) {\n router.callbacks[i].call(this);\n }\n callback.call(this);\n });\n });\n\n router.callbacks.push(callback);\n router.map(dsl.generate());\n return router;\n },\n\n _routePath: function(handlerInfos) {\n var path = [];\n\n // We have to handle coalescing resource names that\n // are prefixed with their parent's names, e.g.\n // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz'\n\n function intersectionMatches(a1, a2) {\n for (var i = 0, len = a1.length; i < len; ++i) {\n if (a1[i] !== a2[i]) {\n return false;\n }\n }\n return true;\n }\n\n for (var i=1, l=handlerInfos.length; i<l; i++) {\n var name = handlerInfos[i].name,\n nameParts = name.split(\".\"),\n oldNameParts = slice.call(path);\n\n while (oldNameParts.length) {\n if (intersectionMatches(oldNameParts, nameParts)) {\n break;\n }\n oldNameParts.shift();\n }\n\n path.push.apply(path, nameParts.slice(oldNameParts.length));\n }\n\n return path.join(\".\");\n }\n });\n\n __exports__[\"default\"] = EmberRouter;\n });\ndefine(\"route-recognizer\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var specials = [\n '/', '.', '*', '+', '?', '|',\n '(', ')', '[', ']', '{', '}', '\\\\'\n ];\n\n var escapeRegex = new RegExp('(\\\\' + specials.join('|\\\\') + ')', 'g');\n\n function isArray(test) {\n return Object.prototype.toString.call(test) === \"[object Array]\";\n }\n\n // A Segment represents a segment in the original route description.\n // Each Segment type provides an `eachChar` and `regex` method.\n //\n // The `eachChar` method invokes the callback with one or more character\n // specifications. A character specification consumes one or more input\n // characters.\n //\n // The `regex` method returns a regex fragment for the segment. If the\n // segment is a dynamic of star segment, the regex fragment also includes\n // a capture.\n //\n // A character specification contains:\n //\n // * `validChars`: a String with a list of all valid characters, or\n // * `invalidChars`: a String with a list of all invalid characters\n // * `repeat`: true if the character specification can repeat\n\n function StaticSegment(string) { this.string = string; }\n StaticSegment.prototype = {\n eachChar: function(callback) {\n var string = this.string, ch;\n\n for (var i=0, l=string.length; i<l; i++) {\n ch = string.charAt(i);\n callback({ validChars: ch });\n }\n },\n\n regex: function() {\n return this.string.replace(escapeRegex, '\\\\$1');\n },\n\n generate: function() {\n return this.string;\n }\n };\n\n function DynamicSegment(name) { this.name = name; }\n DynamicSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"/\", repeat: true });\n },\n\n regex: function() {\n return \"([^/]+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function StarSegment(name) { this.name = name; }\n StarSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"\", repeat: true });\n },\n\n regex: function() {\n return \"(.+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function EpsilonSegment() {}\n EpsilonSegment.prototype = {\n eachChar: function() {},\n regex: function() { return \"\"; },\n generate: function() { return \"\"; }\n };\n\n function parse(route, names, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.charAt(0) === \"/\") { route = route.substr(1); }\n\n var segments = route.split(\"/\"), results = [];\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i], match;\n\n if (match = segment.match(/^:([^\\/]+)$/)) {\n results.push(new DynamicSegment(match[1]));\n names.push(match[1]);\n types.dynamics++;\n } else if (match = segment.match(/^\\*([^\\/]+)$/)) {\n results.push(new StarSegment(match[1]));\n names.push(match[1]);\n types.stars++;\n } else if(segment === \"\") {\n results.push(new EpsilonSegment());\n } else {\n results.push(new StaticSegment(segment));\n types.statics++;\n }\n }\n\n return results;\n }\n\n // A State has a character specification and (`charSpec`) and a list of possible\n // subsequent states (`nextStates`).\n //\n // If a State is an accepting state, it will also have several additional\n // properties:\n //\n // * `regex`: A regular expression that is used to extract parameters from paths\n // that reached this accepting state.\n // * `handlers`: Information on how to convert the list of captures into calls\n // to registered handlers with the specified parameters\n // * `types`: How many static, dynamic or star segments in this route. Used to\n // decide which route to use if multiple registered routes match a path.\n //\n // Currently, State is implemented naively by looping over `nextStates` and\n // comparing a character specification against a character. A more efficient\n // implementation would use a hash of keys pointing at one or more next states.\n\n function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }\n\n State.prototype = {\n get: function(charSpec) {\n var nextStates = this.nextStates;\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n var child = nextStates[i];\n\n var isEqual = child.charSpec.validChars === charSpec.validChars;\n isEqual = isEqual && child.charSpec.invalidChars === charSpec.invalidChars;\n\n if (isEqual) { return child; }\n }\n },\n\n put: function(charSpec) {\n var state;\n\n // If the character specification already exists in a child of the current\n // state, just return that state.\n if (state = this.get(charSpec)) { return state; }\n\n // Make a new state for the character spec\n state = new State(charSpec);\n\n // Insert the new state as a child of the current state\n this.nextStates.push(state);\n\n // If this character specification repeats, insert the new state as a child\n // of itself. Note that this will not trigger an infinite loop because each\n // transition during recognition consumes a character.\n if (charSpec.repeat) {\n state.nextStates.push(state);\n }\n\n // Return the new state\n return state;\n },\n\n // Find a list of child states matching the next character\n match: function(ch) {\n // DEBUG \"Processing `\" + ch + \"`:\"\n var nextStates = this.nextStates,\n child, charSpec, chars;\n\n // DEBUG \" \" + debugState(this)\n var returned = [];\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n child = nextStates[i];\n\n charSpec = child.charSpec;\n\n if (typeof (chars = charSpec.validChars) !== 'undefined') {\n if (chars.indexOf(ch) !== -1) { returned.push(child); }\n } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') {\n if (chars.indexOf(ch) === -1) { returned.push(child); }\n }\n }\n\n return returned;\n }\n\n /** IF DEBUG\n , debug: function() {\n var charSpec = this.charSpec,\n debug = \"[\",\n chars = charSpec.validChars || charSpec.invalidChars;\n\n if (charSpec.invalidChars) { debug += \"^\"; }\n debug += chars;\n debug += \"]\";\n\n if (charSpec.repeat) { debug += \"+\"; }\n\n return debug;\n }\n END IF **/\n };\n\n /** IF DEBUG\n function debug(log) {\n console.log(log);\n }\n\n function debugState(state) {\n return state.nextStates.map(function(n) {\n if (n.nextStates.length === 0) { return \"( \" + n.debug() + \" [accepting] )\"; }\n return \"( \" + n.debug() + \" <then> \" + n.nextStates.map(function(s) { return s.debug() }).join(\" or \") + \" )\";\n }).join(\", \")\n }\n END IF **/\n\n // This is a somewhat naive strategy, but should work in a lot of cases\n // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id.\n //\n // This strategy generally prefers more static and less dynamic matching.\n // Specifically, it\n //\n // * prefers fewer stars to more, then\n // * prefers using stars for less of the match to more, then\n // * prefers fewer dynamic segments to more, then\n // * prefers more static segments to more\n function sortSolutions(states) {\n return states.sort(function(a, b) {\n if (a.types.stars !== b.types.stars) { return a.types.stars - b.types.stars; }\n\n if (a.types.stars) {\n if (a.types.statics !== b.types.statics) { return b.types.statics - a.types.statics; }\n if (a.types.dynamics !== b.types.dynamics) { return b.types.dynamics - a.types.dynamics; }\n }\n\n if (a.types.dynamics !== b.types.dynamics) { return a.types.dynamics - b.types.dynamics; }\n if (a.types.statics !== b.types.statics) { return b.types.statics - a.types.statics; }\n\n return 0;\n });\n }\n\n function recognizeChar(states, ch) {\n var nextStates = [];\n\n for (var i=0, l=states.length; i<l; i++) {\n var state = states[i];\n\n nextStates = nextStates.concat(state.match(ch));\n }\n\n return nextStates;\n }\n\n var oCreate = Object.create || function(proto) {\n function F() {}\n F.prototype = proto;\n return new F();\n };\n\n function RecognizeResults(queryParams) {\n this.queryParams = queryParams || {};\n }\n RecognizeResults.prototype = oCreate({\n splice: Array.prototype.splice,\n slice: Array.prototype.slice,\n push: Array.prototype.push,\n length: 0,\n queryParams: null\n });\n\n function findHandler(state, path, queryParams) {\n var handlers = state.handlers, regex = state.regex;\n var captures = path.match(regex), currentCapture = 1;\n var result = new RecognizeResults(queryParams);\n\n for (var i=0, l=handlers.length; i<l; i++) {\n var handler = handlers[i], names = handler.names, params = {};\n\n for (var j=0, m=names.length; j<m; j++) {\n params[names[j]] = captures[currentCapture++];\n }\n\n result.push({ handler: handler.handler, params: params, isDynamic: !!names.length });\n }\n\n return result;\n }\n\n function addSegment(currentState, segment) {\n segment.eachChar(function(ch) {\n var state;\n\n currentState = currentState.put(ch);\n });\n\n return currentState;\n }\n\n // The main interface\n\n var RouteRecognizer = function() {\n this.rootState = new State();\n this.names = {};\n };\n\n\n RouteRecognizer.prototype = {\n add: function(routes, options) {\n var currentState = this.rootState, regex = \"^\",\n types = { statics: 0, dynamics: 0, stars: 0 },\n handlers = [], allSegments = [], name;\n\n var isEmpty = true;\n\n for (var i=0, l=routes.length; i<l; i++) {\n var route = routes[i], names = [];\n\n var segments = parse(route.path, names, types);\n\n allSegments = allSegments.concat(segments);\n\n for (var j=0, m=segments.length; j<m; j++) {\n var segment = segments[j];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n isEmpty = false;\n\n // Add a \"/\" for the new segment\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n\n // Add a representation of the segment to the NFA and regex\n currentState = addSegment(currentState, segment);\n regex += segment.regex();\n }\n\n var handler = { handler: route.handler, names: names };\n handlers.push(handler);\n }\n\n if (isEmpty) {\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n }\n\n currentState.handlers = handlers;\n currentState.regex = new RegExp(regex + \"$\");\n currentState.types = types;\n\n if (name = options && options.as) {\n this.names[name] = {\n segments: allSegments,\n handlers: handlers\n };\n }\n },\n\n handlersFor: function(name) {\n var route = this.names[name], result = [];\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n for (var i=0, l=route.handlers.length; i<l; i++) {\n result.push(route.handlers[i]);\n }\n\n return result;\n },\n\n hasRoute: function(name) {\n return !!this.names[name];\n },\n\n generate: function(name, params) {\n var route = this.names[name], output = \"\";\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n var segments = route.segments;\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n output += \"/\";\n output += segment.generate(params);\n }\n\n if (output.charAt(0) !== '/') { output = '/' + output; }\n\n if (params && params.queryParams) {\n output += this.generateQueryString(params.queryParams, route.handlers);\n }\n\n return output;\n },\n\n generateQueryString: function(params, handlers) {\n var pairs = [];\n var keys = [];\n for(var key in params) {\n if (params.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n keys.sort();\n for (var i = 0, len = keys.length; i < len; i++) {\n key = keys[i];\n var value = params[key];\n if (value == null) {\n continue;\n }\n var pair = key;\n if (isArray(value)) {\n for (var j = 0, l = value.length; j < l; j++) {\n var arrayPair = key + '[]' + '=' + encodeURIComponent(value[j]);\n pairs.push(arrayPair);\n }\n } else {\n pair += \"=\" + encodeURIComponent(value);\n pairs.push(pair);\n }\n }\n\n if (pairs.length === 0) { return ''; }\n\n return \"?\" + pairs.join(\"&\");\n },\n\n parseQueryString: function(queryString) {\n var pairs = queryString.split(\"&\"), queryParams = {};\n for(var i=0; i < pairs.length; i++) {\n var pair = pairs[i].split('='),\n key = decodeURIComponent(pair[0]),\n keyLength = key.length,\n isArray = false,\n value;\n if (pair.length === 1) {\n value = 'true';\n } else {\n //Handle arrays\n if (keyLength > 2 && key.slice(keyLength -2) === '[]') {\n isArray = true;\n key = key.slice(0, keyLength - 2);\n if(!queryParams[key]) {\n queryParams[key] = [];\n }\n }\n value = pair[1] ? decodeURIComponent(pair[1]) : '';\n }\n if (isArray) {\n queryParams[key].push(value);\n } else {\n queryParams[key] = decodeURIComponent(value);\n }\n }\n return queryParams;\n },\n\n recognize: function(path) {\n var states = [ this.rootState ],\n pathLen, i, l, queryStart, queryParams = {},\n isSlashDropped = false;\n\n path = decodeURI(path);\n\n queryStart = path.indexOf('?');\n if (queryStart !== -1) {\n var queryString = path.substr(queryStart + 1, path.length);\n path = path.substr(0, queryStart);\n queryParams = this.parseQueryString(queryString);\n }\n\n // DEBUG GROUP path\n\n if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\n pathLen = path.length;\n if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n path = path.substr(0, pathLen - 1);\n isSlashDropped = true;\n }\n\n for (i=0, l=path.length; i<l; i++) {\n states = recognizeChar(states, path.charAt(i));\n if (!states.length) { break; }\n }\n\n // END DEBUG GROUP\n\n var solutions = [];\n for (i=0, l=states.length; i<l; i++) {\n if (states[i].handlers) { solutions.push(states[i]); }\n }\n\n states = sortSolutions(solutions);\n\n var state = solutions[0];\n\n if (state && state.handlers) {\n // if a trailing slash was dropped and a star segment is the last segment\n // specified, put the trailing slash back\n if (isSlashDropped && state.regex.source.slice(-5) === \"(.+)$\") {\n path = path + \"/\";\n }\n return findHandler(state, path, queryParams);\n }\n }\n };\n\n __exports__[\"default\"] = RouteRecognizer;\n\n function Target(path, matcher, delegate) {\n this.path = path;\n this.matcher = matcher;\n this.delegate = delegate;\n }\n\n Target.prototype = {\n to: function(target, callback) {\n var delegate = this.delegate;\n\n if (delegate && delegate.willAddRoute) {\n target = delegate.willAddRoute(this.matcher.target, target);\n }\n\n this.matcher.add(this.path, target);\n\n if (callback) {\n if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n this.matcher.addChild(this.path, target, callback, this.delegate);\n }\n return this;\n }\n };\n\n function Matcher(target) {\n this.routes = {};\n this.children = {};\n this.target = target;\n }\n\n Matcher.prototype = {\n add: function(path, handler) {\n this.routes[path] = handler;\n },\n\n addChild: function(path, target, callback, delegate) {\n var matcher = new Matcher(target);\n this.children[path] = matcher;\n\n var match = generateMatch(path, matcher, delegate);\n\n if (delegate && delegate.contextEntered) {\n delegate.contextEntered(target, match);\n }\n\n callback(match);\n }\n };\n\n function generateMatch(startingPath, matcher, delegate) {\n return function(path, nestedCallback) {\n var fullPath = startingPath + path;\n\n if (nestedCallback) {\n nestedCallback(generateMatch(fullPath, matcher, delegate));\n } else {\n return new Target(startingPath + path, matcher, delegate);\n }\n };\n }\n\n function addRoute(routeArray, path, handler) {\n var len = 0;\n for (var i=0, l=routeArray.length; i<l; i++) {\n len += routeArray[i].path.length;\n }\n\n path = path.substr(len);\n var route = { path: path, handler: handler };\n routeArray.push(route);\n }\n\n function eachRoute(baseRoute, matcher, callback, binding) {\n var routes = matcher.routes;\n\n for (var path in routes) {\n if (routes.hasOwnProperty(path)) {\n var routeArray = baseRoute.slice();\n addRoute(routeArray, path, routes[path]);\n\n if (matcher.children[path]) {\n eachRoute(routeArray, matcher.children[path], callback, binding);\n } else {\n callback.call(binding, routeArray);\n }\n }\n }\n }\n\n RouteRecognizer.prototype.map = function(callback, addRouteCallback) {\n var matcher = new Matcher();\n\n callback(generateMatch(\"\", matcher, this.delegate));\n\n eachRoute([], matcher, function(route) {\n if (addRouteCallback) { addRouteCallback(this, route); }\n else { this.add(route); }\n }, this);\n };\n });\n\ndefine(\"router/handler-info\", \n [\"./utils\",\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var bind = __dependency1__.bind;\n var merge = __dependency1__.merge;\n var serialize = __dependency1__.serialize;\n var promiseLabel = __dependency1__.promiseLabel;\n var Promise = __dependency2__[\"default\"];\n\n function HandlerInfo(_props) {\n var props = _props || {};\n merge(this, props);\n this.initialize(props);\n }\n\n HandlerInfo.prototype = {\n name: null,\n handler: null,\n params: null,\n context: null,\n\n // Injected by the handler info factory.\n factory: null,\n\n initialize: function() {},\n\n log: function(payload, message) {\n if (payload.log) {\n payload.log(this.name + ': ' + message);\n }\n },\n\n promiseLabel: function(label) {\n return promiseLabel(\"'\" + this.name + \"' \" + label);\n },\n\n getUnresolved: function() {\n return this;\n },\n\n serialize: function() {\n return this.params || {};\n },\n\n resolve: function(shouldContinue, payload) {\n var checkForAbort = bind(this, this.checkForAbort, shouldContinue),\n beforeModel = bind(this, this.runBeforeModelHook, payload),\n model = bind(this, this.getModel, payload),\n afterModel = bind(this, this.runAfterModelHook, payload),\n becomeResolved = bind(this, this.becomeResolved, payload);\n\n return Promise.resolve(undefined, this.promiseLabel(\"Start handler\"))\n .then(checkForAbort, null, this.promiseLabel(\"Check for abort\"))\n .then(beforeModel, null, this.promiseLabel(\"Before model\"))\n .then(checkForAbort, null, this.promiseLabel(\"Check if aborted during 'beforeModel' hook\"))\n .then(model, null, this.promiseLabel(\"Model\"))\n .then(checkForAbort, null, this.promiseLabel(\"Check if aborted in 'model' hook\"))\n .then(afterModel, null, this.promiseLabel(\"After model\"))\n .then(checkForAbort, null, this.promiseLabel(\"Check if aborted in 'afterModel' hook\"))\n .then(becomeResolved, null, this.promiseLabel(\"Become resolved\"));\n },\n\n runBeforeModelHook: function(payload) {\n if (payload.trigger) {\n payload.trigger(true, 'willResolveModel', payload, this.handler);\n }\n return this.runSharedModelHook(payload, 'beforeModel', []);\n },\n\n runAfterModelHook: function(payload, resolvedModel) {\n // Stash the resolved model on the payload.\n // This makes it possible for users to swap out\n // the resolved model in afterModel.\n var name = this.name;\n this.stashResolvedModel(payload, resolvedModel);\n\n return this.runSharedModelHook(payload, 'afterModel', [resolvedModel])\n .then(function() {\n // Ignore the fulfilled value returned from afterModel.\n // Return the value stashed in resolvedModels, which\n // might have been swapped out in afterModel.\n return payload.resolvedModels[name];\n }, null, this.promiseLabel(\"Ignore fulfillment value and return model value\"));\n },\n\n runSharedModelHook: function(payload, hookName, args) {\n this.log(payload, \"calling \" + hookName + \" hook\");\n\n if (this.queryParams) {\n args.push(this.queryParams);\n }\n args.push(payload);\n\n var handler = this.handler;\n var result = handler[hookName] && handler[hookName].apply(handler, args);\n\n if (result && result.isTransition) {\n result = null;\n }\n\n return Promise.resolve(result, null, this.promiseLabel(\"Resolve value returned from one of the model hooks\"));\n },\n\n // overridden by subclasses\n getModel: null,\n\n checkForAbort: function(shouldContinue, promiseValue) {\n return Promise.resolve(shouldContinue(), this.promiseLabel(\"Check for abort\")).then(function() {\n // We don't care about shouldContinue's resolve value;\n // pass along the original value passed to this fn.\n return promiseValue;\n }, null, this.promiseLabel(\"Ignore fulfillment value and continue\"));\n },\n\n stashResolvedModel: function(payload, resolvedModel) {\n payload.resolvedModels = payload.resolvedModels || {};\n payload.resolvedModels[this.name] = resolvedModel;\n },\n\n becomeResolved: function(payload, resolvedContext) {\n var params = this.serialize(resolvedContext);\n\n if (payload) {\n this.stashResolvedModel(payload, resolvedContext);\n payload.params = payload.params || {};\n payload.params[this.name] = params;\n }\n\n return this.factory('resolved', {\n context: resolvedContext,\n name: this.name,\n handler: this.handler,\n params: params\n });\n },\n\n shouldSupercede: function(other) {\n // Prefer this newer handlerInfo over `other` if:\n // 1) The other one doesn't exist\n // 2) The names don't match\n // 3) This handler has a context that doesn't match\n // the other one (or the other one doesn't have one).\n // 4) This handler has parameters that don't match the other.\n if (!other) { return true; }\n\n var contextsMatch = (other.context === this.context);\n return other.name !== this.name ||\n (this.hasOwnProperty('context') && !contextsMatch) ||\n (this.hasOwnProperty('params') && !paramsMatch(this.params, other.params));\n }\n };\n\n function paramsMatch(a, b) {\n if ((!a) ^ (!b)) {\n // Only one is null.\n return false;\n }\n\n if (!a) {\n // Both must be null.\n return true;\n }\n\n // Note: this assumes that both params have the same\n // number of keys, but since we're comparing the\n // same handlers, they should.\n for (var k in a) {\n if (a.hasOwnProperty(k) && a[k] !== b[k]) {\n return false;\n }\n }\n return true;\n }\n\n __exports__[\"default\"] = HandlerInfo;\n });\ndefine(\"router/handler-info/factory\", \n [\"router/handler-info/resolved-handler-info\",\"router/handler-info/unresolved-handler-info-by-object\",\"router/handler-info/unresolved-handler-info-by-param\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var ResolvedHandlerInfo = __dependency1__[\"default\"];\n var UnresolvedHandlerInfoByObject = __dependency2__[\"default\"];\n var UnresolvedHandlerInfoByParam = __dependency3__[\"default\"];\n\n handlerInfoFactory.klasses = {\n resolved: ResolvedHandlerInfo,\n param: UnresolvedHandlerInfoByParam,\n object: UnresolvedHandlerInfoByObject\n };\n\n function handlerInfoFactory(name, props) {\n var Ctor = handlerInfoFactory.klasses[name],\n handlerInfo = new Ctor(props || {});\n handlerInfo.factory = handlerInfoFactory;\n return handlerInfo;\n }\n\n __exports__[\"default\"] = handlerInfoFactory;\n });\ndefine(\"router/handler-info/resolved-handler-info\", \n [\"../handler-info\",\"router/utils\",\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var HandlerInfo = __dependency1__[\"default\"];\n var subclass = __dependency2__.subclass;\n var promiseLabel = __dependency2__.promiseLabel;\n var Promise = __dependency3__[\"default\"];\n\n var ResolvedHandlerInfo = subclass(HandlerInfo, {\n resolve: function(shouldContinue, payload) {\n // A ResolvedHandlerInfo just resolved with itself.\n if (payload && payload.resolvedModels) {\n payload.resolvedModels[this.name] = this.context;\n }\n return Promise.resolve(this, this.promiseLabel(\"Resolve\"));\n },\n\n getUnresolved: function() {\n return this.factory('param', {\n name: this.name,\n handler: this.handler,\n params: this.params\n });\n },\n\n isResolved: true\n });\n\n __exports__[\"default\"] = ResolvedHandlerInfo;\n });\ndefine(\"router/handler-info/unresolved-handler-info-by-object\", \n [\"../handler-info\",\"router/utils\",\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var HandlerInfo = __dependency1__[\"default\"];\n var merge = __dependency2__.merge;\n var subclass = __dependency2__.subclass;\n var promiseLabel = __dependency2__.promiseLabel;\n var isParam = __dependency2__.isParam;\n var Promise = __dependency3__[\"default\"];\n\n var UnresolvedHandlerInfoByObject = subclass(HandlerInfo, {\n getModel: function(payload) {\n this.log(payload, this.name + \": resolving provided model\");\n return Promise.resolve(this.context);\n },\n\n initialize: function(props) {\n this.names = props.names || [];\n this.context = props.context;\n },\n\n /**\n @private\n\n Serializes a handler using its custom `serialize` method or\n by a default that looks up the expected property name from\n the dynamic segment.\n\n @param {Object} model the model to be serialized for this handler\n */\n serialize: function(_model) {\n var model = _model || this.context,\n names = this.names,\n handler = this.handler;\n\n var object = {};\n if (isParam(model)) {\n object[names[0]] = model;\n return object;\n }\n\n // Use custom serialize if it exists.\n if (handler.serialize) {\n return handler.serialize(model, names);\n }\n\n if (names.length !== 1) { return; }\n\n var name = names[0];\n\n if (/_id$/.test(name)) {\n object[name] = model.id;\n } else {\n object[name] = model;\n }\n return object;\n }\n });\n\n __exports__[\"default\"] = UnresolvedHandlerInfoByObject;\n });\ndefine(\"router/handler-info/unresolved-handler-info-by-param\", \n [\"../handler-info\",\"router/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var HandlerInfo = __dependency1__[\"default\"];\n var merge = __dependency2__.merge;\n var subclass = __dependency2__.subclass;\n var promiseLabel = __dependency2__.promiseLabel;\n\n // Generated by URL transitions and non-dynamic route segments in named Transitions.\n var UnresolvedHandlerInfoByParam = subclass (HandlerInfo, {\n initialize: function(props) {\n this.params = props.params || {};\n },\n\n getModel: function(payload) {\n var fullParams = this.params;\n if (payload && payload.queryParams) {\n fullParams = {};\n merge(fullParams, this.params);\n fullParams.queryParams = payload.queryParams;\n }\n\n var hookName = typeof this.handler.deserialize === 'function' ?\n 'deserialize' : 'model';\n\n return this.runSharedModelHook(payload, hookName, [fullParams]);\n }\n });\n\n __exports__[\"default\"] = UnresolvedHandlerInfoByParam;\n });\ndefine(\"router/router\", \n [\"route-recognizer\",\"rsvp/promise\",\"./utils\",\"./transition-state\",\"./transition\",\"./transition-intent/named-transition-intent\",\"./transition-intent/url-transition-intent\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var RouteRecognizer = __dependency1__[\"default\"];\n var Promise = __dependency2__[\"default\"];\n var trigger = __dependency3__.trigger;\n var log = __dependency3__.log;\n var slice = __dependency3__.slice;\n var forEach = __dependency3__.forEach;\n var merge = __dependency3__.merge;\n var serialize = __dependency3__.serialize;\n var extractQueryParams = __dependency3__.extractQueryParams;\n var getChangelist = __dependency3__.getChangelist;\n var promiseLabel = __dependency3__.promiseLabel;\n var TransitionState = __dependency4__[\"default\"];\n var logAbort = __dependency5__.logAbort;\n var Transition = __dependency5__.Transition;\n var TransitionAborted = __dependency5__.TransitionAborted;\n var NamedTransitionIntent = __dependency6__[\"default\"];\n var URLTransitionIntent = __dependency7__[\"default\"];\n\n var pop = Array.prototype.pop;\n\n function Router() {\n this.recognizer = new RouteRecognizer();\n this.reset();\n }\n\n Router.prototype = {\n\n /**\n The main entry point into the router. The API is essentially\n the same as the `map` method in `route-recognizer`.\n\n This method extracts the String handler at the last `.to()`\n call and uses it as the name of the whole route.\n\n @param {Function} callback\n */\n map: function(callback) {\n this.recognizer.delegate = this.delegate;\n\n this.recognizer.map(callback, function(recognizer, routes) {\n for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) {\n var route = routes[i];\n recognizer.add(routes, { as: route.handler });\n proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index';\n }\n });\n },\n\n hasRoute: function(route) {\n return this.recognizer.hasRoute(route);\n },\n\n // NOTE: this doesn't really belong here, but here\n // it shall remain until our ES6 transpiler can\n // handle cyclical deps.\n transitionByIntent: function(intent, isIntermediate) {\n\n var wasTransitioning = !!this.activeTransition;\n var oldState = wasTransitioning ? this.activeTransition.state : this.state;\n var newTransition;\n var router = this;\n\n try {\n var newState = intent.applyToState(oldState, this.recognizer, this.getHandler, isIntermediate);\n\n if (handlerInfosEqual(newState.handlerInfos, oldState.handlerInfos)) {\n\n // This is a no-op transition. See if query params changed.\n var queryParamChangelist = getChangelist(oldState.queryParams, newState.queryParams);\n if (queryParamChangelist) {\n\n // This is a little hacky but we need some way of storing\n // changed query params given that no activeTransition\n // is guaranteed to have occurred.\n this._changedQueryParams = queryParamChangelist.changed;\n for (var k in queryParamChangelist.removed) {\n if (queryParamChangelist.removed.hasOwnProperty(k)) {\n this._changedQueryParams[k] = null;\n }\n }\n trigger(this, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]);\n this._changedQueryParams = null;\n\n if (!wasTransitioning && this.activeTransition) {\n // One of the handlers in queryParamsDidChange\n // caused a transition. Just return that transition.\n return this.activeTransition;\n } else {\n // Running queryParamsDidChange didn't change anything.\n // Just update query params and be on our way.\n\n // We have to return a noop transition that will\n // perform a URL update at the end. This gives\n // the user the ability to set the url update\n // method (default is replaceState).\n newTransition = new Transition(this);\n\n oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition);\n\n newTransition.promise = newTransition.promise.then(function(result) {\n updateURL(newTransition, oldState, true);\n if (router.didTransition) {\n router.didTransition(router.currentHandlerInfos);\n }\n return result;\n }, null, promiseLabel(\"Transition complete\"));\n return newTransition;\n }\n }\n\n // No-op. No need to create a new transition.\n return new Transition(this);\n }\n\n if (isIntermediate) {\n setupContexts(this, newState);\n return;\n }\n\n // Create a new transition to the destination route.\n newTransition = new Transition(this, intent, newState);\n\n // Abort and usurp any previously active transition.\n if (this.activeTransition) {\n this.activeTransition.abort();\n }\n this.activeTransition = newTransition;\n\n // Transition promises by default resolve with resolved state.\n // For our purposes, swap out the promise to resolve\n // after the transition has been finalized.\n newTransition.promise = newTransition.promise.then(function(result) {\n return finalizeTransition(newTransition, result.state);\n }, null, promiseLabel(\"Settle transition promise when transition is finalized\"));\n\n if (!wasTransitioning) {\n trigger(this, this.state.handlerInfos, true, ['willTransition', newTransition]);\n }\n\n return newTransition;\n } catch(e) {\n return new Transition(this, intent, null, e);\n }\n },\n\n /**\n Clears the current and target route handlers and triggers exit\n on each of them starting at the leaf and traversing up through\n its ancestors.\n */\n reset: function() {\n if (this.state) {\n forEach(this.state.handlerInfos, function(handlerInfo) {\n var handler = handlerInfo.handler;\n if (handler.exit) {\n handler.exit();\n }\n });\n }\n\n this.state = new TransitionState();\n this.currentHandlerInfos = null;\n },\n\n activeTransition: null,\n\n /**\n var handler = handlerInfo.handler;\n The entry point for handling a change to the URL (usually\n via the back and forward button).\n\n Returns an Array of handlers and the parameters associated\n with those parameters.\n\n @param {String} url a URL to process\n\n @return {Array} an Array of `[handler, parameter]` tuples\n */\n handleURL: function(url) {\n // Perform a URL-based transition, but don't change\n // the URL afterward, since it already happened.\n var args = slice.call(arguments);\n if (url.charAt(0) !== '/') { args[0] = '/' + url; }\n\n return doTransition(this, args).method(null);\n },\n\n /**\n Hook point for updating the URL.\n\n @param {String} url a URL to update to\n */\n updateURL: function() {\n throw new Error(\"updateURL is not implemented\");\n },\n\n /**\n Hook point for replacing the current URL, i.e. with replaceState\n\n By default this behaves the same as `updateURL`\n\n @param {String} url a URL to update to\n */\n replaceURL: function(url) {\n this.updateURL(url);\n },\n\n /**\n Transition into the specified named route.\n\n If necessary, trigger the exit callback on any handlers\n that are no longer represented by the target route.\n\n @param {String} name the name of the route\n */\n transitionTo: function(name) {\n return doTransition(this, arguments);\n },\n\n intermediateTransitionTo: function(name) {\n doTransition(this, arguments, true);\n },\n\n refresh: function(pivotHandler) {\n\n\n var state = this.activeTransition ? this.activeTransition.state : this.state;\n var handlerInfos = state.handlerInfos;\n var params = {};\n for (var i = 0, len = handlerInfos.length; i < len; ++i) {\n var handlerInfo = handlerInfos[i];\n params[handlerInfo.name] = handlerInfo.params || {};\n }\n\n log(this, \"Starting a refresh transition\");\n var intent = new NamedTransitionIntent({\n name: handlerInfos[handlerInfos.length - 1].name,\n pivotHandler: pivotHandler || handlerInfos[0].handler,\n contexts: [], // TODO collect contexts...?\n queryParams: this._changedQueryParams || state.queryParams || {}\n });\n\n return this.transitionByIntent(intent, false);\n },\n\n /**\n Identical to `transitionTo` except that the current URL will be replaced\n if possible.\n\n This method is intended primarily for use with `replaceState`.\n\n @param {String} name the name of the route\n */\n replaceWith: function(name) {\n return doTransition(this, arguments).method('replace');\n },\n\n /**\n Take a named route and context objects and generate a\n URL.\n\n @param {String} name the name of the route to generate\n a URL for\n @param {...Object} objects a list of objects to serialize\n\n @return {String} a URL\n */\n generate: function(handlerName) {\n\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1)),\n suppliedParams = partitionedArgs[0],\n queryParams = partitionedArgs[1];\n\n // Construct a TransitionIntent with the provided params\n // and apply it to the present state of the router.\n var intent = new NamedTransitionIntent({ name: handlerName, contexts: suppliedParams });\n var state = intent.applyToState(this.state, this.recognizer, this.getHandler);\n var params = {};\n\n for (var i = 0, len = state.handlerInfos.length; i < len; ++i) {\n var handlerInfo = state.handlerInfos[i];\n var handlerParams = handlerInfo.serialize();\n merge(params, handlerParams);\n }\n params.queryParams = queryParams;\n\n return this.recognizer.generate(handlerName, params);\n },\n\n isActive: function(handlerName) {\n\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1)),\n contexts = partitionedArgs[0],\n queryParams = partitionedArgs[1],\n activeQueryParams = this.state.queryParams;\n\n var targetHandlerInfos = this.state.handlerInfos,\n found = false, names, object, handlerInfo, handlerObj, i, len;\n\n if (!targetHandlerInfos.length) { return false; }\n\n var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name;\n var recogHandlers = this.recognizer.handlersFor(targetHandler);\n\n var index = 0;\n for (len = recogHandlers.length; index < len; ++index) {\n handlerInfo = targetHandlerInfos[index];\n if (handlerInfo.name === handlerName) { break; }\n }\n\n if (index === recogHandlers.length) {\n // The provided route name isn't even in the route hierarchy.\n return false;\n }\n\n var state = new TransitionState();\n state.handlerInfos = targetHandlerInfos.slice(0, index + 1);\n recogHandlers = recogHandlers.slice(0, index + 1);\n\n var intent = new NamedTransitionIntent({\n name: targetHandler,\n contexts: contexts\n });\n\n var newState = intent.applyToHandlers(state, recogHandlers, this.getHandler, targetHandler, true, true);\n\n // Get a hash of QPs that will still be active on new route\n var activeQPsOnNewHandler = {};\n merge(activeQPsOnNewHandler, queryParams);\n for (var key in activeQueryParams) {\n if (activeQueryParams.hasOwnProperty(key) &&\n activeQPsOnNewHandler.hasOwnProperty(key)) {\n activeQPsOnNewHandler[key] = activeQueryParams[key];\n }\n }\n\n return handlerInfosEqual(newState.handlerInfos, state.handlerInfos) &&\n !getChangelist(activeQPsOnNewHandler, queryParams);\n },\n\n trigger: function(name) {\n var args = slice.call(arguments);\n trigger(this, this.currentHandlerInfos, false, args);\n },\n\n /**\n Hook point for logging transition status updates.\n\n @param {String} message The message to log.\n */\n log: null\n };\n\n /**\n @private\n\n Takes an Array of `HandlerInfo`s, figures out which ones are\n exiting, entering, or changing contexts, and calls the\n proper handler hooks.\n\n For example, consider the following tree of handlers. Each handler is\n followed by the URL segment it handles.\n\n ```\n |~index (\"/\")\n | |~posts (\"/posts\")\n | | |-showPost (\"/:id\")\n | | |-newPost (\"/new\")\n | | |-editPost (\"/edit\")\n | |~about (\"/about/:id\")\n ```\n\n Consider the following transitions:\n\n 1. A URL transition to `/posts/1`.\n 1. Triggers the `*model` callbacks on the\n `index`, `posts`, and `showPost` handlers\n 2. Triggers the `enter` callback on the same\n 3. Triggers the `setup` callback on the same\n 2. A direct transition to `newPost`\n 1. Triggers the `exit` callback on `showPost`\n 2. Triggers the `enter` callback on `newPost`\n 3. Triggers the `setup` callback on `newPost`\n 3. A direct transition to `about` with a specified\n context object\n 1. Triggers the `exit` callback on `newPost`\n and `posts`\n 2. Triggers the `serialize` callback on `about`\n 3. Triggers the `enter` callback on `about`\n 4. Triggers the `setup` callback on `about`\n\n @param {Router} transition\n @param {TransitionState} newState\n */\n function setupContexts(router, newState, transition) {\n var partition = partitionHandlers(router.state, newState);\n\n forEach(partition.exited, function(handlerInfo) {\n var handler = handlerInfo.handler;\n delete handler.context;\n if (handler.exit) { handler.exit(); }\n });\n\n var oldState = router.oldState = router.state;\n router.state = newState;\n var currentHandlerInfos = router.currentHandlerInfos = partition.unchanged.slice();\n\n try {\n forEach(partition.updatedContext, function(handlerInfo) {\n return handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, false, transition);\n });\n\n forEach(partition.entered, function(handlerInfo) {\n return handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, true, transition);\n });\n } catch(e) {\n router.state = oldState;\n router.currentHandlerInfos = oldState.handlerInfos;\n throw e;\n }\n\n router.state.queryParams = finalizeQueryParamChange(router, currentHandlerInfos, newState.queryParams, transition);\n }\n\n\n /**\n @private\n\n Helper method used by setupContexts. Handles errors or redirects\n that may happen in enter/setup.\n */\n function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transition) {\n\n var handler = handlerInfo.handler,\n context = handlerInfo.context;\n\n if (enter && handler.enter) { handler.enter(transition); }\n if (transition && transition.isAborted) {\n throw new TransitionAborted();\n }\n\n handler.context = context;\n if (handler.contextDidChange) { handler.contextDidChange(); }\n\n if (handler.setup) { handler.setup(context, transition); }\n if (transition && transition.isAborted) {\n throw new TransitionAborted();\n }\n\n currentHandlerInfos.push(handlerInfo);\n\n return true;\n }\n\n\n /**\n @private\n\n This function is called when transitioning from one URL to\n another to determine which handlers are no longer active,\n which handlers are newly active, and which handlers remain\n active but have their context changed.\n\n Take a list of old handlers and new handlers and partition\n them into four buckets:\n\n * unchanged: the handler was active in both the old and\n new URL, and its context remains the same\n * updated context: the handler was active in both the\n old and new URL, but its context changed. The handler's\n `setup` method, if any, will be called with the new\n context.\n * exited: the handler was active in the old URL, but is\n no longer active.\n * entered: the handler was not active in the old URL, but\n is now active.\n\n The PartitionedHandlers structure has four fields:\n\n * `updatedContext`: a list of `HandlerInfo` objects that\n represent handlers that remain active but have a changed\n context\n * `entered`: a list of `HandlerInfo` objects that represent\n handlers that are newly active\n * `exited`: a list of `HandlerInfo` objects that are no\n longer active.\n * `unchanged`: a list of `HanderInfo` objects that remain active.\n\n @param {Array[HandlerInfo]} oldHandlers a list of the handler\n information for the previous URL (or `[]` if this is the\n first handled transition)\n @param {Array[HandlerInfo]} newHandlers a list of the handler\n information for the new URL\n\n @return {Partition}\n */\n function partitionHandlers(oldState, newState) {\n var oldHandlers = oldState.handlerInfos;\n var newHandlers = newState.handlerInfos;\n\n var handlers = {\n updatedContext: [],\n exited: [],\n entered: [],\n unchanged: []\n };\n\n var handlerChanged, contextChanged, queryParamsChanged, i, l;\n\n for (i=0, l=newHandlers.length; i<l; i++) {\n var oldHandler = oldHandlers[i], newHandler = newHandlers[i];\n\n if (!oldHandler || oldHandler.handler !== newHandler.handler) {\n handlerChanged = true;\n }\n\n if (handlerChanged) {\n handlers.entered.push(newHandler);\n if (oldHandler) { handlers.exited.unshift(oldHandler); }\n } else if (contextChanged || oldHandler.context !== newHandler.context || queryParamsChanged) {\n contextChanged = true;\n handlers.updatedContext.push(newHandler);\n } else {\n handlers.unchanged.push(oldHandler);\n }\n }\n\n for (i=newHandlers.length, l=oldHandlers.length; i<l; i++) {\n handlers.exited.unshift(oldHandlers[i]);\n }\n\n return handlers;\n }\n\n function updateURL(transition, state, inputUrl) {\n var urlMethod = transition.urlMethod;\n\n if (!urlMethod) {\n return;\n }\n\n var router = transition.router,\n handlerInfos = state.handlerInfos,\n handlerName = handlerInfos[handlerInfos.length - 1].name,\n params = {};\n\n for (var i = handlerInfos.length - 1; i >= 0; --i) {\n var handlerInfo = handlerInfos[i];\n merge(params, handlerInfo.params);\n if (handlerInfo.handler.inaccessibleByURL) {\n urlMethod = null;\n }\n }\n\n if (urlMethod) {\n params.queryParams = transition._visibleQueryParams || state.queryParams;\n var url = router.recognizer.generate(handlerName, params);\n\n if (urlMethod === 'replace') {\n router.replaceURL(url);\n } else {\n router.updateURL(url);\n }\n }\n }\n\n /**\n @private\n\n Updates the URL (if necessary) and calls `setupContexts`\n to update the router's array of `currentHandlerInfos`.\n */\n function finalizeTransition(transition, newState) {\n\n try {\n log(transition.router, transition.sequence, \"Resolved all models on destination route; finalizing transition.\");\n\n var router = transition.router,\n handlerInfos = newState.handlerInfos,\n seq = transition.sequence;\n\n // Run all the necessary enter/setup/exit hooks\n setupContexts(router, newState, transition);\n\n // Check if a redirect occurred in enter/setup\n if (transition.isAborted) {\n // TODO: cleaner way? distinguish b/w targetHandlerInfos?\n router.state.handlerInfos = router.currentHandlerInfos;\n return Promise.reject(logAbort(transition));\n }\n\n updateURL(transition, newState, transition.intent.url);\n\n transition.isActive = false;\n router.activeTransition = null;\n\n trigger(router, router.currentHandlerInfos, true, ['didTransition']);\n\n if (router.didTransition) {\n router.didTransition(router.currentHandlerInfos);\n }\n\n log(router, transition.sequence, \"TRANSITION COMPLETE.\");\n\n // Resolve with the final handler.\n return handlerInfos[handlerInfos.length - 1].handler;\n } catch(e) {\n if (!(e instanceof TransitionAborted)) {\n //var erroneousHandler = handlerInfos.pop();\n var infos = transition.state.handlerInfos;\n transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler);\n transition.abort();\n }\n\n throw e;\n }\n }\n\n /**\n @private\n\n Begins and returns a Transition based on the provided\n arguments. Accepts arguments in the form of both URL\n transitions and named transitions.\n\n @param {Router} router\n @param {Array[Object]} args arguments passed to transitionTo,\n replaceWith, or handleURL\n */\n function doTransition(router, args, isIntermediate) {\n // Normalize blank transitions to root URL transitions.\n var name = args[0] || '/';\n\n var lastArg = args[args.length-1];\n var queryParams = {};\n if (lastArg && lastArg.hasOwnProperty('queryParams')) {\n queryParams = pop.call(args).queryParams;\n }\n\n var intent;\n if (args.length === 0) {\n\n log(router, \"Updating query params\");\n\n // A query param update is really just a transition\n // into the route you're already on.\n var handlerInfos = router.state.handlerInfos;\n intent = new NamedTransitionIntent({\n name: handlerInfos[handlerInfos.length - 1].name,\n contexts: [],\n queryParams: queryParams\n });\n\n } else if (name.charAt(0) === '/') {\n\n log(router, \"Attempting URL transition to \" + name);\n intent = new URLTransitionIntent({ url: name });\n\n } else {\n\n log(router, \"Attempting transition to \" + name);\n intent = new NamedTransitionIntent({\n name: args[0],\n contexts: slice.call(args, 1),\n queryParams: queryParams\n });\n }\n\n return router.transitionByIntent(intent, isIntermediate);\n }\n\n function handlerInfosEqual(handlerInfos, otherHandlerInfos) {\n if (handlerInfos.length !== otherHandlerInfos.length) {\n return false;\n }\n\n for (var i = 0, len = handlerInfos.length; i < len; ++i) {\n if (handlerInfos[i] !== otherHandlerInfos[i]) {\n return false;\n }\n }\n return true;\n }\n\n function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) {\n // We fire a finalizeQueryParamChange event which\n // gives the new route hierarchy a chance to tell\n // us which query params it's consuming and what\n // their final values are. If a query param is\n // no longer consumed in the final route hierarchy,\n // its serialized segment will be removed\n // from the URL.\n\n for (var k in newQueryParams) {\n if (newQueryParams.hasOwnProperty(k) &&\n newQueryParams[k] === null) {\n delete newQueryParams[k];\n }\n }\n\n var finalQueryParamsArray = [];\n trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]);\n\n if (transition) {\n transition._visibleQueryParams = {};\n }\n\n var finalQueryParams = {};\n for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) {\n var qp = finalQueryParamsArray[i];\n finalQueryParams[qp.key] = qp.value;\n if (transition && qp.visible !== false) {\n transition._visibleQueryParams[qp.key] = qp.value;\n }\n }\n return finalQueryParams;\n }\n\n __exports__[\"default\"] = Router;\n });\ndefine(\"router/transition-intent\", \n [\"./utils\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var merge = __dependency1__.merge;\n\n function TransitionIntent(props) {\n this.initialize(props);\n\n // TODO: wat\n this.data = this.data || {};\n }\n\n TransitionIntent.prototype = {\n initialize: null,\n applyToState: null\n };\n\n __exports__[\"default\"] = TransitionIntent;\n });\ndefine(\"router/transition-intent/named-transition-intent\", \n [\"../transition-intent\",\"../transition-state\",\"../handler-info/factory\",\"../utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var TransitionIntent = __dependency1__[\"default\"];\n var TransitionState = __dependency2__[\"default\"];\n var handlerInfoFactory = __dependency3__[\"default\"];\n var isParam = __dependency4__.isParam;\n var extractQueryParams = __dependency4__.extractQueryParams;\n var merge = __dependency4__.merge;\n var subclass = __dependency4__.subclass;\n\n __exports__[\"default\"] = subclass(TransitionIntent, {\n name: null,\n pivotHandler: null,\n contexts: null,\n queryParams: null,\n\n initialize: function(props) {\n this.name = props.name;\n this.pivotHandler = props.pivotHandler;\n this.contexts = props.contexts || [];\n this.queryParams = props.queryParams;\n },\n\n applyToState: function(oldState, recognizer, getHandler, isIntermediate) {\n\n var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)),\n pureArgs = partitionedArgs[0],\n queryParams = partitionedArgs[1],\n handlers = recognizer.handlersFor(pureArgs[0]);\n\n var targetRouteName = handlers[handlers.length-1].handler;\n\n return this.applyToHandlers(oldState, handlers, getHandler, targetRouteName, isIntermediate);\n },\n\n applyToHandlers: function(oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive) {\n\n var i;\n var newState = new TransitionState();\n var objects = this.contexts.slice(0);\n\n var invalidateIndex = handlers.length;\n\n // Pivot handlers are provided for refresh transitions\n if (this.pivotHandler) {\n for (i = 0; i < handlers.length; ++i) {\n if (getHandler(handlers[i].handler) === this.pivotHandler) {\n invalidateIndex = i;\n break;\n }\n }\n }\n\n var pivotHandlerFound = !this.pivotHandler;\n\n for (i = handlers.length - 1; i >= 0; --i) {\n var result = handlers[i];\n var name = result.handler;\n var handler = getHandler(name);\n\n var oldHandlerInfo = oldState.handlerInfos[i];\n var newHandlerInfo = null;\n\n if (result.names.length > 0) {\n if (i >= invalidateIndex) {\n newHandlerInfo = this.createParamHandlerInfo(name, handler, result.names, objects, oldHandlerInfo);\n } else {\n newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, handler, result.names, objects, oldHandlerInfo, targetRouteName, i);\n }\n } else {\n // This route has no dynamic segment.\n // Therefore treat as a param-based handlerInfo\n // with empty params. This will cause the `model`\n // hook to be called with empty params, which is desirable.\n newHandlerInfo = this.createParamHandlerInfo(name, handler, result.names, objects, oldHandlerInfo);\n }\n\n if (checkingIfActive) {\n // If we're performing an isActive check, we want to\n // serialize URL params with the provided context, but\n // ignore mismatches between old and new context.\n newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context);\n var oldContext = oldHandlerInfo && oldHandlerInfo.context;\n if (result.names.length > 0 && newHandlerInfo.context === oldContext) {\n // If contexts match in isActive test, assume params also match.\n // This allows for flexibility in not requiring that every last\n // handler provide a `serialize` method\n newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params;\n }\n newHandlerInfo.context = oldContext;\n }\n\n var handlerToUse = oldHandlerInfo;\n if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) {\n invalidateIndex = Math.min(i, invalidateIndex);\n handlerToUse = newHandlerInfo;\n }\n\n if (isIntermediate && !checkingIfActive) {\n handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context);\n }\n\n newState.handlerInfos.unshift(handlerToUse);\n }\n\n if (objects.length > 0) {\n throw new Error(\"More context objects were passed than there are dynamic segments for the route: \" + targetRouteName);\n }\n\n if (!isIntermediate) {\n this.invalidateChildren(newState.handlerInfos, invalidateIndex);\n }\n\n merge(newState.queryParams, oldState.queryParams);\n merge(newState.queryParams, this.queryParams || {});\n\n return newState;\n },\n\n invalidateChildren: function(handlerInfos, invalidateIndex) {\n for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) {\n var handlerInfo = handlerInfos[i];\n handlerInfos[i] = handlerInfos[i].getUnresolved();\n }\n },\n\n getHandlerInfoForDynamicSegment: function(name, handler, names, objects, oldHandlerInfo, targetRouteName, i) {\n\n var numNames = names.length;\n var objectToUse;\n if (objects.length > 0) {\n\n // Use the objects provided for this transition.\n objectToUse = objects[objects.length - 1];\n if (isParam(objectToUse)) {\n return this.createParamHandlerInfo(name, handler, names, objects, oldHandlerInfo);\n } else {\n objects.pop();\n }\n } else if (oldHandlerInfo && oldHandlerInfo.name === name) {\n // Reuse the matching oldHandlerInfo\n return oldHandlerInfo;\n } else {\n if (this.preTransitionState) {\n var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i];\n objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context;\n } else {\n // Ideally we should throw this error to provide maximal\n // information to the user that not enough context objects\n // were provided, but this proves too cumbersome in Ember\n // in cases where inner template helpers are evaluated\n // before parent helpers un-render, in which cases this\n // error somewhat prematurely fires.\n //throw new Error(\"Not enough context objects were provided to complete a transition to \" + targetRouteName + \". Specifically, the \" + name + \" route needs an object that can be serialized into its dynamic URL segments [\" + names.join(', ') + \"]\");\n return oldHandlerInfo;\n }\n }\n\n return handlerInfoFactory('object', {\n name: name,\n handler: handler,\n context: objectToUse,\n names: names\n });\n },\n\n createParamHandlerInfo: function(name, handler, names, objects, oldHandlerInfo) {\n var params = {};\n\n // Soak up all the provided string/numbers\n var numNames = names.length;\n while (numNames--) {\n\n // Only use old params if the names match with the new handler\n var oldParams = (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {};\n\n var peek = objects[objects.length - 1];\n var paramName = names[numNames];\n if (isParam(peek)) {\n params[paramName] = \"\" + objects.pop();\n } else {\n // If we're here, this means only some of the params\n // were string/number params, so try and use a param\n // value from a previous handler.\n if (oldParams.hasOwnProperty(paramName)) {\n params[paramName] = oldParams[paramName];\n } else {\n throw new Error(\"You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route \" + name);\n }\n }\n }\n\n return handlerInfoFactory('param', {\n name: name,\n handler: handler,\n params: params\n });\n }\n });\n });\ndefine(\"router/transition-intent/url-transition-intent\", \n [\"../transition-intent\",\"../transition-state\",\"../handler-info/factory\",\"../utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var TransitionIntent = __dependency1__[\"default\"];\n var TransitionState = __dependency2__[\"default\"];\n var handlerInfoFactory = __dependency3__[\"default\"];\n var oCreate = __dependency4__.oCreate;\n var merge = __dependency4__.merge;\n var subclass = __dependency4__.subclass;\n\n __exports__[\"default\"] = subclass(TransitionIntent, {\n url: null,\n\n initialize: function(props) {\n this.url = props.url;\n },\n\n applyToState: function(oldState, recognizer, getHandler) {\n var newState = new TransitionState();\n\n var results = recognizer.recognize(this.url),\n queryParams = {},\n i, len;\n\n if (!results) {\n throw new UnrecognizedURLError(this.url);\n }\n\n var statesDiffer = false;\n\n for (i = 0, len = results.length; i < len; ++i) {\n var result = results[i];\n var name = result.handler;\n var handler = getHandler(name);\n\n if (handler.inaccessibleByURL) {\n throw new UnrecognizedURLError(this.url);\n }\n\n var newHandlerInfo = handlerInfoFactory('param', {\n name: name,\n handler: handler,\n params: result.params\n });\n\n var oldHandlerInfo = oldState.handlerInfos[i];\n if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) {\n statesDiffer = true;\n newState.handlerInfos[i] = newHandlerInfo;\n } else {\n newState.handlerInfos[i] = oldHandlerInfo;\n }\n }\n\n merge(newState.queryParams, results.queryParams);\n\n return newState;\n }\n });\n\n /**\n Promise reject reasons passed to promise rejection\n handlers for failed transitions.\n */\n function UnrecognizedURLError(message) {\n this.message = (message || \"UnrecognizedURLError\");\n this.name = \"UnrecognizedURLError\";\n }\n });\ndefine(\"router/transition-state\", \n [\"./handler-info\",\"./utils\",\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var ResolvedHandlerInfo = __dependency1__.ResolvedHandlerInfo;\n var forEach = __dependency2__.forEach;\n var promiseLabel = __dependency2__.promiseLabel;\n var Promise = __dependency3__[\"default\"];\n\n function TransitionState(other) {\n this.handlerInfos = [];\n this.queryParams = {};\n this.params = {};\n }\n\n TransitionState.prototype = {\n handlerInfos: null,\n queryParams: null,\n params: null,\n\n promiseLabel: function(label) {\n var targetName = '';\n forEach(this.handlerInfos, function(handlerInfo) {\n if (targetName !== '') {\n targetName += '.';\n }\n targetName += handlerInfo.name;\n });\n return promiseLabel(\"'\" + targetName + \"': \" + label);\n },\n\n resolve: function(shouldContinue, payload) {\n var self = this;\n // First, calculate params for this state. This is useful\n // information to provide to the various route hooks.\n var params = this.params;\n forEach(this.handlerInfos, function(handlerInfo) {\n params[handlerInfo.name] = handlerInfo.params || {};\n });\n\n payload = payload || {};\n payload.resolveIndex = 0;\n\n var currentState = this;\n var wasAborted = false;\n\n // The prelude RSVP.resolve() asyncs us into the promise land.\n return Promise.resolve(null, this.promiseLabel(\"Start transition\"))\n .then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error'));\n\n function innerShouldContinue() {\n return Promise.resolve(shouldContinue(), promiseLabel(\"Check if should continue\"))['catch'](function(reason) {\n // We distinguish between errors that occurred\n // during resolution (e.g. beforeModel/model/afterModel),\n // and aborts due to a rejecting promise from shouldContinue().\n wasAborted = true;\n return Promise.reject(reason);\n }, promiseLabel(\"Handle abort\"));\n }\n\n function handleError(error) {\n // This is the only possible\n // reject value of TransitionState#resolve\n var handlerInfos = currentState.handlerInfos;\n var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ?\n handlerInfos.length - 1 : payload.resolveIndex;\n return Promise.reject({\n error: error,\n handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler,\n wasAborted: wasAborted,\n state: currentState\n });\n }\n\n function proceed(resolvedHandlerInfo) {\n var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved;\n\n // Swap the previously unresolved handlerInfo with\n // the resolved handlerInfo\n currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo;\n\n if (!wasAlreadyResolved) {\n // Call the redirect hook. The reason we call it here\n // vs. afterModel is so that redirects into child\n // routes don't re-run the model hooks for this\n // already-resolved route.\n var handler = resolvedHandlerInfo.handler;\n if (handler && handler.redirect) {\n handler.redirect(resolvedHandlerInfo.context, payload);\n }\n }\n\n // Proceed after ensuring that the redirect hook\n // didn't abort this transition by transitioning elsewhere.\n return innerShouldContinue().then(resolveOneHandlerInfo, null, promiseLabel('Resolve handler'));\n }\n\n function resolveOneHandlerInfo() {\n if (payload.resolveIndex === currentState.handlerInfos.length) {\n // This is is the only possible\n // fulfill value of TransitionState#resolve\n return {\n error: null,\n state: currentState\n };\n }\n\n var handlerInfo = currentState.handlerInfos[payload.resolveIndex];\n\n return handlerInfo.resolve(innerShouldContinue, payload)\n .then(proceed, null, promiseLabel('Proceed'));\n }\n }\n };\n\n __exports__[\"default\"] = TransitionState;\n });\ndefine(\"router/transition\", \n [\"rsvp/promise\",\"./handler-info\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var ResolvedHandlerInfo = __dependency2__.ResolvedHandlerInfo;\n var trigger = __dependency3__.trigger;\n var slice = __dependency3__.slice;\n var log = __dependency3__.log;\n var promiseLabel = __dependency3__.promiseLabel;\n\n /**\n @private\n\n A Transition is a thennable (a promise-like object) that represents\n an attempt to transition to another route. It can be aborted, either\n explicitly via `abort` or by attempting another transition while a\n previous one is still underway. An aborted transition can also\n be `retry()`d later.\n */\n function Transition(router, intent, state, error) {\n var transition = this;\n this.state = state || router.state;\n this.intent = intent;\n this.router = router;\n this.data = this.intent && this.intent.data || {};\n this.resolvedModels = {};\n this.queryParams = {};\n\n if (error) {\n this.promise = Promise.reject(error);\n return;\n }\n\n if (state) {\n this.params = state.params;\n this.queryParams = state.queryParams;\n\n var len = state.handlerInfos.length;\n if (len) {\n this.targetName = state.handlerInfos[state.handlerInfos.length-1].name;\n }\n\n for (var i = 0; i < len; ++i) {\n var handlerInfo = state.handlerInfos[i];\n\n // TODO: this all seems hacky\n if (!handlerInfo.isResolved) { break; }\n this.pivotHandler = handlerInfo.handler;\n }\n\n this.sequence = Transition.currentSequence++;\n this.promise = state.resolve(checkForAbort, this)['catch'](function(result) {\n if (result.wasAborted || transition.isAborted) {\n return Promise.reject(logAbort(transition));\n } else {\n transition.trigger('error', result.error, transition, result.handlerWithError);\n transition.abort();\n return Promise.reject(result.error);\n }\n }, promiseLabel('Handle Abort'));\n } else {\n this.promise = Promise.resolve(this.state);\n this.params = {};\n }\n\n function checkForAbort() {\n if (transition.isAborted) {\n return Promise.reject(undefined, promiseLabel(\"Transition aborted - reject\"));\n }\n }\n }\n\n Transition.currentSequence = 0;\n\n Transition.prototype = {\n targetName: null,\n urlMethod: 'update',\n intent: null,\n params: null,\n pivotHandler: null,\n resolveIndex: 0,\n handlerInfos: null,\n resolvedModels: null,\n isActive: true,\n state: null,\n\n isTransition: true,\n\n /**\n @public\n\n The Transition's internal promise. Calling `.then` on this property\n is that same as calling `.then` on the Transition object itself, but\n this property is exposed for when you want to pass around a\n Transition's promise, but not the Transition object itself, since\n Transition object can be externally `abort`ed, while the promise\n cannot.\n */\n promise: null,\n\n /**\n @public\n\n Custom state can be stored on a Transition's `data` object.\n This can be useful for decorating a Transition within an earlier\n hook and shared with a later hook. Properties set on `data` will\n be copied to new transitions generated by calling `retry` on this\n transition.\n */\n data: null,\n\n /**\n @public\n\n A standard promise hook that resolves if the transition\n succeeds and rejects if it fails/redirects/aborts.\n\n Forwards to the internal `promise` property which you can\n use in situations where you want to pass around a thennable,\n but not the Transition itself.\n\n @param {Function} success\n @param {Function} failure\n */\n then: function(success, failure) {\n return this.promise.then(success, failure);\n },\n\n /**\n @public\n\n Aborts the Transition. Note you can also implicitly abort a transition\n by initiating another transition while a previous one is underway.\n */\n abort: function() {\n if (this.isAborted) { return this; }\n log(this.router, this.sequence, this.targetName + \": transition was aborted\");\n this.intent.preTransitionState = this.router.state;\n this.isAborted = true;\n this.isActive = false;\n this.router.activeTransition = null;\n return this;\n },\n\n /**\n @public\n\n Retries a previously-aborted transition (making sure to abort the\n transition if it's still active). Returns a new transition that\n represents the new attempt to transition.\n */\n retry: function() {\n // TODO: add tests for merged state retry()s\n this.abort();\n return this.router.transitionByIntent(this.intent, false);\n },\n\n /**\n @public\n\n Sets the URL-changing method to be employed at the end of a\n successful transition. By default, a new Transition will just\n use `updateURL`, but passing 'replace' to this method will\n cause the URL to update using 'replaceWith' instead. Omitting\n a parameter will disable the URL change, allowing for transitions\n that don't update the URL at completion (this is also used for\n handleURL, since the URL has already changed before the\n transition took place).\n\n @param {String} method the type of URL-changing method to use\n at the end of a transition. Accepted values are 'replace',\n falsy values, or any other non-falsy value (which is\n interpreted as an updateURL transition).\n\n @return {Transition} this transition\n */\n method: function(method) {\n this.urlMethod = method;\n return this;\n },\n\n /**\n @public\n\n Fires an event on the current list of resolved/resolving\n handlers within this transition. Useful for firing events\n on route hierarchies that haven't fully been entered yet.\n\n Note: This method is also aliased as `send`\n\n @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error\n @param {String} name the name of the event to fire\n */\n trigger: function (ignoreFailure) {\n var args = slice.call(arguments);\n if (typeof ignoreFailure === 'boolean') {\n args.shift();\n } else {\n // Throw errors on unhandled trigger events by default\n ignoreFailure = false;\n }\n trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args);\n },\n\n /**\n @public\n\n Transitions are aborted and their promises rejected\n when redirects occur; this method returns a promise\n that will follow any redirects that occur and fulfill\n with the value fulfilled by any redirecting transitions\n that occur.\n\n @return {Promise} a promise that fulfills with the same\n value that the final redirecting transition fulfills with\n */\n followRedirects: function() {\n var router = this.router;\n return this.promise['catch'](function(reason) {\n if (router.activeTransition) {\n return router.activeTransition.followRedirects();\n }\n return Promise.reject(reason);\n });\n },\n\n toString: function() {\n return \"Transition (sequence \" + this.sequence + \")\";\n },\n\n /**\n @private\n */\n log: function(message) {\n log(this.router, this.sequence, message);\n }\n };\n\n // Alias 'trigger' as 'send'\n Transition.prototype.send = Transition.prototype.trigger;\n\n /**\n @private\n\n Logs and returns a TransitionAborted error.\n */\n function logAbort(transition) {\n log(transition.router, transition.sequence, \"detected abort.\");\n return new TransitionAborted();\n }\n\n function TransitionAborted(message) {\n this.message = (message || \"TransitionAborted\");\n this.name = \"TransitionAborted\";\n }\n\n __exports__.Transition = Transition;\n __exports__.logAbort = logAbort;\n __exports__.TransitionAborted = TransitionAborted;\n });\ndefine(\"router/utils\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var slice = Array.prototype.slice;\n\n var _isArray;\n if (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === \"[object Array]\";\n };\n } else {\n _isArray = Array.isArray;\n }\n\n var isArray = _isArray;\n __exports__.isArray = isArray;\n function merge(hash, other) {\n for (var prop in other) {\n if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; }\n }\n }\n\n var oCreate = Object.create || function(proto) {\n function F() {}\n F.prototype = proto;\n return new F();\n };\n __exports__.oCreate = oCreate;\n /**\n @private\n\n Extracts query params from the end of an array\n **/\n function extractQueryParams(array) {\n var len = (array && array.length), head, queryParams;\n\n if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) {\n queryParams = array[len - 1].queryParams;\n head = slice.call(array, 0, len - 1);\n return [head, queryParams];\n } else {\n return [array, null];\n }\n }\n\n __exports__.extractQueryParams = extractQueryParams;/**\n @private\n\n Coerces query param properties and array elements into strings.\n **/\n function coerceQueryParamsToString(queryParams) {\n for (var key in queryParams) {\n if (typeof queryParams[key] === 'number') {\n queryParams[key] = '' + queryParams[key];\n } else if (isArray(queryParams[key])) {\n for (var i = 0, l = queryParams[key].length; i < l; i++) {\n queryParams[key][i] = '' + queryParams[key][i];\n }\n }\n }\n }\n /**\n @private\n */\n function log(router, sequence, msg) {\n if (!router.log) { return; }\n\n if (arguments.length === 3) {\n router.log(\"Transition #\" + sequence + \": \" + msg);\n } else {\n msg = sequence;\n router.log(msg);\n }\n }\n\n __exports__.log = log;function bind(context, fn) {\n var boundArgs = arguments;\n return function(value) {\n var args = slice.call(boundArgs, 2);\n args.push(value);\n return fn.apply(context, args);\n };\n }\n\n __exports__.bind = bind;function isParam(object) {\n return (typeof object === \"string\" || object instanceof String || typeof object === \"number\" || object instanceof Number);\n }\n\n\n function forEach(array, callback) {\n for (var i=0, l=array.length; i<l && false !== callback(array[i]); i++) { }\n }\n\n __exports__.forEach = forEach;function trigger(router, handlerInfos, ignoreFailure, args) {\n if (router.triggerEvent) {\n router.triggerEvent(handlerInfos, ignoreFailure, args);\n return;\n }\n\n var name = args.shift();\n\n if (!handlerInfos) {\n if (ignoreFailure) { return; }\n throw new Error(\"Could not trigger event '\" + name + \"'. There are no active handlers\");\n }\n\n var eventWasHandled = false;\n\n for (var i=handlerInfos.length-1; i>=0; i--) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler.events && handler.events[name]) {\n if (handler.events[name].apply(handler, args) === true) {\n eventWasHandled = true;\n } else {\n return;\n }\n }\n }\n\n if (!eventWasHandled && !ignoreFailure) {\n throw new Error(\"Nothing handled the event '\" + name + \"'.\");\n }\n }\n\n __exports__.trigger = trigger;function getChangelist(oldObject, newObject) {\n var key;\n var results = {\n all: {},\n changed: {},\n removed: {}\n };\n\n merge(results.all, newObject);\n\n var didChange = false;\n coerceQueryParamsToString(oldObject);\n coerceQueryParamsToString(newObject);\n\n // Calculate removals\n for (key in oldObject) {\n if (oldObject.hasOwnProperty(key)) {\n if (!newObject.hasOwnProperty(key)) {\n didChange = true;\n results.removed[key] = oldObject[key];\n }\n }\n }\n\n // Calculate changes\n for (key in newObject) {\n if (newObject.hasOwnProperty(key)) {\n if (isArray(oldObject[key]) && isArray(newObject[key])) {\n if (oldObject[key].length !== newObject[key].length) {\n results.changed[key] = newObject[key];\n didChange = true;\n } else {\n for (var i = 0, l = oldObject[key].length; i < l; i++) {\n if (oldObject[key][i] !== newObject[key][i]) {\n results.changed[key] = newObject[key];\n didChange = true;\n }\n }\n }\n }\n else {\n if (oldObject[key] !== newObject[key]) {\n results.changed[key] = newObject[key];\n didChange = true;\n }\n }\n }\n }\n\n return didChange && results;\n }\n\n __exports__.getChangelist = getChangelist;function promiseLabel(label) {\n return 'Router: ' + label;\n }\n\n __exports__.promiseLabel = promiseLabel;function subclass(parentConstructor, proto) {\n function C(props) {\n parentConstructor.call(this, props || {});\n }\n C.prototype = oCreate(parentConstructor.prototype);\n merge(C.prototype, proto);\n return C;\n }\n\n __exports__.subclass = subclass;__exports__.merge = merge;\n __exports__.slice = slice;\n __exports__.isParam = isParam;\n __exports__.coerceQueryParamsToString = coerceQueryParamsToString;\n });\ndefine(\"router\", \n [\"./router/router\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Router = __dependency1__[\"default\"];\n\n __exports__[\"default\"] = Router;\n });\n\n})();\n//@ sourceURL=ember-routing");minispade.register('ember-runtime', "(function() {minispade.require(\"ember-metal\");\nminispade.require(\"rsvp\");\nminispade.require(\"container\");\ndefine(\"ember-runtime/compare\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-runtime/mixins/comparable\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // for Ember.ORDER_DEFINITION\n var typeOf = __dependency2__.typeOf;\n var Comparable = __dependency3__[\"default\"];\n\n // Used by Ember.compare\n Ember.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [\n 'undefined',\n 'null',\n 'boolean',\n 'number',\n 'string',\n 'array',\n 'object',\n 'instance',\n 'function',\n 'class',\n 'date'\n ];\n\n /**\n This will compare two javascript values of possibly different types.\n It will tell you which one is greater than the other by returning:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n The order is calculated based on `Ember.ORDER_DEFINITION`, if types are different.\n In case they have the same type an appropriate comparison for this type is made.\n\n ```javascript\n Ember.compare('hello', 'hello'); // 0\n Ember.compare('abc', 'dfg'); // -1\n Ember.compare(2, 1); // 1\n ```\n\n @method compare\n @for Ember\n @param {Object} v First value to compare\n @param {Object} w Second value to compare\n @return {Number} -1 if v < w, 0 if v = w and 1 if v > w.\n */\n function compare(v, w) {\n if (v === w) { return 0; }\n\n var type1 = typeOf(v);\n var type2 = typeOf(w);\n\n if (Comparable) {\n if (type1==='instance' && Comparable.detect(v.constructor)) {\n return v.constructor.compare(v, w);\n }\n\n if (type2 === 'instance' && Comparable.detect(w.constructor)) {\n return 1-w.constructor.compare(w, v);\n }\n }\n\n // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION,\n // do so now.\n var mapping = Ember.ORDER_DEFINITION_MAPPING;\n if (!mapping) {\n var order = Ember.ORDER_DEFINITION;\n mapping = Ember.ORDER_DEFINITION_MAPPING = {};\n var idx, len;\n for (idx = 0, len = order.length; idx < len; ++idx) {\n mapping[order[idx]] = idx;\n }\n\n // We no longer need Ember.ORDER_DEFINITION.\n delete Ember.ORDER_DEFINITION;\n }\n\n var type1Index = mapping[type1];\n var type2Index = mapping[type2];\n\n if (type1Index < type2Index) { return -1; }\n if (type1Index > type2Index) { return 1; }\n\n // types are equal - so we have to check values now\n switch (type1) {\n case 'boolean':\n case 'number':\n if (v < w) { return -1; }\n if (v > w) { return 1; }\n return 0;\n\n case 'string':\n var comp = v.localeCompare(w);\n if (comp < 0) { return -1; }\n if (comp > 0) { return 1; }\n return 0;\n\n case 'array':\n var vLen = v.length;\n var wLen = w.length;\n var l = Math.min(vLen, wLen);\n var r = 0;\n var i = 0;\n while (r === 0 && i < l) {\n r = compare(v[i],w[i]);\n i++;\n }\n if (r !== 0) { return r; }\n\n // all elements are equal now\n // shorter array should be ordered first\n if (vLen < wLen) { return -1; }\n if (vLen > wLen) { return 1; }\n // arrays are equal now\n return 0;\n\n case 'instance':\n if (Comparable && Comparable.detect(v)) {\n return v.compare(v, w);\n }\n return 0;\n\n case 'date':\n var vNum = v.getTime();\n var wNum = w.getTime();\n if (vNum < wNum) { return -1; }\n if (vNum > wNum) { return 1; }\n return 0;\n\n default:\n return 0;\n }\n };\n\n __exports__[\"default\"] = compare;\n });\ndefine(\"ember-runtime/computed/array_computed\",\n [\"ember-metal/core\",\"ember-runtime/computed/reduce_computed\",\"ember-metal/enumerable_utils\",\"ember-metal/platform\",\"ember-metal/observer\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var reduceComputed = __dependency2__.reduceComputed;\n var ReduceComputedProperty = __dependency2__.ReduceComputedProperty;\n var EnumerableUtils = __dependency3__[\"default\"];\n var create = __dependency4__.create;\n var addObserver = __dependency5__.addObserver;\n var EmberError = __dependency6__[\"default\"];\n\n var a_slice = [].slice,\n o_create = create,\n forEach = EnumerableUtils.forEach;\n\n function ArrayComputedProperty() {\n var cp = this;\n\n ReduceComputedProperty.apply(this, arguments);\n\n this.func = (function(reduceFunc) {\n return function (propertyName) {\n if (!cp._hasInstanceMeta(this, propertyName)) {\n // When we recompute an array computed property, we need already\n // retrieved arrays to be updated; we can't simply empty the cache and\n // hope the array is re-retrieved.\n forEach(cp._dependentKeys, function(dependentKey) {\n addObserver(this, dependentKey, function() {\n cp.recomputeOnce.call(this, propertyName);\n });\n }, this);\n }\n\n return reduceFunc.apply(this, arguments);\n };\n })(this.func);\n\n return this;\n }\n\n ArrayComputedProperty.prototype = o_create(ReduceComputedProperty.prototype);\n ArrayComputedProperty.prototype.initialValue = function () {\n return Ember.A();\n };\n ArrayComputedProperty.prototype.resetValue = function (array) {\n array.clear();\n return array;\n };\n\n // This is a stopgap to keep the reference counts correct with lazy CPs.\n ArrayComputedProperty.prototype.didChange = function (obj, keyName) {\n return;\n };\n\n /**\n Creates a computed property which operates on dependent arrays and\n is updated with \"one at a time\" semantics. When items are added or\n removed from the dependent array(s) an array computed only operates\n on the change instead of re-evaluating the entire array. This should\n return an array, if you'd like to use \"one at a time\" semantics and\n compute some value other then an array look at\n `Ember.reduceComputed`.\n\n If there are more than one arguments the first arguments are\n considered to be dependent property keys. The last argument is\n required to be an options object. The options object can have the\n following three properties.\n\n `initialize` - An optional initialize function. Typically this will be used\n to set up state on the instanceMeta object.\n\n `removedItem` - A function that is called each time an element is\n removed from the array.\n\n `addedItem` - A function that is called each time an element is\n added to the array.\n\n\n The `initialize` function has the following signature:\n\n ```javascript\n function(array, changeMeta, instanceMeta)\n ```\n\n `array` - The initial value of the arrayComputed, an empty array.\n\n `changeMeta` - An object which contains meta information about the\n computed. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n\n The `removedItem` and `addedItem` functions both have the following signature:\n\n ```javascript\n function(accumulatedValue, item, changeMeta, instanceMeta)\n ```\n\n `accumulatedValue` - The value returned from the last time\n `removedItem` or `addedItem` was called or an empty array.\n\n `item` - the element added or removed from the array\n\n `changeMeta` - An object which contains meta information about the\n change. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n - `index` the index of the added or removed item\n - `item` the added or removed item: this is exactly the same as\n the second arg\n - `arrayChanged` the array that triggered the change. Can be\n useful when depending on multiple arrays.\n\n For property changes triggered on an item property change (when\n depKey is something like `someArray.@each.someProperty`),\n `changeMeta` will also contain the following property:\n\n - `previousValues` an object whose keys are the properties that changed on\n the item, and whose values are the item's previous values.\n\n `previousValues` is important Ember coalesces item property changes via\n Ember.run.once. This means that by the time removedItem gets called, item has\n the new values, but you may need the previous value (eg for sorting &\n filtering).\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n The `removedItem` and `addedItem` functions should return the accumulated\n value. It is acceptable to not return anything (ie return undefined)\n to invalidate the computation. This is generally not a good idea for\n arrayComputed but it's used in eg max and min.\n\n Example\n\n ```javascript\n Ember.computed.map = function(dependentKey, callback) {\n var options = {\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var mapped = callback(item);\n array.insertAt(changeMeta.index, mapped);\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n array.removeAt(changeMeta.index, 1);\n return array;\n }\n };\n\n return Ember.arrayComputed(dependentKey, options);\n };\n ```\n\n @method arrayComputed\n @for Ember\n @param {String} [dependentKeys*]\n @param {Object} options\n @return {Ember.ComputedProperty}\n */\n function arrayComputed (options) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n options = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof options !== \"object\") {\n throw new EmberError(\"Array Computed Property declared without an options hash\");\n }\n\n var cp = new ArrayComputedProperty(options);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n };\n\n __exports__.arrayComputed = arrayComputed;\n __exports__.ArrayComputedProperty = ArrayComputedProperty;\n });\ndefine(\"ember-runtime/computed/reduce_computed\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/error\",\"ember-metal/property_events\",\"ember-metal/expand_properties\",\"ember-metal/observer\",\"ember-metal/computed\",\"ember-metal/platform\",\"ember-metal/enumerable_utils\",\"ember-runtime/system/tracked_array\",\"ember-runtime/mixins/array\",\"ember-metal/run_loop\",\"ember-runtime/system/set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var e_get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n var metaFor = __dependency4__.meta;\n var EmberError = __dependency5__[\"default\"];\n var propertyWillChange = __dependency6__.propertyWillChange;\n var propertyDidChange = __dependency6__.propertyDidChange;\n var expandProperties = __dependency7__[\"default\"];\n var addObserver = __dependency8__.addObserver;\n var observersFor = __dependency8__.observersFor;\n var removeObserver = __dependency8__.removeObserver;\n var addBeforeObserver = __dependency8__.addBeforeObserver;\n var removeBeforeObserver = __dependency8__.removeBeforeObserver;\n var ComputedProperty = __dependency9__.ComputedProperty;\n var cacheFor = __dependency9__.cacheFor;\n var create = __dependency10__.create;\n var EnumerableUtils = __dependency11__[\"default\"];\n var TrackedArray = __dependency12__[\"default\"];\n var EmberArray = __dependency13__[\"default\"];\n var run = __dependency14__[\"default\"];\n var Set = __dependency15__[\"default\"];\n var isArray = __dependency4__.isArray;\n\n var cacheSet = cacheFor.set,\n cacheGet = cacheFor.get,\n cacheRemove = cacheFor.remove,\n a_slice = [].slice,\n o_create = create,\n forEach = EnumerableUtils.forEach,\n // Here we explicitly don't allow `@each.foo`; it would require some special\n // testing, but there's no particular reason why it should be disallowed.\n eachPropertyPattern = /^(.*)\\.@each\\.(.*)/,\n doubleEachPropertyPattern = /(.*\\.@each){2,}/,\n arrayBracketPattern = /\\.\\[\\]$/;\n\n function get(obj, key) {\n if (key === '@this') {\n return obj;\n }\n\n return e_get(obj, key);\n }\n\n /*\n Tracks changes to dependent arrays, as well as to properties of items in\n dependent arrays.\n\n @class DependentArraysObserver\n */\n function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // the ReduceComputedPropertyInstanceMeta this DependentArraysObserver is\n // associated with\n this.instanceMeta = instanceMeta;\n\n // A map of array guids to dependentKeys, for the given context. We track\n // this because we want to set up the computed property potentially before the\n // dependent array even exists, but when the array observer fires, we lack\n // enough context to know what to update: we can recover that context by\n // getting the dependentKey.\n this.dependentKeysByGuid = {};\n\n // a map of dependent array guids -> TrackedArray instances. We use\n // this to lazily recompute indexes for item property observers.\n this.trackedArraysByGuid = {};\n\n // We suspend observers to ignore replacements from `reset` when totally\n // recomputing. Unfortunately we cannot properly suspend the observers\n // because we only have the key; instead we make the observers no-ops\n this.suspended = false;\n\n // This is used to coalesce item changes from property observers within a\n // single item.\n this.changedItems = {};\n // This is used to coalesce item changes for multiple items that depend on\n // some shared state.\n this.changedItemCount = 0;\n }\n\n function ItemPropertyObserverContext (dependentArray, index, trackedArray) {\n Ember.assert(\"Internal error: trackedArray is null or undefined\", trackedArray);\n\n this.dependentArray = dependentArray;\n this.index = index;\n this.item = dependentArray.objectAt(index);\n this.trackedArray = trackedArray;\n this.beforeObserver = null;\n this.observer = null;\n\n this.destroyed = false;\n }\n\n DependentArraysObserver.prototype = {\n setValue: function (newValue) {\n this.instanceMeta.setValue(newValue, true);\n },\n getValue: function () {\n return this.instanceMeta.getValue();\n },\n\n setupObservers: function (dependentArray, dependentKey) {\n this.dependentKeysByGuid[guidFor(dependentArray)] = dependentKey;\n\n dependentArray.addArrayObserver(this, {\n willChange: 'dependentArrayWillChange',\n didChange: 'dependentArrayDidChange'\n });\n\n if (this.cp._itemPropertyKeys[dependentKey]) {\n this.setupPropertyObservers(dependentKey, this.cp._itemPropertyKeys[dependentKey]);\n }\n },\n\n teardownObservers: function (dependentArray, dependentKey) {\n var itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || [];\n\n delete this.dependentKeysByGuid[guidFor(dependentArray)];\n\n this.teardownPropertyObservers(dependentKey, itemPropertyKeys);\n\n dependentArray.removeArrayObserver(this, {\n willChange: 'dependentArrayWillChange',\n didChange: 'dependentArrayDidChange'\n });\n },\n\n suspendArrayObservers: function (callback, binding) {\n var oldSuspended = this.suspended;\n this.suspended = true;\n callback.call(binding);\n this.suspended = oldSuspended;\n },\n\n setupPropertyObservers: function (dependentKey, itemPropertyKeys) {\n var dependentArray = get(this.instanceMeta.context, dependentKey),\n length = get(dependentArray, 'length'),\n observerContexts = new Array(length);\n\n this.resetTransformations(dependentKey, observerContexts);\n\n forEach(dependentArray, function (item, index) {\n var observerContext = this.createPropertyObserverContext(dependentArray, index, this.trackedArraysByGuid[dependentKey]);\n observerContexts[index] = observerContext;\n\n forEach(itemPropertyKeys, function (propertyKey) {\n addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver);\n addObserver(item, propertyKey, this, observerContext.observer);\n }, this);\n }, this);\n },\n\n teardownPropertyObservers: function (dependentKey, itemPropertyKeys) {\n var dependentArrayObserver = this,\n trackedArray = this.trackedArraysByGuid[dependentKey],\n beforeObserver,\n observer,\n item;\n\n if (!trackedArray) { return; }\n\n trackedArray.apply(function (observerContexts, offset, operation) {\n if (operation === TrackedArray.DELETE) { return; }\n\n forEach(observerContexts, function (observerContext) {\n observerContext.destroyed = true;\n beforeObserver = observerContext.beforeObserver;\n observer = observerContext.observer;\n item = observerContext.item;\n\n forEach(itemPropertyKeys, function (propertyKey) {\n removeBeforeObserver(item, propertyKey, dependentArrayObserver, beforeObserver);\n removeObserver(item, propertyKey, dependentArrayObserver, observer);\n });\n });\n });\n },\n\n createPropertyObserverContext: function (dependentArray, index, trackedArray) {\n var observerContext = new ItemPropertyObserverContext(dependentArray, index, trackedArray);\n\n this.createPropertyObserver(observerContext);\n\n return observerContext;\n },\n\n createPropertyObserver: function (observerContext) {\n var dependentArrayObserver = this;\n\n observerContext.beforeObserver = function (obj, keyName) {\n return dependentArrayObserver.itemPropertyWillChange(obj, keyName, observerContext.dependentArray, observerContext);\n };\n observerContext.observer = function (obj, keyName) {\n return dependentArrayObserver.itemPropertyDidChange(obj, keyName, observerContext.dependentArray, observerContext);\n };\n },\n\n resetTransformations: function (dependentKey, observerContexts) {\n this.trackedArraysByGuid[dependentKey] = new TrackedArray(observerContexts);\n },\n\n trackAdd: function (dependentKey, index, newItems) {\n var trackedArray = this.trackedArraysByGuid[dependentKey];\n if (trackedArray) {\n trackedArray.addItems(index, newItems);\n }\n },\n\n trackRemove: function (dependentKey, index, removedCount) {\n var trackedArray = this.trackedArraysByGuid[dependentKey];\n\n if (trackedArray) {\n return trackedArray.removeItems(index, removedCount);\n }\n\n return [];\n },\n\n updateIndexes: function (trackedArray, array) {\n var length = get(array, 'length');\n // OPTIMIZE: we could stop updating once we hit the object whose observer\n // fired; ie partially apply the transformations\n trackedArray.apply(function (observerContexts, offset, operation, operationIndex) {\n // we don't even have observer contexts for removed items, even if we did,\n // they no longer have any index in the array\n if (operation === TrackedArray.DELETE) { return; }\n if (operationIndex === 0 && operation === TrackedArray.RETAIN && observerContexts.length === length && offset === 0) {\n // If we update many items we don't want to walk the array each time: we\n // only need to update the indexes at most once per run loop.\n return;\n }\n\n forEach(observerContexts, function (context, index) {\n context.index = index + offset;\n });\n });\n },\n\n dependentArrayWillChange: function (dependentArray, index, removedCount, addedCount) {\n if (this.suspended) { return; }\n\n var removedItem = this.callbacks.removedItem,\n changeMeta,\n guid = guidFor(dependentArray),\n dependentKey = this.dependentKeysByGuid[guid],\n itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || [],\n length = get(dependentArray, 'length'),\n normalizedIndex = normalizeIndex(index, length, 0),\n normalizedRemoveCount = normalizeRemoveCount(normalizedIndex, length, removedCount),\n item,\n itemIndex,\n sliceIndex,\n observerContexts;\n\n observerContexts = this.trackRemove(dependentKey, normalizedIndex, normalizedRemoveCount);\n\n function removeObservers(propertyKey) {\n observerContexts[sliceIndex].destroyed = true;\n removeBeforeObserver(item, propertyKey, this, observerContexts[sliceIndex].beforeObserver);\n removeObserver(item, propertyKey, this, observerContexts[sliceIndex].observer);\n }\n\n for (sliceIndex = normalizedRemoveCount - 1; sliceIndex >= 0; --sliceIndex) {\n itemIndex = normalizedIndex + sliceIndex;\n if (itemIndex >= length) { break; }\n\n item = dependentArray.objectAt(itemIndex);\n\n forEach(itemPropertyKeys, removeObservers, this);\n\n changeMeta = createChangeMeta(dependentArray, item, itemIndex, this.instanceMeta.propertyName, this.cp);\n this.setValue( removedItem.call(\n this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta));\n }\n },\n\n dependentArrayDidChange: function (dependentArray, index, removedCount, addedCount) {\n if (this.suspended) { return; }\n\n var addedItem = this.callbacks.addedItem,\n guid = guidFor(dependentArray),\n dependentKey = this.dependentKeysByGuid[guid],\n observerContexts = new Array(addedCount),\n itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey],\n length = get(dependentArray, 'length'),\n normalizedIndex = normalizeIndex(index, length, addedCount),\n changeMeta,\n observerContext;\n\n forEach(dependentArray.slice(normalizedIndex, normalizedIndex + addedCount), function (item, sliceIndex) {\n if (itemPropertyKeys) {\n observerContext =\n observerContexts[sliceIndex] =\n this.createPropertyObserverContext(dependentArray, normalizedIndex + sliceIndex, this.trackedArraysByGuid[dependentKey]);\n forEach(itemPropertyKeys, function (propertyKey) {\n addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver);\n addObserver(item, propertyKey, this, observerContext.observer);\n }, this);\n }\n\n changeMeta = createChangeMeta(dependentArray, item, normalizedIndex + sliceIndex, this.instanceMeta.propertyName, this.cp);\n this.setValue( addedItem.call(\n this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta));\n }, this);\n\n this.trackAdd(dependentKey, normalizedIndex, observerContexts);\n },\n\n itemPropertyWillChange: function (obj, keyName, array, observerContext) {\n var guid = guidFor(obj);\n\n if (!this.changedItems[guid]) {\n this.changedItems[guid] = {\n array: array,\n observerContext: observerContext,\n obj: obj,\n previousValues: {}\n };\n }\n ++this.changedItemCount;\n\n this.changedItems[guid].previousValues[keyName] = get(obj, keyName);\n },\n\n itemPropertyDidChange: function(obj, keyName, array, observerContext) {\n if (--this.changedItemCount === 0) {\n this.flushChanges();\n }\n },\n\n flushChanges: function() {\n var changedItems = this.changedItems, key, c, changeMeta;\n\n for (key in changedItems) {\n c = changedItems[key];\n if (c.observerContext.destroyed) { continue; }\n\n this.updateIndexes(c.observerContext.trackedArray, c.observerContext.dependentArray);\n\n changeMeta = createChangeMeta(c.array, c.obj, c.observerContext.index, this.instanceMeta.propertyName, this.cp, c.previousValues);\n this.setValue(\n this.callbacks.removedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta));\n this.setValue(\n this.callbacks.addedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta));\n }\n this.changedItems = {};\n }\n };\n\n function normalizeIndex(index, length, newItemsOffset) {\n if (index < 0) {\n return Math.max(0, length + index);\n } else if (index < length) {\n return index;\n } else /* index > length */ {\n return Math.min(length - newItemsOffset, index);\n }\n }\n\n function normalizeRemoveCount(index, length, removedCount) {\n return Math.min(removedCount, length - index);\n }\n\n function createChangeMeta(dependentArray, item, index, propertyName, property, previousValues) {\n var meta = {\n arrayChanged: dependentArray,\n index: index,\n item: item,\n propertyName: propertyName,\n property: property\n };\n\n if (previousValues) {\n // previous values only available for item property changes\n meta.previousValues = previousValues;\n }\n\n return meta;\n }\n\n function addItems (dependentArray, callbacks, cp, propertyName, meta) {\n forEach(dependentArray, function (item, index) {\n meta.setValue( callbacks.addedItem.call(\n this, meta.getValue(), item, createChangeMeta(dependentArray, item, index, propertyName, cp), meta.sugarMeta));\n }, this);\n }\n\n function reset(cp, propertyName) {\n var callbacks = cp._callbacks(),\n meta;\n\n if (cp._hasInstanceMeta(this, propertyName)) {\n meta = cp._instanceMeta(this, propertyName);\n meta.setValue(cp.resetValue(meta.getValue()));\n } else {\n meta = cp._instanceMeta(this, propertyName);\n }\n\n if (cp.options.initialize) {\n cp.options.initialize.call(this, meta.getValue(), { property: cp, propertyName: propertyName }, meta.sugarMeta);\n }\n }\n\n function partiallyRecomputeFor(obj, dependentKey) {\n if (arrayBracketPattern.test(dependentKey)) {\n return false;\n }\n\n var value = get(obj, dependentKey);\n return EmberArray.detect(value);\n }\n\n function ReduceComputedPropertyInstanceMeta(context, propertyName, initialValue) {\n this.context = context;\n this.propertyName = propertyName;\n this.cache = metaFor(context).cache;\n\n this.dependentArrays = {};\n this.sugarMeta = {};\n\n this.initialValue = initialValue;\n }\n\n ReduceComputedPropertyInstanceMeta.prototype = {\n getValue: function () {\n var value = cacheGet(this.cache, this.propertyName);\n if (value !== undefined) {\n return value;\n } else {\n return this.initialValue;\n }\n },\n\n setValue: function(newValue, triggerObservers) {\n // This lets sugars force a recomputation, handy for very simple\n // implementations of eg max.\n if (newValue === cacheGet(this.cache, this.propertyName)) {\n return;\n }\n\n if (triggerObservers) {\n propertyWillChange(this.context, this.propertyName);\n }\n\n if (newValue === undefined) {\n cacheRemove(this.cache, this.propertyName);\n } else {\n cacheSet(this.cache, this.propertyName, newValue);\n }\n\n if (triggerObservers) {\n propertyDidChange(this.context, this.propertyName);\n }\n }\n };\n\n /**\n A computed property whose dependent keys are arrays and which is updated with\n \"one at a time\" semantics.\n\n @class ReduceComputedProperty\n @namespace Ember\n @extends Ember.ComputedProperty\n @constructor\n */\n function ReduceComputedProperty(options) {\n var cp = this;\n\n this.options = options;\n\n this._dependentKeys = null;\n // A map of dependentKey -> [itemProperty, ...] that tracks what properties of\n // items in the array we must track to update this property.\n this._itemPropertyKeys = {};\n this._previousItemPropertyKeys = {};\n\n this.readOnly();\n this.cacheable();\n\n this.recomputeOnce = function(propertyName) {\n // What we really want to do is coalesce by <cp, propertyName>.\n // We need a form of `scheduleOnce` that accepts an arbitrary token to\n // coalesce by, in addition to the target and method.\n run.once(this, recompute, propertyName);\n };\n var recompute = function(propertyName) {\n var dependentKeys = cp._dependentKeys,\n meta = cp._instanceMeta(this, propertyName),\n callbacks = cp._callbacks();\n\n reset.call(this, cp, propertyName);\n\n meta.dependentArraysObserver.suspendArrayObservers(function () {\n forEach(cp._dependentKeys, function (dependentKey) {\n Ember.assert(\n \"dependent array \" + dependentKey + \" must be an `Ember.Array`. \" +\n \"If you are not extending arrays, you will need to wrap native arrays with `Ember.A`\",\n !(isArray(get(this, dependentKey)) && !EmberArray.detect(get(this, dependentKey))));\n\n if (!partiallyRecomputeFor(this, dependentKey)) { return; }\n\n var dependentArray = get(this, dependentKey),\n previousDependentArray = meta.dependentArrays[dependentKey];\n\n if (dependentArray === previousDependentArray) {\n // The array may be the same, but our item property keys may have\n // changed, so we set them up again. We can't easily tell if they've\n // changed: the array may be the same object, but with different\n // contents.\n if (cp._previousItemPropertyKeys[dependentKey]) {\n delete cp._previousItemPropertyKeys[dependentKey];\n meta.dependentArraysObserver.setupPropertyObservers(dependentKey, cp._itemPropertyKeys[dependentKey]);\n }\n } else {\n meta.dependentArrays[dependentKey] = dependentArray;\n\n if (previousDependentArray) {\n meta.dependentArraysObserver.teardownObservers(previousDependentArray, dependentKey);\n }\n\n if (dependentArray) {\n meta.dependentArraysObserver.setupObservers(dependentArray, dependentKey);\n }\n }\n }, this);\n }, this);\n\n forEach(cp._dependentKeys, function(dependentKey) {\n if (!partiallyRecomputeFor(this, dependentKey)) { return; }\n\n var dependentArray = get(this, dependentKey);\n if (dependentArray) {\n addItems.call(this, dependentArray, callbacks, cp, propertyName, meta);\n }\n }, this);\n };\n\n\n this.func = function (propertyName) {\n Ember.assert(\"Computed reduce values require at least one dependent key\", cp._dependentKeys);\n\n recompute.call(this, propertyName);\n\n return cp._instanceMeta(this, propertyName).getValue();\n };\n }\n\n ReduceComputedProperty.prototype = o_create(ComputedProperty.prototype);\n\n function defaultCallback(computedValue) {\n return computedValue;\n }\n\n ReduceComputedProperty.prototype._callbacks = function () {\n if (!this.callbacks) {\n var options = this.options;\n this.callbacks = {\n removedItem: options.removedItem || defaultCallback,\n addedItem: options.addedItem || defaultCallback\n };\n }\n return this.callbacks;\n };\n\n ReduceComputedProperty.prototype._hasInstanceMeta = function (context, propertyName) {\n return !!metaFor(context).cacheMeta[propertyName];\n };\n\n ReduceComputedProperty.prototype._instanceMeta = function (context, propertyName) {\n var cacheMeta = metaFor(context).cacheMeta,\n meta = cacheMeta[propertyName];\n\n if (!meta) {\n meta = cacheMeta[propertyName] = new ReduceComputedPropertyInstanceMeta(context, propertyName, this.initialValue());\n meta.dependentArraysObserver = new DependentArraysObserver(this._callbacks(), this, meta, context, propertyName, meta.sugarMeta);\n }\n\n return meta;\n };\n\n ReduceComputedProperty.prototype.initialValue = function () {\n if (typeof this.options.initialValue === 'function') {\n return this.options.initialValue();\n }\n else {\n return this.options.initialValue;\n }\n };\n\n ReduceComputedProperty.prototype.resetValue = function (value) {\n return this.initialValue();\n };\n\n ReduceComputedProperty.prototype.itemPropertyKey = function (dependentArrayKey, itemPropertyKey) {\n this._itemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey] || [];\n this._itemPropertyKeys[dependentArrayKey].push(itemPropertyKey);\n };\n\n ReduceComputedProperty.prototype.clearItemPropertyKeys = function (dependentArrayKey) {\n if (this._itemPropertyKeys[dependentArrayKey]) {\n this._previousItemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey];\n this._itemPropertyKeys[dependentArrayKey] = [];\n }\n };\n\n ReduceComputedProperty.prototype.property = function () {\n var cp = this,\n args = a_slice.call(arguments),\n propertyArgs = new Set(),\n match,\n dependentArrayKey,\n itemPropertyKey;\n\n forEach(args, function (dependentKey) {\n if (doubleEachPropertyPattern.test(dependentKey)) {\n throw new EmberError(\"Nested @each properties not supported: \" + dependentKey);\n } else if (match = eachPropertyPattern.exec(dependentKey)) {\n dependentArrayKey = match[1];\n\n var itemPropertyKeyPattern = match[2],\n addItemPropertyKey = function (itemPropertyKey) {\n cp.itemPropertyKey(dependentArrayKey, itemPropertyKey);\n };\n\n expandProperties(itemPropertyKeyPattern, addItemPropertyKey);\n propertyArgs.add(dependentArrayKey);\n } else {\n propertyArgs.add(dependentKey);\n }\n });\n\n return ComputedProperty.prototype.property.apply(this, propertyArgs.toArray());\n\n };\n\n /**\n Creates a computed property which operates on dependent arrays and\n is updated with \"one at a time\" semantics. When items are added or\n removed from the dependent array(s) a reduce computed only operates\n on the change instead of re-evaluating the entire array.\n\n If there are more than one arguments the first arguments are\n considered to be dependent property keys. The last argument is\n required to be an options object. The options object can have the\n following four properties:\n\n `initialValue` - A value or function that will be used as the initial\n value for the computed. If this property is a function the result of calling\n the function will be used as the initial value. This property is required.\n\n `initialize` - An optional initialize function. Typically this will be used\n to set up state on the instanceMeta object.\n\n `removedItem` - A function that is called each time an element is removed\n from the array.\n\n `addedItem` - A function that is called each time an element is added to\n the array.\n\n\n The `initialize` function has the following signature:\n\n ```javascript\n function(initialValue, changeMeta, instanceMeta)\n ```\n\n `initialValue` - The value of the `initialValue` property from the\n options object.\n\n `changeMeta` - An object which contains meta information about the\n computed. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n\n The `removedItem` and `addedItem` functions both have the following signature:\n\n ```javascript\n function(accumulatedValue, item, changeMeta, instanceMeta)\n ```\n\n `accumulatedValue` - The value returned from the last time\n `removedItem` or `addedItem` was called or `initialValue`.\n\n `item` - the element added or removed from the array\n\n `changeMeta` - An object which contains meta information about the\n change. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n - `index` the index of the added or removed item\n - `item` the added or removed item: this is exactly the same as\n the second arg\n - `arrayChanged` the array that triggered the change. Can be\n useful when depending on multiple arrays.\n\n For property changes triggered on an item property change (when\n depKey is something like `someArray.@each.someProperty`),\n `changeMeta` will also contain the following property:\n\n - `previousValues` an object whose keys are the properties that changed on\n the item, and whose values are the item's previous values.\n\n `previousValues` is important Ember coalesces item property changes via\n Ember.run.once. This means that by the time removedItem gets called, item has\n the new values, but you may need the previous value (eg for sorting &\n filtering).\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n The `removedItem` and `addedItem` functions should return the accumulated\n value. It is acceptable to not return anything (ie return undefined)\n to invalidate the computation. This is generally not a good idea for\n arrayComputed but it's used in eg max and min.\n\n Note that observers will be fired if either of these functions return a value\n that differs from the accumulated value. When returning an object that\n mutates in response to array changes, for example an array that maps\n everything from some other array (see `Ember.computed.map`), it is usually\n important that the *same* array be returned to avoid accidentally triggering observers.\n\n Example\n\n ```javascript\n Ember.computed.max = function(dependentKey) {\n return Ember.reduceComputed(dependentKey, {\n initialValue: -Infinity,\n\n addedItem: function(accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.max(accumulatedValue, item);\n },\n\n removedItem: function(accumulatedValue, item, changeMeta, instanceMeta) {\n if (item < accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n };\n ```\n\n Dependent keys may refer to `@this` to observe changes to the object itself,\n which must be array-like, rather than a property of the object. This is\n mostly useful for array proxies, to ensure objects are retrieved via\n `objectAtContent`. This is how you could sort items by properties defined on an item controller.\n\n Example\n\n ```javascript\n App.PeopleController = Ember.ArrayController.extend({\n itemController: 'person',\n\n sortedPeople: Ember.computed.sort('@this.@each.reversedName', function(personA, personB) {\n // `reversedName` isn't defined on Person, but we have access to it via\n // the item controller App.PersonController. If we'd used\n // `content.@each.reversedName` above, we would be getting the objects\n // directly and not have access to `reversedName`.\n //\n var reversedNameA = get(personA, 'reversedName'),\n reversedNameB = get(personB, 'reversedName');\n\n return Ember.compare(reversedNameA, reversedNameB);\n })\n });\n\n App.PersonController = Ember.ObjectController.extend({\n reversedName: function() {\n return reverse(get(this, 'name'));\n }.property('name')\n });\n ```\n\n Dependent keys whose values are not arrays are treated as regular\n dependencies: when they change, the computed property is completely\n recalculated. It is sometimes useful to have dependent arrays with similar\n semantics. Dependent keys which end in `.[]` do not use \"one at a time\"\n semantics. When an item is added or removed from such a dependency, the\n computed property is completely recomputed.\n\n When the computed property is completely recomputed, the `accumulatedValue`\n is discarded, it starts with `initialValue` again, and each item is passed\n to `addedItem` in turn.\n\n Example\n\n ```javascript\n Ember.Object.extend({\n // When `string` is changed, `computed` is completely recomputed.\n string: 'a string',\n\n // When an item is added to `array`, `addedItem` is called.\n array: [],\n\n // When an item is added to `anotherArray`, `computed` is completely\n // recomputed.\n anotherArray: [],\n\n computed: Ember.reduceComputed('string', 'array', 'anotherArray.[]', {\n addedItem: addedItemCallback,\n removedItem: removedItemCallback\n })\n });\n ```\n\n @method reduceComputed\n @for Ember\n @param {String} [dependentKeys*]\n @param {Object} options\n @return {Ember.ComputedProperty}\n */\n function reduceComputed(options) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n options = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof options !== \"object\") {\n throw new EmberError(\"Reduce Computed Property declared without an options hash\");\n }\n\n if (!('initialValue' in options)) {\n throw new EmberError(\"Reduce Computed Property declared without an initial value\");\n }\n\n var cp = new ReduceComputedProperty(options);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n }\n\n __exports__.reduceComputed = reduceComputed;\n __exports__.ReduceComputedProperty = ReduceComputedProperty;\n });\ndefine(\"ember-runtime/computed/reduce_computed_macros\",\n [\"ember-metal/core\",\"ember-metal/merge\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"ember-metal/run_loop\",\"ember-metal/observer\",\"ember-runtime/computed/array_computed\",\"ember-runtime/computed/reduce_computed\",\"ember-runtime/system/object_proxy\",\"ember-runtime/system/subarray\",\"ember-runtime/keys\",\"ember-runtime/compare\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var merge = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var isArray = __dependency5__.isArray;\n var guidFor = __dependency5__.guidFor;\n var EmberError = __dependency6__[\"default\"];\n var EnumerableUtils = __dependency7__[\"default\"];\n var run = __dependency8__[\"default\"];\n var addObserver = __dependency9__.addObserver;\n var arrayComputed = __dependency10__.arrayComputed;\n var reduceComputed = __dependency11__.reduceComputed;\n var ObjectProxy = __dependency12__[\"default\"];\n var SubArray = __dependency13__[\"default\"];\n var keys = __dependency14__[\"default\"];\n var compare = __dependency15__[\"default\"];\n\n var a_slice = [].slice,\n forEach = EnumerableUtils.forEach,\n SearchProxy;\n\n /**\n A computed property that returns the sum of the value\n in the dependent array.\n\n @method computed.sum\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the sum of all values in the dependentKey's array\n @since 1.4.0\n */\n\n function sum(dependentKey){\n return reduceComputed(dependentKey, {\n initialValue: 0,\n\n addedItem: function(accumulatedValue, item, changeMeta, instanceMeta){\n return accumulatedValue + item;\n },\n\n removedItem: function(accumulatedValue, item, changeMeta, instanceMeta){\n return accumulatedValue - item;\n }\n });\n };\n\n /**\n A computed property that calculates the maximum value in the\n dependent array. This will return `-Infinity` when the dependent\n array is empty.\n\n ```javascript\n var Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age'),\n maxChildAge: Ember.computed.max('childAges')\n });\n\n var lordByron = Person.create({ children: [] });\n\n lordByron.get('maxChildAge'); // -Infinity\n lordByron.get('children').pushObject({\n name: 'Augusta Ada Byron', age: 7\n });\n lordByron.get('maxChildAge'); // 7\n lordByron.get('children').pushObjects([{\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }]);\n lordByron.get('maxChildAge'); // 8\n ```\n\n @method computed.max\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array\n */\n function max (dependentKey) {\n return reduceComputed(dependentKey, {\n initialValue: -Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.max(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item < accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n };\n\n /**\n A computed property that calculates the minimum value in the\n dependent array. This will return `Infinity` when the dependent\n array is empty.\n\n ```javascript\n var Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age'),\n minChildAge: Ember.computed.min('childAges')\n });\n\n var lordByron = Person.create({ children: [] });\n\n lordByron.get('minChildAge'); // Infinity\n lordByron.get('children').pushObject({\n name: 'Augusta Ada Byron', age: 7\n });\n lordByron.get('minChildAge'); // 7\n lordByron.get('children').pushObjects([{\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }]);\n lordByron.get('minChildAge'); // 5\n ```\n\n @method computed.min\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array\n */\n function min(dependentKey) {\n return reduceComputed(dependentKey, {\n initialValue: Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.min(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item > accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n };\n\n /**\n Returns an array mapped via the callback\n\n The callback method you provide should have the following signature.\n `item` is the current item in the iteration.\n\n ```javascript\n function(item);\n ```\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n excitingChores: Ember.computed.map('chores', function(chore) {\n return chore.toUpperCase() + '!';\n })\n });\n\n var hamster = Hamster.create({\n chores: ['clean', 'write more unit tests']\n });\n\n hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!']\n ```\n\n @method computed.map\n @for Ember\n @param {String} dependentKey\n @param {Function} callback\n @return {Ember.ComputedProperty} an array mapped via the callback\n */\n function map(dependentKey, callback) {\n var options = {\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var mapped = callback.call(this, item);\n array.insertAt(changeMeta.index, mapped);\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n array.removeAt(changeMeta.index, 1);\n return array;\n }\n };\n\n return arrayComputed(dependentKey, options);\n };\n\n /**\n Returns an array mapped to the specified key.\n\n ```javascript\n var Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age')\n });\n\n var lordByron = Person.create({ children: [] });\n\n lordByron.get('childAges'); // []\n lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 });\n lordByron.get('childAges'); // [7]\n lordByron.get('children').pushObjects([{\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }]);\n lordByron.get('childAges'); // [7, 5, 8]\n ```\n\n @method computed.mapBy\n @for Ember\n @param {String} dependentKey\n @param {String} propertyKey\n @return {Ember.ComputedProperty} an array mapped to the specified key\n */\n function mapBy (dependentKey, propertyKey) {\n var callback = function(item) { return get(item, propertyKey); };\n return map(dependentKey + '.@each.' + propertyKey, callback);\n };\n\n /**\n @method computed.mapProperty\n @for Ember\n @deprecated Use `Ember.computed.mapBy` instead\n @param dependentKey\n @param propertyKey\n */\n var mapProperty = mapBy;\n\n /**\n Filters the array by the callback.\n\n The callback method you provide should have the following signature.\n `item` is the current item in the iteration.\n\n ```javascript\n function(item);\n ```\n\n ```javascript\n var Hamster = Ember.Object.extend({\n remainingChores: Ember.computed.filter('chores', function(chore) {\n return !chore.done;\n })\n });\n\n var hamster = Hamster.create({ \n chores: [\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n ] \n });\n\n hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}]\n ```\n\n @method computed.filter\n @for Ember\n @param {String} dependentKey\n @param {Function} callback\n @return {Ember.ComputedProperty} the filtered array\n */\n function filter(dependentKey, callback) {\n var options = {\n initialize: function (array, changeMeta, instanceMeta) {\n instanceMeta.filteredArrayIndexes = new SubArray();\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var match = !!callback.call(this, item),\n filterIndex = instanceMeta.filteredArrayIndexes.addItem(changeMeta.index, match);\n\n if (match) {\n array.insertAt(filterIndex, item);\n }\n\n return array;\n },\n\n removedItem: function(array, item, changeMeta, instanceMeta) {\n var filterIndex = instanceMeta.filteredArrayIndexes.removeItem(changeMeta.index);\n\n if (filterIndex > -1) {\n array.removeAt(filterIndex);\n }\n\n return array;\n }\n };\n\n return arrayComputed(dependentKey, options);\n };\n\n /**\n Filters the array by the property and value\n\n ```javascript\n var Hamster = Ember.Object.extend({\n remainingChores: Ember.computed.filterBy('chores', 'done', false)\n });\n\n var hamster = Hamster.create({\n chores: [\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n ]\n });\n\n hamster.get('remainingChores'); // [{ name: 'write more unit tests', done: false }]\n ```\n\n @method computed.filterBy\n @for Ember\n @param {String} dependentKey\n @param {String} propertyKey\n @param {*} value\n @return {Ember.ComputedProperty} the filtered array\n */\n function filterBy (dependentKey, propertyKey, value) {\n var callback;\n\n if (arguments.length === 2) {\n callback = function(item) {\n return get(item, propertyKey);\n };\n } else {\n callback = function(item) {\n return get(item, propertyKey) === value;\n };\n }\n\n return filter(dependentKey + '.@each.' + propertyKey, callback);\n };\n\n /**\n @method computed.filterProperty\n @for Ember\n @param dependentKey\n @param propertyKey\n @param value\n @deprecated Use `Ember.computed.filterBy` instead\n */\n var filterProperty = filterBy;\n\n /**\n A computed property which returns a new array with all the unique\n elements from one or more dependent arrays.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n uniqueFruits: Ember.computed.uniq('fruits')\n });\n\n var hamster = Hamster.create({\n fruits: [\n 'banana',\n 'grape',\n 'kale',\n 'banana'\n ]\n });\n\n hamster.get('uniqueFruits'); // ['banana', 'grape', 'kale']\n ```\n\n @method computed.uniq\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n unique elements from the dependent array\n */\n function uniq() {\n var args = a_slice.call(arguments);\n args.push({\n initialize: function(array, changeMeta, instanceMeta) {\n instanceMeta.itemCounts = {};\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var guid = guidFor(item);\n\n if (!instanceMeta.itemCounts[guid]) {\n instanceMeta.itemCounts[guid] = 1;\n } else {\n ++instanceMeta.itemCounts[guid];\n }\n array.addObject(item);\n return array;\n },\n removedItem: function(array, item, _, instanceMeta) {\n var guid = guidFor(item),\n itemCounts = instanceMeta.itemCounts;\n\n if (--itemCounts[guid] === 0) {\n array.removeObject(item);\n }\n return array;\n }\n });\n return arrayComputed.apply(null, args);\n };\n\n /**\n Alias for [Ember.computed.uniq](/api/#method_computed_uniq).\n\n @method computed.union\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n unique elements from the dependent array\n */\n var union = uniq;\n\n /**\n A computed property which returns a new array with all the duplicated\n elements from two or more dependent arrays.\n\n Example\n\n ```javascript\n var obj = Ember.Object.createWithMixins({\n adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'],\n friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends')\n });\n\n obj.get('friendsInCommon'); // ['William King', 'Mary Somerville']\n ```\n\n @method computed.intersect\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n duplicated elements from the dependent arrays\n */\n function intersect() {\n var getDependentKeyGuids = function (changeMeta) {\n return EnumerableUtils.map(changeMeta.property._dependentKeys, function (dependentKey) {\n return guidFor(dependentKey);\n });\n };\n\n var args = a_slice.call(arguments);\n args.push({\n initialize: function (array, changeMeta, instanceMeta) {\n instanceMeta.itemCounts = {};\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var itemGuid = guidFor(item),\n dependentGuids = getDependentKeyGuids(changeMeta),\n dependentGuid = guidFor(changeMeta.arrayChanged),\n numberOfDependentArrays = changeMeta.property._dependentKeys.length,\n itemCounts = instanceMeta.itemCounts;\n\n if (!itemCounts[itemGuid]) { itemCounts[itemGuid] = {}; }\n if (itemCounts[itemGuid][dependentGuid] === undefined) { itemCounts[itemGuid][dependentGuid] = 0; }\n\n if (++itemCounts[itemGuid][dependentGuid] === 1 &&\n numberOfDependentArrays === keys(itemCounts[itemGuid]).length) {\n\n array.addObject(item);\n }\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n var itemGuid = guidFor(item),\n dependentGuids = getDependentKeyGuids(changeMeta),\n dependentGuid = guidFor(changeMeta.arrayChanged),\n numberOfDependentArrays = changeMeta.property._dependentKeys.length,\n numberOfArraysItemAppearsIn,\n itemCounts = instanceMeta.itemCounts;\n\n if (itemCounts[itemGuid][dependentGuid] === undefined) { itemCounts[itemGuid][dependentGuid] = 0; }\n if (--itemCounts[itemGuid][dependentGuid] === 0) {\n delete itemCounts[itemGuid][dependentGuid];\n numberOfArraysItemAppearsIn = keys(itemCounts[itemGuid]).length;\n\n if (numberOfArraysItemAppearsIn === 0) {\n delete itemCounts[itemGuid];\n }\n array.removeObject(item);\n }\n return array;\n }\n });\n return arrayComputed.apply(null, args);\n };\n\n /**\n A computed property which returns a new array with all the\n properties from the first dependent array that are not in the second\n dependent array.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n likes: ['banana', 'grape', 'kale'],\n wants: Ember.computed.setDiff('likes', 'fruits')\n });\n\n var hamster = Hamster.create({\n fruits: [\n 'grape',\n 'kale',\n ]\n });\n\n hamster.get('wants'); // ['banana']\n ```\n\n @method computed.setDiff\n @for Ember\n @param {String} setAProperty\n @param {String} setBProperty\n @return {Ember.ComputedProperty} computes a new array with all the\n items from the first dependent array that are not in the second\n dependent array\n */\n function setDiff(setAProperty, setBProperty) {\n if (arguments.length !== 2) {\n throw new EmberError(\"setDiff requires exactly two dependent arrays.\");\n }\n return arrayComputed(setAProperty, setBProperty, {\n addedItem: function (array, item, changeMeta, instanceMeta) {\n var setA = get(this, setAProperty),\n setB = get(this, setBProperty);\n\n if (changeMeta.arrayChanged === setA) {\n if (!setB.contains(item)) {\n array.addObject(item);\n }\n } else {\n array.removeObject(item);\n }\n return array;\n },\n\n removedItem: function (array, item, changeMeta, instanceMeta) {\n var setA = get(this, setAProperty),\n setB = get(this, setBProperty);\n\n if (changeMeta.arrayChanged === setB) {\n if (setA.contains(item)) {\n array.addObject(item);\n }\n } else {\n array.removeObject(item);\n }\n return array;\n }\n });\n };\n\n function binarySearch(array, item, low, high) {\n var mid, midItem, res, guidMid, guidItem;\n\n if (arguments.length < 4) { high = get(array, 'length'); }\n if (arguments.length < 3) { low = 0; }\n\n if (low === high) {\n return low;\n }\n\n mid = low + Math.floor((high - low) / 2);\n midItem = array.objectAt(mid);\n\n guidMid = _guidFor(midItem);\n guidItem = _guidFor(item);\n\n if (guidMid === guidItem) {\n return mid;\n }\n\n res = this.order(midItem, item);\n if (res === 0) {\n res = guidMid < guidItem ? -1 : 1;\n }\n\n\n if (res < 0) {\n return this.binarySearch(array, item, mid+1, high);\n } else if (res > 0) {\n return this.binarySearch(array, item, low, mid);\n }\n\n return mid;\n\n function _guidFor(item) {\n if (SearchProxy.detectInstance(item)) {\n return guidFor(get(item, 'content'));\n }\n return guidFor(item);\n }\n }\n\n\n var SearchProxy = ObjectProxy.extend();\n\n /**\n A computed property which returns a new array with all the\n properties from the first dependent array sorted based on a property\n or sort function.\n\n The callback method you provide should have the following signature:\n\n ```javascript\n function(itemA, itemB);\n ```\n\n - `itemA` the first item to compare.\n - `itemB` the second item to compare.\n\n This function should return negative number (e.g. `-1`) when `itemA` should come before\n `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after\n `itemB`. If the `itemA` and `itemB` are equal this function should return `0`.\n\n Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or\n `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`.\n\n Example\n\n ```javascript\n var ToDoList = Ember.Object.extend({\n // using standard ascending sort\n todosSorting: ['name'],\n sortedTodos: Ember.computed.sort('todos', 'todosSorting'),\n\n // using descending sort\n todosSortingDesc: ['name:desc'],\n sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'),\n\n // using a custom sort function\n priorityTodos: Ember.computed.sort('todos', function(a, b){\n if (a.priority > b.priority) {\n return 1;\n } else if (a.priority < b.priority) {\n return -1;\n }\n\n return 0;\n }),\n });\n\n var todoList = ToDoList.create({todos: [\n { name: 'Unit Test', priority: 2 },\n { name: 'Documentation', priority: 3 },\n { name: 'Release', priority: 1 }\n ]});\n\n todoList.get('sortedTodos'); // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\n todoList.get('sortedTodosDesc'); // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]\n todoList.get('priorityTodos'); // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n ```\n\n @method computed.sort\n @for Ember\n @param {String} dependentKey\n @param {String or Function} sortDefinition a dependent key to an\n array of sort properties (add `:desc` to the arrays sort properties to sort descending) or a function to use when sorting\n @return {Ember.ComputedProperty} computes a new sorted array based\n on the sort property array or callback function\n */\n function sort(itemsKey, sortDefinition) {\n Ember.assert(\"Ember.computed.sort requires two arguments: an array key to sort and either a sort properties key or sort function\", arguments.length === 2);\n\n var initFn, sortPropertiesKey;\n\n if (typeof sortDefinition === 'function') {\n initFn = function (array, changeMeta, instanceMeta) {\n instanceMeta.order = sortDefinition;\n instanceMeta.binarySearch = binarySearch;\n };\n } else {\n sortPropertiesKey = sortDefinition;\n initFn = function (array, changeMeta, instanceMeta) {\n function setupSortProperties() {\n var sortPropertyDefinitions = get(this, sortPropertiesKey),\n sortProperty,\n sortProperties = instanceMeta.sortProperties = [],\n sortPropertyAscending = instanceMeta.sortPropertyAscending = {},\n idx,\n asc;\n\n Ember.assert(\"Cannot sort: '\" + sortPropertiesKey + \"' is not an array.\", isArray(sortPropertyDefinitions));\n\n changeMeta.property.clearItemPropertyKeys(itemsKey);\n\n forEach(sortPropertyDefinitions, function (sortPropertyDefinition) {\n if ((idx = sortPropertyDefinition.indexOf(':')) !== -1) {\n sortProperty = sortPropertyDefinition.substring(0, idx);\n asc = sortPropertyDefinition.substring(idx+1).toLowerCase() !== 'desc';\n } else {\n sortProperty = sortPropertyDefinition;\n asc = true;\n }\n\n sortProperties.push(sortProperty);\n sortPropertyAscending[sortProperty] = asc;\n changeMeta.property.itemPropertyKey(itemsKey, sortProperty);\n });\n\n sortPropertyDefinitions.addObserver('@each', this, updateSortPropertiesOnce);\n }\n\n function updateSortPropertiesOnce() {\n run.once(this, updateSortProperties, changeMeta.propertyName);\n }\n\n function updateSortProperties(propertyName) {\n setupSortProperties.call(this);\n changeMeta.property.recomputeOnce.call(this, propertyName);\n }\n\n addObserver(this, sortPropertiesKey, updateSortPropertiesOnce);\n\n setupSortProperties.call(this);\n\n\n instanceMeta.order = function (itemA, itemB) {\n var isProxy = itemB instanceof SearchProxy,\n sortProperty, result, asc;\n\n for (var i = 0; i < this.sortProperties.length; ++i) {\n sortProperty = this.sortProperties[i];\n result = compare(get(itemA, sortProperty), isProxy ? itemB[sortProperty] : get(itemB, sortProperty));\n\n if (result !== 0) {\n asc = this.sortPropertyAscending[sortProperty];\n return asc ? result : (-1 * result);\n }\n }\n\n return 0;\n };\n\n instanceMeta.binarySearch = binarySearch;\n };\n }\n\n return arrayComputed(itemsKey, {\n initialize: initFn,\n\n addedItem: function (array, item, changeMeta, instanceMeta) {\n var index = instanceMeta.binarySearch(array, item);\n array.insertAt(index, item);\n return array;\n },\n\n removedItem: function (array, item, changeMeta, instanceMeta) {\n var proxyProperties, index, searchItem;\n\n if (changeMeta.previousValues) {\n proxyProperties = merge({ content: item }, changeMeta.previousValues);\n\n searchItem = SearchProxy.create(proxyProperties);\n } else {\n searchItem = item;\n }\n\n index = instanceMeta.binarySearch(array, searchItem);\n array.removeAt(index);\n return array;\n }\n });\n };\n\n\n __exports__.sum = sum;\n __exports__.min = min;\n __exports__.max = max;\n __exports__.map = map;\n __exports__.sort = sort;\n __exports__.setDiff = setDiff;\n __exports__.mapBy = mapBy;\n __exports__.mapProperty = mapProperty;\n __exports__.filter = filter;\n __exports__.filterBy = filterBy;\n __exports__.filterProperty = filterProperty;\n __exports__.uniq = uniq;\n __exports__.union = union;\n __exports__.intersect = intersect;\n });\ndefine(\"ember-runtime/controllers/array_controller\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/enumerable_utils\",\"ember-runtime/system/array_proxy\",\"ember-runtime/mixins/sortable\",\"ember-runtime/controllers/controller\",\"ember-metal/computed\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EnumerableUtils = __dependency4__[\"default\"];\n var ArrayProxy = __dependency5__[\"default\"];\n var SortableMixin = __dependency6__[\"default\"];\n var ControllerMixin = __dependency7__.ControllerMixin;\n var computed = __dependency8__.computed;\n var EmberError = __dependency9__[\"default\"];\n\n var forEach = EnumerableUtils.forEach,\n replace = EnumerableUtils.replace;\n\n /**\n `Ember.ArrayController` provides a way for you to publish a collection of\n objects so that you can easily bind to the collection from a Handlebars\n `#each` helper, an `Ember.CollectionView`, or other controllers.\n\n The advantage of using an `ArrayController` is that you only have to set up\n your view bindings once; to change what's displayed, simply swap out the\n `content` property on the controller.\n\n For example, imagine you wanted to display a list of items fetched via an XHR\n request. Create an `Ember.ArrayController` and set its `content` property:\n\n ```javascript\n MyApp.listController = Ember.ArrayController.create();\n\n $.get('people.json', function(data) {\n MyApp.listController.set('content', data);\n });\n ```\n\n Then, create a view that binds to your new controller:\n\n ```handlebars\n {{#each MyApp.listController}}\n {{firstName}} {{lastName}}\n {{/each}}\n ```\n\n Although you are binding to the controller, the behavior of this controller\n is to pass through any methods or properties to the underlying array. This\n capability comes from `Ember.ArrayProxy`, which this class inherits from.\n\n Sometimes you want to display computed properties within the body of an\n `#each` helper that depend on the underlying items in `content`, but are not\n present on those items. To do this, set `itemController` to the name of a\n controller (probably an `ObjectController`) that will wrap each individual item.\n\n For example:\n\n ```handlebars\n {{#each post in controller}}\n <li>{{post.title}} ({{post.titleLength}} characters)</li>\n {{/each}}\n ```\n\n ```javascript\n App.PostsController = Ember.ArrayController.extend({\n itemController: 'post'\n });\n\n App.PostController = Ember.ObjectController.extend({\n // the `title` property will be proxied to the underlying post.\n\n titleLength: function() {\n return this.get('title').length;\n }.property('title')\n });\n ```\n\n In some cases it is helpful to return a different `itemController` depending\n on the particular item. Subclasses can do this by overriding\n `lookupItemController`.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n The itemController instances will have a `parentController` property set to\n the `ArrayController` instance.\n\n @class ArrayController\n @namespace Ember\n @extends Ember.ArrayProxy\n @uses Ember.SortableMixin\n @uses Ember.ControllerMixin\n */\n\n var ArrayController = ArrayProxy.extend(ControllerMixin, SortableMixin, {\n\n /**\n The controller used to wrap items, if any.\n\n @property itemController\n @type String\n @default null\n */\n itemController: null,\n\n /**\n Return the name of the controller to wrap items, or `null` if items should\n be returned directly. The default implementation simply returns the\n `itemController` property, but subclasses can override this method to return\n different controllers for different objects.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @method lookupItemController\n @param {Object} object\n @return {String}\n */\n lookupItemController: function(object) {\n return get(this, 'itemController');\n },\n\n objectAtContent: function(idx) {\n var length = get(this, 'length'),\n arrangedContent = get(this,'arrangedContent'),\n object = arrangedContent && arrangedContent.objectAt(idx);\n\n if (idx >= 0 && idx < length) {\n var controllerClass = this.lookupItemController(object);\n if (controllerClass) {\n return this.controllerAt(idx, object, controllerClass);\n }\n }\n\n // When `controllerClass` is falsy, we have not opted in to using item\n // controllers, so return the object directly.\n\n // When the index is out of range, we want to return the \"out of range\"\n // value, whatever that might be. Rather than make assumptions\n // (e.g. guessing `null` or `undefined`) we defer this to `arrangedContent`.\n return object;\n },\n\n arrangedContentDidChange: function() {\n this._super();\n this._resetSubControllers();\n },\n\n arrayContentDidChange: function(idx, removedCnt, addedCnt) {\n var subControllers = get(this, '_subControllers'),\n subControllersToRemove = subControllers.slice(idx, idx+removedCnt);\n\n forEach(subControllersToRemove, function(subController) {\n if (subController) { subController.destroy(); }\n });\n\n replace(subControllers, idx, removedCnt, new Array(addedCnt));\n\n // The shadow array of subcontrollers must be updated before we trigger\n // observers, otherwise observers will get the wrong subcontainer when\n // calling `objectAt`\n this._super(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n\n this.set('_subControllers', [ ]);\n },\n\n content: computed(function () {\n return Ember.A();\n }),\n\n /**\n * Flag to mark as being \"virtual\". Used to keep this instance\n * from participating in the parentController hierarchy.\n *\n * @private\n * @property _isVirtual\n * @type Boolean\n */\n _isVirtual: false,\n\n controllerAt: function(idx, object, controllerClass) {\n var container = get(this, 'container'),\n subControllers = get(this, '_subControllers'),\n subController = subControllers[idx],\n fullName;\n\n if (subController) { return subController; }\n\n fullName = \"controller:\" + controllerClass;\n\n if (!container.has(fullName)) {\n throw new EmberError('Could not resolve itemController: \"' + controllerClass + '\"');\n }\n var parentController;\n if (this._isVirtual) {\n parentController = get(this, 'parentController');\n }\n parentController = parentController || this;\n subController = container.lookupFactory(fullName).create({\n target: this,\n parentController: parentController,\n content: object\n });\n\n subControllers[idx] = subController;\n\n return subController;\n },\n\n _subControllers: null,\n\n _resetSubControllers: function() {\n var subControllers = get(this, '_subControllers');\n var controller;\n\n if (subControllers.length) {\n for (var i = 0, length = subControllers.length; length > i; i++) {\n controller = subControllers[i];\n if (controller) {\n controller.destroy();\n }\n }\n\n subControllers.length = 0;\n }\n },\n\n willDestroy: function() {\n this._resetSubControllers();\n this._super();\n }\n });\n\n __exports__[\"default\"] = ArrayController;\n });\ndefine(\"ember-runtime/controllers/controller\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-runtime/system/object\",\"ember-metal/mixin\",\"ember-metal/computed\",\"ember-runtime/mixins/action_handler\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.deprecate\n var get = __dependency2__.get;\n var EmberObject = __dependency3__[\"default\"];\n var Mixin = __dependency4__.Mixin;\n var computed = __dependency5__.computed;\n var ActionHandler = __dependency6__[\"default\"];\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n /**\n `Ember.ControllerMixin` provides a standard interface for all classes that\n compose Ember's controller layer: `Ember.Controller`,\n `Ember.ArrayController`, and `Ember.ObjectController`.\n\n @class ControllerMixin\n @namespace Ember\n @uses Ember.ActionHandler\n */\n var ControllerMixin = Mixin.create(ActionHandler, {\n /* ducktype as a controller */\n isController: true,\n\n /**\n The object to which actions from the view should be sent.\n\n For example, when a Handlebars template uses the `{{action}}` helper,\n it will attempt to send the action to the view's controller's `target`.\n\n By default, the value of the target property is set to the router, and\n is injected when a controller is instantiated. This injection is defined\n in Ember.Application#buildContainer, and is applied as part of the\n applications initialization process. It can also be set after a controller\n has been instantiated, for instance when using the render helper in a\n template, or when a controller is used as an `itemController`. In most\n cases the `target` property will automatically be set to the logical\n consumer of actions for the controller.\n\n @property target\n @default null\n */\n target: null,\n\n container: null,\n\n parentController: null,\n\n store: null,\n\n model: computed.alias('content'),\n\n deprecatedSendHandles: function(actionName) {\n return !!this[actionName];\n },\n\n deprecatedSend: function(actionName) {\n var args = [].slice.call(arguments, 1);\n Ember.assert('' + this + \" has the action \" + actionName + \" but it is not a function\", typeof this[actionName] === 'function');\n Ember.deprecate('Action handlers implemented directly on controllers are deprecated in favor of action handlers on an `actions` object ( action: `' + actionName + '` on ' + this + ')', false);\n this[actionName].apply(this, args);\n return;\n }\n });\n\n /**\n @class Controller\n @namespace Ember\n @extends Ember.Object\n @uses Ember.ControllerMixin\n */\n var Controller = EmberObject.extend(ControllerMixin);\n\n __exports__.Controller = Controller;\n __exports__.ControllerMixin = ControllerMixin;\n });\ndefine(\"ember-runtime/controllers/object_controller\",\n [\"ember-runtime/controllers/controller\",\"ember-runtime/system/object_proxy\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var ControllerMixin = __dependency1__.ControllerMixin;\n var ObjectProxy = __dependency2__[\"default\"];\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n /**\n `Ember.ObjectController` is part of Ember's Controller layer. It is intended\n to wrap a single object, proxying unhandled attempts to `get` and `set` to the underlying\n content object, and to forward unhandled action attempts to its `target`.\n\n `Ember.ObjectController` derives this functionality from its superclass\n `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin.\n\n @class ObjectController\n @namespace Ember\n @extends Ember.ObjectProxy\n @uses Ember.ControllerMixin\n **/\n var ObjectController = ObjectProxy.extend(ControllerMixin);\n __exports__[\"default\"] = ObjectController;\n });\ndefine(\"ember-runtime/copy\",\n [\"ember-metal/enumerable_utils\",\"ember-metal/utils\",\"ember-runtime/system/object\",\"ember-runtime/mixins/copyable\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var EnumerableUtils = __dependency1__[\"default\"];\n var typeOf = __dependency2__.typeOf;\n var EmberObject = __dependency3__[\"default\"];\n var Copyable = __dependency4__[\"default\"];\n var create = __dependency5__.create;\n\n var indexOf = EnumerableUtils.indexOf;\n\n function _copy(obj, deep, seen, copies) {\n var ret, loc, key;\n\n // primitive data types are immutable, just return them.\n if ('object' !== typeof obj || obj===null) return obj;\n\n // avoid cyclical loops\n if (deep && (loc=indexOf(seen, obj))>=0) return copies[loc];\n\n Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof EmberObject) || (Copyable && Copyable.detect(obj)));\n\n // IMPORTANT: this specific test will detect a native array only. Any other\n // object will need to implement Copyable.\n if (typeOf(obj) === 'array') {\n ret = obj.slice();\n if (deep) {\n loc = ret.length;\n while(--loc>=0) ret[loc] = _copy(ret[loc], deep, seen, copies);\n }\n } else if (Copyable && Copyable.detect(obj)) {\n ret = obj.copy(deep, seen, copies);\n } else if (obj instanceof Date) {\n ret = new Date(obj.getTime());\n } else {\n ret = {};\n for(key in obj) {\n if (!obj.hasOwnProperty(key)) continue;\n\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') continue;\n\n ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];\n }\n }\n\n if (deep) {\n seen.push(obj);\n copies.push(ret);\n }\n\n return ret;\n }\n\n /**\n Creates a clone of the passed object. This function can take just about\n any type of object and create a clone of it, including primitive values\n (which are not actually cloned because they are immutable).\n\n If the passed object implements the `clone()` method, then this function\n will simply call that method and return the result.\n\n @method copy\n @for Ember\n @param {Object} obj The object to clone\n @param {Boolean} deep If true, a deep copy of the object is made\n @return {Object} The cloned object\n */\n function copy(obj, deep) {\n // fast paths\n if ('object' !== typeof obj || obj===null) return obj; // can't copy primitives\n if (Copyable && Copyable.detect(obj)) return obj.copy(deep);\n return _copy(obj, deep, deep ? [] : null, deep ? [] : null);\n };\n\n __exports__[\"default\"] = copy;\n });\ndefine(\"ember-runtime/core\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n /**\n Compares two objects, returning true if they are logically equal. This is\n a deeper comparison than a simple triple equal. For sets it will compare the\n internal objects. For any other object that implements `isEqual()` it will\n respect that method.\n\n ```javascript\n Ember.isEqual('hello', 'hello'); // true\n Ember.isEqual(1, 2); // false\n Ember.isEqual([4, 2], [4, 2]); // false\n ```\n\n @method isEqual\n @for Ember\n @param {Object} a first object to compare\n @param {Object} b second object to compare\n @return {Boolean}\n */\n function isEqual(a, b) {\n if (a && 'function'===typeof a.isEqual) return a.isEqual(b);\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n } \n return a === b;\n };\n\n __exports__.isEqual = isEqual;\n });\ndefine(\"ember-runtime/ext/function\",\n [\"ember-metal/core\",\"ember-metal/expand_properties\",\"ember-metal/computed\"],\n function(__dependency1__, __dependency2__, __dependency3__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.EXTEND_PROTOTYPES, Ember.assert\n var expandProperties = __dependency2__[\"default\"];\n var computed = __dependency3__.computed;\n\n var a_slice = Array.prototype.slice;\n var FunctionPrototype = Function.prototype;\n\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {\n\n /**\n The `property` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n `true`, which is the default.\n\n Computed properties allow you to treat a function like a property:\n\n ```javascript\n MyApp.President = Ember.Object.extend({\n firstName: '',\n lastName: '',\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Call this flag to mark the function as a property\n }.property()\n });\n\n var president = MyApp.President.create({\n firstName: \"Barack\",\n lastName: \"Obama\"\n });\n\n president.get('fullName'); // \"Barack Obama\"\n ```\n\n Treating a function like a property is useful because they can work with\n bindings, just like any other property.\n\n Many computed properties have dependencies on other properties. For\n example, in the above example, the `fullName` property depends on\n `firstName` and `lastName` to determine its value. You can tell Ember\n about these dependencies like this:\n\n ```javascript\n MyApp.President = Ember.Object.extend({\n firstName: '',\n lastName: '',\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember.js that this computed property depends on firstName\n // and lastName\n }.property('firstName', 'lastName')\n });\n ```\n\n Make sure you list these dependencies so Ember knows when to update\n bindings that connect to a computed property. Changing a dependency\n will not immediately trigger an update of the computed property, but\n will instead clear the cache so that it is updated when the next `get`\n is called on the property.\n\n See [Ember.ComputedProperty](/api/classes/Ember.ComputedProperty.html), [Ember.computed](/api/#method_computed).\n\n @method property\n @for Function\n */\n FunctionPrototype.property = function() {\n var ret = computed(this);\n // ComputedProperty.prototype.property expands properties; no need for us to\n // do so here.\n return ret.property.apply(ret, arguments);\n };\n\n /**\n The `observes` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n In the future this method may become asynchronous. If you want to ensure\n synchronous behavior, use `observesImmediately`.\n\n See `Ember.observer`.\n\n @method observes\n @for Function\n */\n FunctionPrototype.observes = function() {\n var addWatchedProperty = function (obs) { watched.push(obs); };\n var watched = [];\n\n for (var i=0; i<arguments.length; ++i) {\n expandProperties(arguments[i], addWatchedProperty);\n }\n\n this.__ember_observes__ = watched;\n\n return this;\n };\n\n /**\n The `observesImmediately` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can observe property changes simply by adding the `observesImmediately`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes immediately after the \"value\" property changes\n }.observesImmediately('value')\n });\n ```\n\n In the future, `observes` may become asynchronous. In this event,\n `observesImmediately` will maintain the synchronous behavior.\n\n See `Ember.immediateObserver`.\n\n @method observesImmediately\n @for Function\n */\n FunctionPrototype.observesImmediately = function() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", arg.indexOf('.') === -1);\n }\n\n // observes handles property expansion\n return this.observes.apply(this, arguments);\n };\n\n /**\n The `observesBefore` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can get notified when a property change is about to happen by\n by adding the `observesBefore` call to the end of your method\n declarations in classes that you write. For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property is about to change\n }.observesBefore('value')\n });\n ```\n\n See `Ember.beforeObserver`.\n\n @method observesBefore\n @for Function\n */\n FunctionPrototype.observesBefore = function() {\n var addWatchedProperty = function (obs) { watched.push(obs); };\n var watched = [];\n\n for (var i=0; i<arguments.length; ++i) {\n expandProperties(arguments[i], addWatchedProperty);\n }\n\n this.__ember_observesBefore__ = watched;\n\n return this;\n };\n\n /**\n The `on` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can listen for events simply by adding the `on` call to the end of\n your method declarations in classes or mixins that you write. For example:\n\n ```javascript\n Ember.Mixin.create({\n doSomethingWithElement: function() {\n // Executes whenever the \"didInsertElement\" event fires\n }.on('didInsertElement')\n });\n ```\n\n See `Ember.on`.\n\n @method on\n @for Function\n */\n FunctionPrototype.on = function() {\n var events = a_slice.call(arguments);\n this.__ember_listens__ = events;\n return this;\n };\n }\n });\ndefine(\"ember-runtime/ext/rsvp\",\n [\"ember-metal/core\",\"ember-metal/logger\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var Logger = __dependency2__[\"default\"];\n\n var RSVP = requireModule(\"rsvp\");\n var Test, testModuleName = 'ember-testing/test';\n\n RSVP.onerrorDefault = function(error) {\n if (error instanceof Error) {\n if (Ember.testing) {\n // ES6TODO: remove when possible\n if (!Test && Ember.__loader.registry[testModuleName]) {\n Test = requireModule(testModuleName)['default'];\n }\n\n if (Test && Test.adapter) {\n Test.adapter.exception(error);\n } else {\n throw error;\n }\n } else if (Ember.onerror) {\n Ember.onerror(error);\n } else {\n Logger.error(error.stack);\n Ember.assert(error, false);\n }\n }\n };\n\n RSVP.on('error', RSVP.onerrorDefault);\n\n __exports__[\"default\"] = RSVP;\n });\ndefine(\"ember-runtime/ext/string\",\n [\"ember-metal/core\",\"ember-runtime/system/string\"],\n function(__dependency1__, __dependency2__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.EXTEND_PROTOTYPES, Ember.assert, Ember.FEATURES\n var fmt = __dependency2__.fmt;\n var w = __dependency2__.w;\n var loc = __dependency2__.loc;\n var camelize = __dependency2__.camelize;\n var decamelize = __dependency2__.decamelize;\n var dasherize = __dependency2__.dasherize;\n var underscore = __dependency2__.underscore;\n var capitalize = __dependency2__.capitalize;\n var classify = __dependency2__.classify;\n var StringPrototype = String.prototype;\n\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n See [Ember.String.fmt](/api/classes/Ember.String.html#method_fmt).\n\n @method fmt\n @for String\n */\n StringPrototype.fmt = function() {\n return fmt(this, arguments);\n };\n\n /**\n See [Ember.String.w](/api/classes/Ember.String.html#method_w).\n\n @method w\n @for String\n */\n StringPrototype.w = function() {\n return w(this);\n };\n\n /**\n See [Ember.String.loc](/api/classes/Ember.String.html#method_loc).\n\n @method loc\n @for String\n */\n StringPrototype.loc = function() {\n return loc(this, arguments);\n };\n\n /**\n See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize).\n\n @method camelize\n @for String\n */\n StringPrototype.camelize = function() {\n return camelize(this);\n };\n\n /**\n See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize).\n\n @method decamelize\n @for String\n */\n StringPrototype.decamelize = function() {\n return decamelize(this);\n };\n\n /**\n See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize).\n\n @method dasherize\n @for String\n */\n StringPrototype.dasherize = function() {\n return dasherize(this);\n };\n\n /**\n See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore).\n\n @method underscore\n @for String\n */\n StringPrototype.underscore = function() {\n return underscore(this);\n };\n\n /**\n See [Ember.String.classify](/api/classes/Ember.String.html#method_classify).\n\n @method classify\n @for String\n */\n StringPrototype.classify = function() {\n return classify(this);\n };\n\n /**\n See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize).\n\n @method capitalize\n @for String\n */\n StringPrototype.capitalize = function() {\n return capitalize(this);\n };\n }\n });\ndefine(\"ember-runtime/keys\",\n [\"ember-metal/enumerable_utils\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var EnumerableUtils = __dependency1__[\"default\"];\n var create = __dependency2__.create;\n\n /**\n Returns all of the keys defined on an object or hash. This is useful\n when inspecting objects for debugging. On browsers that support it, this\n uses the native `Object.keys` implementation.\n\n @method keys\n @for Ember\n @param {Object} obj\n @return {Array} Array containing keys of obj\n */\n var keys = Object.keys;\n if (!keys || create.isSimulated) {\n var prototypeProperties = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n 'toLocaleString',\n 'toString'\n ],\n pushPropertyName = function(obj, array, key) {\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') return;\n if (key === '_super') return;\n if (EnumerableUtils.indexOf(array, key) >= 0) return;\n if (typeof obj.hasOwnProperty === 'function' && !obj.hasOwnProperty(key)) return;\n\n array.push(key);\n };\n\n keys = function keys(obj) {\n var ret = [], key;\n for (key in obj) {\n pushPropertyName(obj, ret, key);\n }\n\n // IE8 doesn't enumerate property that named the same as prototype properties.\n for (var i = 0, l = prototypeProperties.length; i < l; i++) {\n key = prototypeProperties[i];\n\n pushPropertyName(obj, ret, key);\n }\n\n return ret;\n };\n }\n\n __exports__[\"default\"] = keys;\n });\ndefine(\"ember-runtime\",\n [\"ember-metal\",\"ember-runtime/core\",\"ember-runtime/keys\",\"ember-runtime/compare\",\"ember-runtime/copy\",\"ember-runtime/system/namespace\",\"ember-runtime/system/object\",\"ember-runtime/system/tracked_array\",\"ember-runtime/system/subarray\",\"ember-runtime/system/container\",\"ember-runtime/system/application\",\"ember-runtime/system/array_proxy\",\"ember-runtime/system/object_proxy\",\"ember-runtime/system/core_object\",\"ember-runtime/system/each_proxy\",\"ember-runtime/system/native_array\",\"ember-runtime/system/set\",\"ember-runtime/system/string\",\"ember-runtime/system/deferred\",\"ember-runtime/system/lazy_load\",\"ember-runtime/mixins/array\",\"ember-runtime/mixins/comparable\",\"ember-runtime/mixins/copyable\",\"ember-runtime/mixins/enumerable\",\"ember-runtime/mixins/freezable\",\"ember-runtime/mixins/observable\",\"ember-runtime/mixins/action_handler\",\"ember-runtime/mixins/deferred\",\"ember-runtime/mixins/mutable_enumerable\",\"ember-runtime/mixins/mutable_array\",\"ember-runtime/mixins/target_action_support\",\"ember-runtime/mixins/evented\",\"ember-runtime/mixins/promise_proxy\",\"ember-runtime/mixins/sortable\",\"ember-runtime/computed/array_computed\",\"ember-runtime/computed/reduce_computed\",\"ember-runtime/computed/reduce_computed_macros\",\"ember-runtime/controllers/array_controller\",\"ember-runtime/controllers/object_controller\",\"ember-runtime/controllers/controller\",\"ember-runtime/ext/rsvp\",\"ember-runtime/ext/string\",\"ember-runtime/ext/function\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __dependency27__, __dependency28__, __dependency29__, __dependency30__, __dependency31__, __dependency32__, __dependency33__, __dependency34__, __dependency35__, __dependency36__, __dependency37__, __dependency38__, __dependency39__, __dependency40__, __dependency41__, __dependency42__, __dependency43__, __exports__) {\n \"use strict\";\n /**\n Ember Runtime\n\n @module ember\n @submodule ember-runtime\n @requires ember-metal\n */\n\n // BEGIN IMPORTS\n var Ember = __dependency1__[\"default\"];\n var isEqual = __dependency2__.isEqual;\n var keys = __dependency3__[\"default\"];\n var compare = __dependency4__[\"default\"];\n var copy = __dependency5__[\"default\"];\n\n var Namespace = __dependency6__[\"default\"];\n var EmberObject = __dependency7__[\"default\"];\n var TrackedArray = __dependency8__[\"default\"];\n var SubArray = __dependency9__[\"default\"];\n var Container = __dependency10__[\"default\"];\n var Application = __dependency11__[\"default\"];\n var ArrayProxy = __dependency12__[\"default\"];\n var ObjectProxy = __dependency13__[\"default\"];\n var CoreObject = __dependency14__[\"default\"];\n var EachArray = __dependency15__.EachArray;\n var EachProxy = __dependency15__.EachProxy;\n var NativeArray = __dependency16__[\"default\"];\n var Set = __dependency17__[\"default\"];\n var EmberStringUtils = __dependency18__[\"default\"];\n var Deferred = __dependency19__[\"default\"];\n var onLoad = __dependency20__.onLoad;\n var runLoadHooks = __dependency20__.runLoadHooks;\n\n var EmberArray = __dependency21__[\"default\"];\n var Comparable = __dependency22__[\"default\"];\n var Copyable = __dependency23__[\"default\"];\n var Enumerable = __dependency24__[\"default\"];\n var Freezable = __dependency25__.Freezable;\n var FROZEN_ERROR = __dependency25__.FROZEN_ERROR;\n var Observable = __dependency26__[\"default\"];\n var ActionHandler = __dependency27__[\"default\"];\n var DeferredMixin = __dependency28__[\"default\"];\n var MutableEnumerable = __dependency29__[\"default\"];\n var MutableArray = __dependency30__[\"default\"];\n var TargetActionSupport = __dependency31__[\"default\"];\n var Evented = __dependency32__[\"default\"];\n var PromiseProxyMixin = __dependency33__[\"default\"];\n var SortableMixin = __dependency34__[\"default\"];\n\n var arrayComputed = __dependency35__.arrayComputed;\n var ArrayComputedProperty = __dependency35__.ArrayComputedProperty;\n var reduceComputed = __dependency36__.reduceComputed;\n var ReduceComputedProperty = __dependency36__.ReduceComputedProperty;\n var sum = __dependency37__.sum;\n var min = __dependency37__.min;\n var max = __dependency37__.max;\n var map = __dependency37__.map;\n var sort = __dependency37__.sort;\n var setDiff = __dependency37__.setDiff;\n var mapBy = __dependency37__.mapBy;\n var mapProperty = __dependency37__.mapProperty;\n var filter = __dependency37__.filter;\n var filterBy = __dependency37__.filterBy;\n var filterProperty = __dependency37__.filterProperty;\n var uniq = __dependency37__.uniq;\n var union = __dependency37__.union;\n var intersect = __dependency37__.intersect;\n\n var ArrayController = __dependency38__[\"default\"];\n var ObjectController = __dependency39__[\"default\"];\n var Controller = __dependency40__.Controller;\n var ControllerMixin = __dependency40__.ControllerMixin;\n\n var RSVP = __dependency41__[\"default\"];\n // just for side effect of extending Ember.RSVP\n // just for side effect of extending String.prototype\n // just for side effect of extending Function.prototype\n // END IMPORTS\n\n\n // BEGIN EXPORTS\n Ember.compare = compare;\n Ember.copy = copy;\n Ember.isEqual = isEqual;\n Ember.keys = keys;\n\n Ember.Array = EmberArray;\n\n Ember.Comparable = Comparable;\n Ember.Copyable = Copyable;\n\n Ember.SortableMixin = SortableMixin;\n\n Ember.Freezable = Freezable;\n Ember.FROZEN_ERROR = FROZEN_ERROR;\n\n Ember.DeferredMixin = DeferredMixin;\n\n Ember.MutableEnumerable = MutableEnumerable;\n Ember.MutableArray = MutableArray;\n\n Ember.TargetActionSupport = TargetActionSupport;\n Ember.Evented = Evented;\n\n Ember.PromiseProxyMixin = PromiseProxyMixin;\n\n Ember.Observable = Observable;\n\n Ember.arrayComputed = arrayComputed;\n Ember.ArrayComputedProperty = ArrayComputedProperty;\n Ember.reduceComputed = reduceComputed;\n Ember.ReduceComputedProperty = ReduceComputedProperty;\n\n // ES6TODO: this seems a less than ideal way/place to add properties to Ember.computed\n var EmComputed = Ember.computed;\n\n EmComputed.sum = sum;\n EmComputed.min = min;\n EmComputed.max = max;\n EmComputed.map = map;\n EmComputed.sort = sort;\n EmComputed.setDiff = setDiff;\n EmComputed.mapBy = mapBy;\n EmComputed.mapProperty = mapProperty;\n EmComputed.filter = filter;\n EmComputed.filterBy = filterBy;\n EmComputed.filterProperty = filterProperty;\n EmComputed.uniq = uniq;\n EmComputed.union = union;\n EmComputed.intersect = intersect;\n\n Ember.String = EmberStringUtils;\n Ember.Object = EmberObject;\n Ember.TrackedArray = TrackedArray;\n Ember.SubArray = SubArray;\n Ember.Container = Container;\n Ember.Namespace = Namespace;\n Ember.Application = Application;\n Ember.Enumerable = Enumerable;\n Ember.ArrayProxy = ArrayProxy;\n Ember.ObjectProxy = ObjectProxy;\n Ember.ActionHandler = ActionHandler;\n Ember.CoreObject = CoreObject;\n Ember.EachArray = EachArray;\n Ember.EachProxy = EachProxy;\n Ember.NativeArray = NativeArray;\n // ES6TODO: Currently we must rely on the global from ember-metal/core to avoid circular deps\n // Ember.A = A;\n Ember.Set = Set;\n Ember.Deferred = Deferred;\n Ember.onLoad = onLoad;\n Ember.runLoadHooks = runLoadHooks;\n\n Ember.ArrayController = ArrayController;\n Ember.ObjectController = ObjectController;\n Ember.Controller = Controller;\n Ember.ControllerMixin = ControllerMixin;\n\n Ember.RSVP = RSVP;\n // END EXPORTS\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-runtime/mixins/action_handler\",\n [\"ember-metal/merge\",\"ember-metal/mixin\",\"ember-metal/property_get\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var merge = __dependency1__[\"default\"];\n var Mixin = __dependency2__.Mixin;\n var get = __dependency3__.get;\n var typeOf = __dependency4__.typeOf;\n\n /**\n The `Ember.ActionHandler` mixin implements support for moving an `actions`\n property to an `_actions` property at extend time, and adding `_actions`\n to the object's mergedProperties list.\n\n `Ember.ActionHandler` is available on some familiar classes including\n `Ember.Route`, `Ember.View`, `Ember.Component`, and controllers such as\n `Ember.Controller` and `Ember.ObjectController`.\n (Internally the mixin is used by `Ember.CoreView`, `Ember.ControllerMixin`,\n and `Ember.Route` and available to the above classes through\n inheritance.)\n\n @class ActionHandler\n @namespace Ember\n */\n var ActionHandler = Mixin.create({\n mergedProperties: ['_actions'],\n\n /**\n The collection of functions, keyed by name, available on this\n `ActionHandler` as action targets.\n\n These functions will be invoked when a matching `{{action}}` is triggered\n from within a template and the application's current route is this route.\n\n Actions can also be invoked from other parts of your application\n via `ActionHandler#send`.\n\n The `actions` hash will inherit action handlers from\n the `actions` hash defined on extended parent classes\n or mixins rather than just replace the entire hash, e.g.:\n\n ```js\n App.CanDisplayBanner = Ember.Mixin.create({\n actions: {\n displayBanner: function(msg) {\n // ...\n }\n }\n });\n\n App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, {\n actions: {\n playMusic: function() {\n // ...\n }\n }\n });\n\n // `WelcomeRoute`, when active, will be able to respond\n // to both actions, since the actions hash is merged rather\n // then replaced when extending mixins / parent classes.\n this.send('displayBanner');\n this.send('playMusic');\n ```\n\n Within a Controller, Route, View or Component's action handler,\n the value of the `this` context is the Controller, Route, View or\n Component object:\n\n ```js\n App.SongRoute = Ember.Route.extend({\n actions: {\n myAction: function() {\n this.controllerFor(\"song\");\n this.transitionTo(\"other.route\");\n ...\n }\n }\n });\n ```\n\n It is also possible to call `this._super()` from within an\n action handler if it overrides a handler defined on a parent\n class or mixin:\n\n Take for example the following routes:\n\n ```js\n App.DebugRoute = Ember.Mixin.create({\n actions: {\n debugRouteInformation: function() {\n console.debug(\"trololo\");\n }\n }\n });\n\n App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, {\n actions: {\n debugRouteInformation: function() {\n // also call the debugRouteInformation of mixed in App.DebugRoute\n this._super();\n\n // show additional annoyance\n window.alert(...);\n }\n }\n });\n ```\n\n ## Bubbling\n\n By default, an action will stop bubbling once a handler defined\n on the `actions` hash handles it. To continue bubbling the action,\n you must return `true` from the handler:\n\n ```js\n App.Router.map(function() {\n this.resource(\"album\", function() {\n this.route(\"song\");\n });\n });\n\n App.AlbumRoute = Ember.Route.extend({\n actions: {\n startPlaying: function() {\n }\n }\n });\n\n App.AlbumSongRoute = Ember.Route.extend({\n actions: {\n startPlaying: function() {\n // ...\n\n if (actionShouldAlsoBeTriggeredOnParentRoute) {\n return true;\n }\n }\n }\n });\n ```\n\n @property actions\n @type Hash\n @default null\n */\n\n /**\n Moves `actions` to `_actions` at extend time. Note that this currently\n modifies the mixin themselves, which is technically dubious but\n is practically of little consequence. This may change in the future.\n\n @private\n @method willMergeMixin\n */\n willMergeMixin: function(props) {\n var hashName;\n\n if (!props._actions) {\n Ember.assert(\"'actions' should not be a function\", typeof(props.actions) !== 'function');\n\n if (typeOf(props.actions) === 'object') {\n hashName = 'actions';\n } else if (typeOf(props.events) === 'object') {\n Ember.deprecate('Action handlers contained in an `events` object are deprecated in favor of putting them in an `actions` object', false);\n hashName = 'events';\n }\n\n if (hashName) {\n props._actions = merge(props._actions || {}, props[hashName]);\n }\n\n delete props[hashName];\n }\n },\n\n /**\n Triggers a named action on the `ActionHandler`. Any parameters\n supplied after the `actionName` string will be passed as arguments\n to the action target function.\n\n If the `ActionHandler` has its `target` property set, actions may\n bubble to the `target`. Bubbling happens when an `actionName` can\n not be found in the `ActionHandler`'s `actions` hash or if the\n action target function returns `true`.\n\n Example\n\n ```js\n App.WelcomeRoute = Ember.Route.extend({\n actions: {\n playTheme: function() {\n this.send('playMusic', 'theme.mp3');\n },\n playMusic: function(track) {\n // ...\n }\n }\n });\n ```\n\n @method send\n @param {String} actionName The action to trigger\n @param {*} context a context to send with the action\n */\n send: function(actionName) {\n var args = [].slice.call(arguments, 1), target;\n\n if (this._actions && this._actions[actionName]) {\n if (this._actions[actionName].apply(this, args) === true) {\n // handler returned true, so this action will bubble\n } else {\n return;\n }\n } else if (!Ember.FEATURES.isEnabled('ember-routing-drop-deprecated-action-style') && this.deprecatedSend && this.deprecatedSendHandles && this.deprecatedSendHandles(actionName)) {\n Ember.warn(\"The current default is deprecated but will prefer to handle actions directly on the controller instead of a similarly named action in the actions hash. To turn off this deprecated feature set: Ember.FEATURES['ember-routing-drop-deprecated-action-style'] = true\");\n if (this.deprecatedSend.apply(this, [].slice.call(arguments)) === true) {\n // handler return true, so this action will bubble\n } else {\n return;\n }\n }\n\n if (target = get(this, 'target')) {\n Ember.assert(\"The `target` for \" + this + \" (\" + target + \") does not have a `send` method\", typeof target.send === 'function');\n target.send.apply(target, arguments);\n }\n }\n });\n\n __exports__[\"default\"] = ActionHandler;\n });\ndefine(\"ember-runtime/mixins/array\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/computed\",\"ember-metal/is_none\",\"ember-runtime/mixins/enumerable\",\"ember-metal/enumerable_utils\",\"ember-metal/mixin\",\"ember-metal/property_events\",\"ember-metal/events\",\"ember-metal/watching\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n // ..........................................................\n // HELPERS\n //\n var Ember = __dependency1__[\"default\"];\n // ES6TODO: Ember.A\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var computed = __dependency4__.computed;\n var cacheFor = __dependency4__.cacheFor;\n var isNone = __dependency5__.isNone;\n var none = __dependency5__.none;\n var Enumerable = __dependency6__[\"default\"];\n var EnumerableUtils = __dependency7__[\"default\"];\n var Mixin = __dependency8__.Mixin;\n var required = __dependency8__.required;\n var propertyWillChange = __dependency9__.propertyWillChange;\n var propertyDidChange = __dependency9__.propertyDidChange;\n var addListener = __dependency10__.addListener;\n var removeListener = __dependency10__.removeListener;\n var sendEvent = __dependency10__.sendEvent;\n var hasListeners = __dependency10__.hasListeners;\n var isWatching = __dependency11__.isWatching;\n\n var map = EnumerableUtils.map;\n\n // ..........................................................\n // ARRAY\n //\n /**\n This mixin implements Observer-friendly Array-like behavior. It is not a\n concrete implementation, but it can be used up by other classes that want\n to appear like arrays.\n\n For example, ArrayProxy and ArrayController are both concrete classes that can\n be instantiated to implement array-like behavior. Both of these classes use\n the Array Mixin by way of the MutableArray mixin, which allows observable\n changes to be made to the underlying array.\n\n Unlike `Ember.Enumerable,` this mixin defines methods specifically for\n collections that provide index-ordered access to their contents. When you\n are designing code that needs to accept any kind of Array-like object, you\n should use these methods instead of Array primitives because these will\n properly notify observers of changes to the array.\n\n Although these methods are efficient, they do add a layer of indirection to\n your application so it is a good idea to use them only when you need the\n flexibility of using both true JavaScript arrays and \"virtual\" arrays such\n as controllers and collections.\n\n You can use the methods defined in this module to access and modify array\n contents in a KVO-friendly way. You can also be notified whenever the\n membership of an array changes by using `.observes('myArray.[]')`.\n\n To support `Ember.Array` in your own class, you must override two\n primitives to use it: `replace()` and `objectAt()`.\n\n Note that the Ember.Array mixin also incorporates the `Ember.Enumerable`\n mixin. All `Ember.Array`-like objects are also enumerable.\n\n @class Array\n @namespace Ember\n @uses Ember.Enumerable\n @since Ember 0.9.0\n */\n var EmberArray = Mixin.create(Enumerable, {\n\n /**\n Your array must support the `length` property. Your replace methods should\n set this property whenever it changes.\n\n @property {Number} length\n */\n length: required(),\n\n /**\n Returns the object at the given `index`. If the given `index` is negative\n or is greater or equal than the array length, returns `undefined`.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n If your object supports retrieving the value of an array item using `get()`\n (i.e. `myArray.get(0)`), then you do not need to implement this method\n yourself.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectAt(0); // \"a\"\n arr.objectAt(3); // \"d\"\n arr.objectAt(-1); // undefined\n arr.objectAt(4); // undefined\n arr.objectAt(5); // undefined\n ```\n\n @method objectAt\n @param {Number} idx The index of the item to return.\n @return {*} item at index or undefined\n */\n objectAt: function(idx) {\n if ((idx < 0) || (idx >= get(this, 'length'))) return undefined;\n return get(this, idx);\n },\n\n /**\n This returns the objects at the specified indexes, using `objectAt`.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectsAt([0, 1, 2]); // [\"a\", \"b\", \"c\"]\n arr.objectsAt([2, 3, 4]); // [\"c\", \"d\", undefined]\n ```\n\n @method objectsAt\n @param {Array} indexes An array of indexes of items to return.\n @return {Array}\n */\n objectsAt: function(indexes) {\n var self = this;\n return map(indexes, function(idx) { return self.objectAt(idx); });\n },\n\n // overrides Ember.Enumerable version\n nextObject: function(idx) {\n return this.objectAt(idx);\n },\n\n /**\n This is the handler for the special array content property. If you get\n this property, it will return this. If you set this property it a new\n array, it will replace the current content.\n\n This property overrides the default property defined in `Ember.Enumerable`.\n\n @property []\n @return this\n */\n '[]': computed(function(key, value) {\n if (value !== undefined) this.replace(0, get(this, 'length'), value) ;\n return this ;\n }),\n\n firstObject: computed(function() {\n return this.objectAt(0);\n }),\n\n lastObject: computed(function() {\n return this.objectAt(get(this, 'length')-1);\n }),\n\n // optimized version from Enumerable\n contains: function(obj) {\n return this.indexOf(obj) >= 0;\n },\n\n // Add any extra methods to Ember.Array that are native to the built-in Array.\n /**\n Returns a new array that is a slice of the receiver. This implementation\n uses the observable array methods to retrieve the objects for the new\n slice.\n\n ```javascript\n var arr = ['red', 'green', 'blue'];\n arr.slice(0); // ['red', 'green', 'blue']\n arr.slice(0, 2); // ['red', 'green']\n arr.slice(1, 100); // ['green', 'blue']\n ```\n\n @method slice\n @param {Integer} beginIndex (Optional) index to begin slicing from.\n @param {Integer} endIndex (Optional) index to end the slice at (but not included).\n @return {Array} New array with specified slice\n */\n slice: function(beginIndex, endIndex) {\n var ret = Ember.A();\n var length = get(this, 'length') ;\n if (isNone(beginIndex)) beginIndex = 0 ;\n if (isNone(endIndex) || (endIndex > length)) endIndex = length ;\n\n if (beginIndex < 0) beginIndex = length + beginIndex;\n if (endIndex < 0) endIndex = length + endIndex;\n\n while(beginIndex < endIndex) {\n ret[ret.length] = this.objectAt(beginIndex++) ;\n }\n return ret ;\n },\n\n /**\n Returns the index of the given object's first occurrence.\n If no `startAt` argument is given, the starting location to\n search is 0. If it's negative, will count backward from\n the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.indexOf(\"a\"); // 0\n arr.indexOf(\"z\"); // -1\n arr.indexOf(\"a\", 2); // 4\n arr.indexOf(\"a\", -1); // 4\n arr.indexOf(\"b\", 3); // -1\n arr.indexOf(\"a\", 100); // -1\n ```\n\n @method indexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n indexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined) startAt = 0;\n if (startAt < 0) startAt += len;\n\n for(idx = startAt; idx < len; idx++) {\n if (this.objectAt(idx) === object) return idx;\n }\n return -1;\n },\n\n /**\n Returns the index of the given object's last occurrence.\n If no `startAt` argument is given, the search starts from\n the last position. If it's negative, will count backward\n from the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.lastIndexOf(\"a\"); // 4\n arr.lastIndexOf(\"z\"); // -1\n arr.lastIndexOf(\"a\", 2); // 0\n arr.lastIndexOf(\"a\", -1); // 4\n arr.lastIndexOf(\"b\", 3); // 1\n arr.lastIndexOf(\"a\", 100); // 4\n ```\n\n @method lastIndexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n lastIndexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined || startAt >= len) startAt = len-1;\n if (startAt < 0) startAt += len;\n\n for(idx = startAt; idx >= 0; idx--) {\n if (this.objectAt(idx) === object) return idx;\n }\n return -1;\n },\n\n // ..........................................................\n // ARRAY OBSERVERS\n //\n\n /**\n Adds an array observer to the receiving array. The array observer object\n normally must implement two methods:\n\n * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be\n called just before the array is modified.\n * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be\n called just after the array is modified.\n\n Both callbacks will be passed the observed object, starting index of the\n change as well a a count of the items to be removed and added. You can use\n these callbacks to optionally inspect the array during the change, clear\n caches, or do any other bookkeeping necessary.\n\n In addition to passing a target, you can also include an options hash\n which you can use to override the method names that will be invoked on the\n target.\n\n @method addArrayObserver\n @param {Object} target The observer object.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n addArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (!hasObservers) propertyWillChange(this, 'hasArrayObservers');\n addListener(this, '@array:before', target, willChange);\n addListener(this, '@array:change', target, didChange);\n if (!hasObservers) propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Removes an array observer from the object if the observer is current\n registered. Calling this method multiple times with the same object will\n have no effect.\n\n @method removeArrayObserver\n @param {Object} target The object observing the array.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n removeArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (hasObservers) propertyWillChange(this, 'hasArrayObservers');\n removeListener(this, '@array:before', target, willChange);\n removeListener(this, '@array:change', target, didChange);\n if (hasObservers) propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property {Boolean} hasArrayObservers\n */\n hasArrayObservers: computed(function() {\n return hasListeners(this, '@array:change') || hasListeners(this, '@array:before');\n }),\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just before the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentWillChange\n @param {Number} startIdx The starting index in the array that will change.\n @param {Number} removeAmt The number of items that will be removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that will be added. If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentWillChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n // Make sure the @each proxy is set up if anyone is observing @each\n if (isWatching(this, '@each')) { get(this, '@each'); }\n\n sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);\n\n var removing, lim;\n if (startIdx>=0 && removeAmt>=0 && get(this, 'hasEnumerableObservers')) {\n removing = [];\n lim = startIdx+removeAmt;\n for(var idx=startIdx;idx<lim;idx++) removing.push(this.objectAt(idx));\n } else {\n removing = removeAmt;\n }\n\n this.enumerableContentWillChange(removing, addAmt);\n\n return this;\n },\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just after the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentDidChange\n @param {Number} startIdx The starting index in the array that did change.\n @param {Number} removeAmt The number of items that were removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that were added. If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentDidChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n var adding, lim;\n if (startIdx>=0 && addAmt>=0 && get(this, 'hasEnumerableObservers')) {\n adding = [];\n lim = startIdx+addAmt;\n for(var idx=startIdx;idx<lim;idx++) adding.push(this.objectAt(idx));\n } else {\n adding = addAmt;\n }\n\n this.enumerableContentDidChange(removeAmt, adding);\n sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]);\n\n var length = get(this, 'length'),\n cachedFirst = cacheFor(this, 'firstObject'),\n cachedLast = cacheFor(this, 'lastObject');\n if (this.objectAt(0) !== cachedFirst) {\n propertyWillChange(this, 'firstObject');\n propertyDidChange(this, 'firstObject');\n }\n if (this.objectAt(length-1) !== cachedLast) {\n propertyWillChange(this, 'lastObject');\n propertyDidChange(this, 'lastObject');\n }\n\n return this;\n },\n\n // ..........................................................\n // ENUMERATED PROPERTIES\n //\n\n /**\n Returns a special object that can be used to observe individual properties\n on the array. Just get an equivalent property on this object and it will\n return an enumerable that maps automatically to the named key on the\n member objects.\n\n If you merely want to watch for any items being added or removed to the array,\n use the `[]` property instead of `@each`.\n\n @property @each\n */\n '@each': computed(function() {\n if (!this.__each) {\n // ES6TODO: GRRRRR\n var EachProxy = requireModule('ember-runtime/system/each_proxy')['EachProxy'];\n\n this.__each = new EachProxy(this);\n }\n\n return this.__each;\n })\n\n });\n\n __exports__[\"default\"] = EmberArray;\n });\ndefine(\"ember-runtime/mixins/comparable\",\n [\"ember-metal/mixin\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Mixin = __dependency1__.Mixin;\n var required = __dependency1__.required;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n\n /**\n Implements some standard methods for comparing objects. Add this mixin to\n any class you create that can compare its instances.\n\n You should implement the `compare()` method.\n\n @class Comparable\n @namespace Ember\n @since Ember 0.9\n */\n var Comparable = Mixin.create({\n\n /**\n Override to return the result of the comparison of the two parameters. The\n compare method should return:\n\n - `-1` if `a < b`\n - `0` if `a == b`\n - `1` if `a > b`\n\n Default implementation raises an exception.\n\n @method compare\n @param a {Object} the first object to compare\n @param b {Object} the second object to compare\n @return {Integer} the result of the comparison\n */\n compare: required(Function)\n\n });\n\n __exports__[\"default\"] = Comparable;\n });\ndefine(\"ember-runtime/mixins/copyable\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/mixin\",\"ember-runtime/mixins/freezable\",\"ember-runtime/system/string\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var required = __dependency3__.required;\n var Freezable = __dependency4__.Freezable;\n var Mixin = __dependency3__.Mixin;\n var fmt = __dependency5__.fmt;\n var EmberError = __dependency6__[\"default\"];\n\n\n /**\n Implements some standard methods for copying an object. Add this mixin to\n any object you create that can create a copy of itself. This mixin is\n added automatically to the built-in array.\n\n You should generally implement the `copy()` method to return a copy of the\n receiver.\n\n Note that `frozenCopy()` will only work if you also implement\n `Ember.Freezable`.\n\n @class Copyable\n @namespace Ember\n @since Ember 0.9\n */\n var Copyable = Mixin.create({\n\n /**\n Override to return a copy of the receiver. Default implementation raises\n an exception.\n\n @method copy\n @param {Boolean} deep if `true`, a deep copy of the object should be made\n @return {Object} copy of receiver\n */\n copy: required(Function),\n\n /**\n If the object implements `Ember.Freezable`, then this will return a new\n copy if the object is not frozen and the receiver if the object is frozen.\n\n Raises an exception if you try to call this method on a object that does\n not support freezing.\n\n You should use this method whenever you want a copy of a freezable object\n since a freezable object can simply return itself without actually\n consuming more memory.\n\n @method frozenCopy\n @return {Object} copy of receiver or receiver\n */\n frozenCopy: function() {\n if (Freezable && Freezable.detect(this)) {\n return get(this, 'isFrozen') ? this : this.copy().freeze();\n } else {\n throw new EmberError(fmt(\"%@ does not support freezing\", [this]));\n }\n }\n });\n\n __exports__[\"default\"] = Copyable;\n });\ndefine(\"ember-runtime/mixins/deferred\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/mixin\",\"ember-metal/computed\",\"ember-metal/run_loop\",\"ember-runtime/ext/rsvp\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.FEATURES, Ember.Test\n var get = __dependency2__.get;\n var Mixin = __dependency3__.Mixin;\n var computed = __dependency4__.computed;\n var run = __dependency5__[\"default\"];\n var RSVP = __dependency6__[\"default\"];\n\n var asyncStart = function() {\n if (Ember.Test && Ember.Test.adapter) {\n Ember.Test.adapter.asyncStart();\n }\n };\n\n var asyncEnd = function() {\n if (Ember.Test && Ember.Test.adapter) {\n Ember.Test.adapter.asyncEnd();\n }\n };\n\n RSVP.configure('async', function(callback, promise) {\n var async = !run.currentRunLoop;\n\n if (Ember.testing && async) { asyncStart(); }\n\n run.backburner.schedule('actions', function(){\n if (Ember.testing && async) { asyncEnd(); }\n callback(promise);\n });\n });\n\n RSVP.Promise.prototype.fail = function(callback, label){\n Ember.deprecate('RSVP.Promise.fail has been renamed as RSVP.Promise.catch');\n return this['catch'](callback, label);\n };\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n\n /**\n @class Deferred\n @namespace Ember\n */\n var DeferredMixin = Mixin.create({\n /**\n Add handlers to be called when the Deferred object is resolved or rejected.\n\n @method then\n @param {Function} resolve a callback function to be called when done\n @param {Function} reject a callback function to be called when failed\n */\n then: function(resolve, reject, label) {\n var deferred, promise, entity;\n\n entity = this;\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n function fulfillmentHandler(fulfillment) {\n if (fulfillment === promise) {\n return resolve(entity);\n } else {\n return resolve(fulfillment);\n }\n }\n\n return promise.then(resolve && fulfillmentHandler, reject, label);\n },\n\n /**\n Resolve a Deferred object and call any `doneCallbacks` with the given args.\n\n @method resolve\n */\n resolve: function(value) {\n var deferred, promise;\n\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n if (value === this) {\n deferred.resolve(promise);\n } else {\n deferred.resolve(value);\n }\n },\n\n /**\n Reject a Deferred object and call any `failCallbacks` with the given args.\n\n @method reject\n */\n reject: function(value) {\n get(this, '_deferred').reject(value);\n },\n\n _deferred: computed(function() {\n return RSVP.defer('Ember: DeferredMixin - ' + this);\n })\n });\n\n __exports__[\"default\"] = DeferredMixin;\n });\ndefine(\"ember-runtime/mixins/enumerable\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/mixin\",\"ember-metal/enumerable_utils\",\"ember-metal/computed\",\"ember-metal/property_events\",\"ember-metal/events\",\"ember-runtime/compare\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n // ..........................................................\n // HELPERS\n //\n\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var apply = __dependency4__.apply;\n var Mixin = __dependency5__.Mixin;\n var required = __dependency5__.required;\n var aliasMethod = __dependency5__.aliasMethod;\n var EnumerableUtils = __dependency6__[\"default\"];\n var computed = __dependency7__.computed;\n var propertyWillChange = __dependency8__.propertyWillChange;\n var propertyDidChange = __dependency8__.propertyDidChange;\n var addListener = __dependency9__.addListener;\n var removeListener = __dependency9__.removeListener;\n var sendEvent = __dependency9__.sendEvent;\n var hasListeners = __dependency9__.hasListeners;\n var compare = __dependency10__[\"default\"];\n\n var a_slice = Array.prototype.slice;\n var a_indexOf = EnumerableUtils.indexOf;\n\n var contexts = [];\n\n function popCtx() {\n return contexts.length===0 ? {} : contexts.pop();\n }\n\n function pushCtx(ctx) {\n contexts.push(ctx);\n return null;\n }\n\n function iter(key, value) {\n var valueProvided = arguments.length === 2;\n\n function i(item) {\n var cur = get(item, key);\n return valueProvided ? value===cur : !!cur;\n }\n return i ;\n }\n\n /**\n This mixin defines the common interface implemented by enumerable objects\n in Ember. Most of these methods follow the standard Array iteration\n API defined up to JavaScript 1.8 (excluding language-specific features that\n cannot be emulated in older versions of JavaScript).\n\n This mixin is applied automatically to the Array class on page load, so you\n can use any of these methods on simple arrays. If Array already implements\n one of these methods, the mixin will not override them.\n\n ## Writing Your Own Enumerable\n\n To make your own custom class enumerable, you need two items:\n\n 1. You must have a length property. This property should change whenever\n the number of items in your enumerable object changes. If you use this\n with an `Ember.Object` subclass, you should be sure to change the length\n property using `set().`\n\n 2. You must implement `nextObject().` See documentation.\n\n Once you have these two methods implemented, apply the `Ember.Enumerable` mixin\n to your class and you will be able to enumerate the contents of your object\n like any other collection.\n\n ## Using Ember Enumeration with Other Libraries\n\n Many other libraries provide some kind of iterator or enumeration like\n facility. This is often where the most common API conflicts occur.\n Ember's API is designed to be as friendly as possible with other\n libraries by implementing only methods that mostly correspond to the\n JavaScript 1.8 API.\n\n @class Enumerable\n @namespace Ember\n @since Ember 0.9\n */\n var Enumerable = Mixin.create({\n\n /**\n Implement this method to make your class enumerable.\n\n This method will be call repeatedly during enumeration. The index value\n will always begin with 0 and increment monotonically. You don't have to\n rely on the index value to determine what object to return, but you should\n always check the value and start from the beginning when you see the\n requested index is 0.\n\n The `previousObject` is the object that was returned from the last call\n to `nextObject` for the current iteration. This is a useful way to\n manage iteration if you are tracing a linked list, for example.\n\n Finally the context parameter will always contain a hash you can use as\n a \"scratchpad\" to maintain any other state you need in order to iterate\n properly. The context object is reused and is not reset between\n iterations so make sure you setup the context with a fresh state whenever\n the index parameter is 0.\n\n Generally iterators will continue to call `nextObject` until the index\n reaches the your current length-1. If you run out of data before this\n time for some reason, you should simply return undefined.\n\n The default implementation of this method simply looks up the index.\n This works great on any Array-like objects.\n\n @method nextObject\n @param {Number} index the current index of the iteration\n @param {Object} previousObject the value returned by the last call to\n `nextObject`.\n @param {Object} context a context object you can use to maintain state.\n @return {Object} the next object in the iteration or undefined\n */\n nextObject: required(Function),\n\n /**\n Helper method returns the first object from a collection. This is usually\n used by bindings and other parts of the framework to extract a single\n object if the enumerable contains only one item.\n\n If you override this method, you should implement it so that it will\n always return the same value each time it is called. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('firstObject'); // \"a\"\n\n var arr = [];\n arr.get('firstObject'); // undefined\n ```\n\n @property firstObject\n @return {Object} the object or undefined\n */\n firstObject: computed(function() {\n if (get(this, 'length')===0) return undefined ;\n\n // handle generic enumerables\n var context = popCtx(), ret;\n ret = this.nextObject(0, null, context);\n pushCtx(context);\n return ret ;\n }).property('[]'),\n\n /**\n Helper method returns the last object from a collection. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('lastObject'); // \"c\"\n\n var arr = [];\n arr.get('lastObject'); // undefined\n ```\n\n @property lastObject\n @return {Object} the last object or undefined\n */\n lastObject: computed(function() {\n var len = get(this, 'length');\n if (len===0) return undefined ;\n var context = popCtx(), idx=0, cur, last = null;\n do {\n last = cur;\n cur = this.nextObject(idx++, last, context);\n } while (cur !== undefined);\n pushCtx(context);\n return last;\n }).property('[]'),\n\n /**\n Returns `true` if the passed object can be found in the receiver. The\n default version will iterate through the enumerable until the object\n is found. You may want to override this with a more efficient version.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.contains(\"a\"); // true\n arr.contains(\"z\"); // false\n ```\n\n @method contains\n @param {Object} obj The object to search for.\n @return {Boolean} `true` if object is found in enumerable.\n */\n contains: function(obj) {\n return this.find(function(item) { return item===obj; }) !== undefined;\n },\n\n /**\n Iterates through the enumerable, calling the passed function on each\n item. This method corresponds to the `forEach()` method defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method forEach\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} receiver\n */\n forEach: function(callback, target) {\n if (typeof callback !== \"function\") throw new TypeError() ;\n var len = get(this, 'length'), last = null, context = popCtx();\n\n if (target === undefined) target = null;\n\n for(var idx=0;idx<len;idx++) {\n var next = this.nextObject(idx, last, context) ;\n callback.call(target, next, idx, this);\n last = next ;\n }\n last = null ;\n context = pushCtx(context);\n return this ;\n },\n\n /**\n Alias for `mapBy`\n\n @method getEach\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n getEach: function(key) {\n return this.mapBy(key);\n },\n\n /**\n Sets the value on the named property for each member. This is more\n efficient than using other methods defined on this helper. If the object\n implements Ember.Observable, the value will be changed to `set(),` otherwise\n it will be set directly. `null` objects are skipped.\n\n @method setEach\n @param {String} key The key to set\n @param {Object} value The object to set\n @return {Object} receiver\n */\n setEach: function(key, value) {\n return this.forEach(function(item) {\n set(item, key, value);\n });\n },\n\n /**\n Maps all of the items in the enumeration to another value, returning\n a new array. This method corresponds to `map()` defined in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the mapped value.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method map\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} The mapped array.\n */\n map: function(callback, target) {\n var ret = Ember.A();\n this.forEach(function(x, idx, i) {\n ret[idx] = callback.call(target, x, idx,i);\n });\n return ret ;\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapBy\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n mapBy: function(key) {\n return this.map(function(next) {\n return get(next, key);\n });\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapProperty\n @param {String} key name of the property\n @return {Array} The mapped array.\n @deprecated Use `mapBy` instead\n */\n\n mapProperty: aliasMethod('mapBy'),\n\n /**\n Returns an array with all of the items in the enumeration that the passed\n function returns true for. This method corresponds to `filter()` defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method filter\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A filtered array.\n */\n filter: function(callback, target) {\n var ret = Ember.A();\n this.forEach(function(x, idx, i) {\n if (callback.call(target, x, idx, i)) ret.push(x);\n });\n return ret ;\n },\n\n /**\n Returns an array with all of the items in the enumeration where the passed\n function returns false for. This method is the inverse of filter().\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - *item* is the current item in the iteration.\n - *index* is the current index in the iteration\n - *enumerable* is the enumerable object itself.\n\n It should return the a falsey value to include the item in the results.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as \"this\" on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method reject\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A rejected array.\n */\n reject: function(callback, target) {\n return this.filter(function() {\n return !(apply(target, callback, arguments));\n });\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterBy\n @param {String} key the property to test\n @param {*} [value] optional value to test against.\n @return {Array} filtered array\n */\n filterBy: function(key, value) {\n return this.filter(apply(this, iter, arguments));\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} filtered array\n @deprecated Use `filterBy` instead\n */\n filterProperty: aliasMethod('filterBy'),\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n */\n rejectBy: function(key, value) {\n var exactValue = function(item) { return get(item, key) === value; },\n hasValue = function(item) { return !!get(item, key); },\n use = (arguments.length === 2 ? exactValue : hasValue);\n\n return this.reject(use);\n },\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n @deprecated Use `rejectBy` instead\n */\n rejectProperty: aliasMethod('rejectBy'),\n\n /**\n Returns the first item in the array for which the callback returns true.\n This method works similar to the `filter()` method defined in JavaScript 1.6\n except that it will stop working on the array once a match is found.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method find\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} Found item or `undefined`.\n */\n find: function(callback, target) {\n var len = get(this, 'length') ;\n if (target === undefined) target = null;\n\n var last = null, next, found = false, ret ;\n var context = popCtx();\n for(var idx=0;idx<len && !found;idx++) {\n next = this.nextObject(idx, last, context) ;\n if (found = callback.call(target, next, idx, this)) ret = next ;\n last = next ;\n }\n next = last = null ;\n context = pushCtx(context);\n return ret ;\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n */\n findBy: function(key, value) {\n return this.find(apply(this, iter, arguments));\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n @deprecated Use `findBy` instead\n */\n findProperty: aliasMethod('findBy'),\n\n /**\n Returns `true` if the passed function returns true for every item in the\n enumeration. This corresponds with the `every()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` or `false`.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Example Usage:\n\n ```javascript\n if (people.every(isEngineer)) { Paychecks.addBigBonus(); }\n ```\n\n @method every\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean}\n */\n every: function(callback, target) {\n return !this.find(function(x, idx, i) {\n return !callback.call(target, x, idx, i);\n });\n },\n\n /**\n @method everyBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @deprecated Use `isEvery` instead\n @return {Boolean}\n */\n everyBy: aliasMethod('isEvery'),\n\n /**\n @method everyProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @deprecated Use `isEvery` instead\n @return {Boolean}\n */\n everyProperty: aliasMethod('isEvery'),\n\n /**\n Returns `true` if the passed property resolves to `true` for all items in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method isEvery\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean}\n @since 1.3.0\n */\n isEvery: function(key, value) {\n return this.every(apply(this, iter, arguments));\n },\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.any(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method any\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean} `true` if the passed function returns `true` for any item\n */\n any: function(callback, target) {\n var len = get(this, 'length'),\n context = popCtx(),\n found = false,\n last = null,\n next, idx;\n\n if (target === undefined) { target = null; }\n\n for (idx = 0; idx < len && !found; idx++) {\n next = this.nextObject(idx, last, context);\n found = callback.call(target, next, idx, this);\n last = next;\n }\n\n next = last = null;\n context = pushCtx(context);\n return found;\n },\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.some(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method some\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `any` instead\n */\n some: aliasMethod('any'),\n\n /**\n Returns `true` if the passed property resolves to `true` for any item in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method isAny\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n @since 1.3.0\n */\n isAny: function(key, value) {\n return this.any(apply(this, iter, arguments));\n },\n\n /**\n @method anyBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `isAny` instead\n */\n anyBy: aliasMethod('isAny'),\n\n /**\n @method someProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `isAny` instead\n */\n someProperty: aliasMethod('isAny'),\n\n /**\n This will combine the values of the enumerator into a single value. It\n is a useful way to collect a summary value from an enumeration. This\n corresponds to the `reduce()` method defined in JavaScript 1.8.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(previousValue, item, index, enumerable);\n ```\n\n - `previousValue` is the value returned by the last call to the iterator.\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Return the new cumulative value.\n\n In addition to the callback you can also pass an `initialValue`. An error\n will be raised if you do not pass an initial value and the enumerator is\n empty.\n\n Note that unlike the other methods, this method does not allow you to\n pass a target object to set as this for the callback. It's part of the\n spec. Sorry.\n\n @method reduce\n @param {Function} callback The callback to execute\n @param {Object} initialValue Initial value for the reduce\n @param {String} reducerProperty internal use only.\n @return {Object} The reduced value.\n */\n reduce: function(callback, initialValue, reducerProperty) {\n if (typeof callback !== \"function\") { throw new TypeError(); }\n\n var ret = initialValue;\n\n this.forEach(function(item, i) {\n ret = callback(ret, item, i, this, reducerProperty);\n }, this);\n\n return ret;\n },\n\n /**\n Invokes the named method on every object in the receiver that\n implements it. This method corresponds to the implementation in\n Prototype 1.6.\n\n @method invoke\n @param {String} methodName the name of the method\n @param {Object...} args optional arguments to pass as well.\n @return {Array} return values from calling invoke.\n */\n invoke: function(methodName) {\n var args, ret = Ember.A();\n if (arguments.length>1) args = a_slice.call(arguments, 1);\n\n this.forEach(function(x, idx) {\n var method = x && x[methodName];\n if ('function' === typeof method) {\n ret[idx] = args ? apply(x, method, args) : x[methodName]();\n }\n }, this);\n\n return ret;\n },\n\n /**\n Simply converts the enumerable into a genuine array. The order is not\n guaranteed. Corresponds to the method implemented by Prototype.\n\n @method toArray\n @return {Array} the enumerable as an array.\n */\n toArray: function() {\n var ret = Ember.A();\n this.forEach(function(o, idx) { ret[idx] = o; });\n return ret;\n },\n\n /**\n Returns a copy of the array with all null and undefined elements removed.\n\n ```javascript\n var arr = [\"a\", null, \"c\", undefined];\n arr.compact(); // [\"a\", \"c\"]\n ```\n\n @method compact\n @return {Array} the array without null and undefined elements.\n */\n compact: function() {\n return this.filter(function(value) { return value != null; });\n },\n\n /**\n Returns a new enumerable that excludes the passed value. The default\n implementation returns an array regardless of the receiver type unless\n the receiver does not contain the value.\n\n ```javascript\n var arr = [\"a\", \"b\", \"a\", \"c\"];\n arr.without(\"a\"); // [\"b\", \"c\"]\n ```\n\n @method without\n @param {Object} value\n @return {Ember.Enumerable}\n */\n without: function(value) {\n if (!this.contains(value)) return this; // nothing to do\n var ret = Ember.A();\n this.forEach(function(k) {\n if (k !== value) ret[ret.length] = k;\n }) ;\n return ret ;\n },\n\n /**\n Returns a new enumerable that contains only unique values. The default\n implementation returns an array regardless of the receiver type.\n\n ```javascript\n var arr = [\"a\", \"a\", \"b\", \"b\"];\n arr.uniq(); // [\"a\", \"b\"]\n ```\n\n @method uniq\n @return {Ember.Enumerable}\n */\n uniq: function() {\n var ret = Ember.A();\n this.forEach(function(k) {\n if (a_indexOf(ret, k)<0) ret.push(k);\n });\n return ret;\n },\n\n /**\n This property will trigger anytime the enumerable's content changes.\n You can observe this property to be notified of changes to the enumerables\n content.\n\n For plain enumerables, this property is read only. `Array` overrides\n this method.\n\n @property []\n @type Array\n @return this\n */\n '[]': computed(function(key, value) {\n return this;\n }),\n\n // ..........................................................\n // ENUMERABLE OBSERVERS\n //\n\n /**\n Registers an enumerable observer. Must implement `Ember.EnumerableObserver`\n mixin.\n\n @method addEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n addEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (!hasObservers) propertyWillChange(this, 'hasEnumerableObservers');\n addListener(this, '@enumerable:before', target, willChange);\n addListener(this, '@enumerable:change', target, didChange);\n if (!hasObservers) propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Removes a registered enumerable observer.\n\n @method removeEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n removeEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (hasObservers) propertyWillChange(this, 'hasEnumerableObservers');\n removeListener(this, '@enumerable:before', target, willChange);\n removeListener(this, '@enumerable:change', target, didChange);\n if (hasObservers) propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property hasEnumerableObservers\n @type Boolean\n */\n hasEnumerableObservers: computed(function() {\n return hasListeners(this, '@enumerable:change') || hasListeners(this, '@enumerable:before');\n }),\n\n\n /**\n Invoke this method just before the contents of your enumerable will\n change. You can either omit the parameters completely or pass the objects\n to be removed or added if available or just a count.\n\n @method enumerableContentWillChange\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to be\n added or the number of items to be added.\n @chainable\n */\n enumerableContentWillChange: function(removing, adding) {\n\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding,'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n propertyWillChange(this, '[]');\n if (hasDelta) propertyWillChange(this, 'length');\n sendEvent(this, '@enumerable:before', [this, removing, adding]);\n\n return this;\n },\n\n /**\n Invoke this method when the contents of your enumerable has changed.\n This will notify any observers watching for content changes. If your are\n implementing an ordered enumerable (such as an array), also pass the\n start and end values where the content changed so that it can be used to\n notify range observers.\n\n @method enumerableContentDidChange\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to\n be added or the number of items to be added.\n @chainable\n */\n enumerableContentDidChange: function(removing, adding) {\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding, 'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n sendEvent(this, '@enumerable:change', [this, removing, adding]);\n if (hasDelta) propertyDidChange(this, 'length');\n propertyDidChange(this, '[]');\n\n return this ;\n },\n\n /**\n Converts the enumerable into an array and sorts by the keys\n specified in the argument.\n\n You may provide multiple arguments to sort by multiple properties.\n\n @method sortBy\n @param {String} property name(s) to sort on\n @return {Array} The sorted array.\n @since 1.2.0\n */\n sortBy: function() {\n var sortKeys = arguments;\n return this.toArray().sort(function(a, b){\n for(var i = 0; i < sortKeys.length; i++) {\n var key = sortKeys[i],\n propA = get(a, key),\n propB = get(b, key);\n // return 1 or -1 else continue to the next sortKey\n var compareValue = compare(propA, propB);\n if (compareValue) { return compareValue; }\n }\n return 0;\n });\n }\n });\n\n __exports__[\"default\"] = Enumerable;\n });\ndefine(\"ember-runtime/mixins/evented\",\n [\"ember-metal/mixin\",\"ember-metal/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Mixin = __dependency1__.Mixin;\n var addListener = __dependency2__.addListener;\n var removeListener = __dependency2__.removeListener;\n var hasListeners = __dependency2__.hasListeners;\n var sendEvent = __dependency2__.sendEvent;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n /**\n This mixin allows for Ember objects to subscribe to and emit events.\n\n ```javascript\n App.Person = Ember.Object.extend(Ember.Evented, {\n greet: function() {\n // ...\n this.trigger('greet');\n }\n });\n\n var person = App.Person.create();\n\n person.on('greet', function() {\n console.log('Our person has greeted');\n });\n\n person.greet();\n\n // outputs: 'Our person has greeted'\n ```\n\n You can also chain multiple event subscriptions:\n\n ```javascript\n person.on('greet', function() {\n console.log('Our person has greeted');\n }).one('greet', function() {\n console.log('Offer one-time special');\n }).off('event', this, forgetThis);\n ```\n\n @class Evented\n @namespace Ember\n */\n var Evented = Mixin.create({\n\n /**\n Subscribes to a named event with given function.\n\n ```javascript\n person.on('didLoad', function() {\n // fired once the person has loaded\n });\n ```\n\n An optional target can be passed in as the 2nd argument that will\n be set as the \"this\" for the callback. This is a good way to give your\n function access to the object triggering the event. When the target\n parameter is used the callback becomes the third argument.\n\n @method on\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n on: function(name, target, method) {\n addListener(this, name, target, method);\n return this;\n },\n\n /**\n Subscribes a function to a named event and then cancels the subscription\n after the first time the event is triggered. It is good to use ``one`` when\n you only care about the first time an event has taken place.\n\n This function takes an optional 2nd argument that will become the \"this\"\n value for the callback. If this argument is passed then the 3rd argument\n becomes the function.\n\n @method one\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n one: function(name, target, method) {\n if (!method) {\n method = target;\n target = null;\n }\n\n addListener(this, name, target, method, true);\n return this;\n },\n\n /**\n Triggers a named event for the object. Any additional arguments\n will be passed as parameters to the functions that are subscribed to the\n event.\n\n ```javascript\n person.on('didEat', function(food) {\n console.log('person ate some ' + food);\n });\n\n person.trigger('didEat', 'broccoli');\n\n // outputs: person ate some broccoli\n ```\n @method trigger\n @param {String} name The name of the event\n @param {Object...} args Optional arguments to pass on\n */\n trigger: function(name) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n sendEvent(this, name, args);\n },\n\n /**\n Cancels subscription for given name, target, and method.\n\n @method off\n @param {String} name The name of the event\n @param {Object} target The target of the subscription\n @param {Function} method The function of the subscription\n @return this\n */\n off: function(name, target, method) {\n removeListener(this, name, target, method);\n return this;\n },\n\n /**\n Checks to see if object has any subscriptions for named event.\n\n @method has\n @param {String} name The name of the event\n @return {Boolean} does the object have a subscription for event\n */\n has: function(name) {\n return hasListeners(this, name);\n }\n });\n\n __exports__[\"default\"] = Evented;\n });\ndefine(\"ember-runtime/mixins/freezable\",\n [\"ember-metal/mixin\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Mixin = __dependency1__.Mixin;\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n\n /**\n The `Ember.Freezable` mixin implements some basic methods for marking an\n object as frozen. Once an object is frozen it should be read only. No changes\n may be made the internal state of the object.\n\n ## Enforcement\n\n To fully support freezing in your subclass, you must include this mixin and\n override any method that might alter any property on the object to instead\n raise an exception. You can check the state of an object by checking the\n `isFrozen` property.\n\n Although future versions of JavaScript may support language-level freezing\n object objects, that is not the case today. Even if an object is freezable,\n it is still technically possible to modify the object, even though it could\n break other parts of your application that do not expect a frozen object to\n change. It is, therefore, very important that you always respect the\n `isFrozen` property on all freezable objects.\n\n ## Example Usage\n\n The example below shows a simple object that implement the `Ember.Freezable`\n protocol.\n\n ```javascript\n Contact = Ember.Object.extend(Ember.Freezable, {\n firstName: null,\n lastName: null,\n\n // swaps the names\n swapNames: function() {\n if (this.get('isFrozen')) throw Ember.FROZEN_ERROR;\n var tmp = this.get('firstName');\n this.set('firstName', this.get('lastName'));\n this.set('lastName', tmp);\n return this;\n }\n\n });\n\n c = Contact.create({ firstName: \"John\", lastName: \"Doe\" });\n c.swapNames(); // returns c\n c.freeze();\n c.swapNames(); // EXCEPTION\n ```\n\n ## Copying\n\n Usually the `Ember.Freezable` protocol is implemented in cooperation with the\n `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will\n return a frozen object, if the object implements this method as well.\n\n @class Freezable\n @namespace Ember\n @since Ember 0.9\n */\n var Freezable = Mixin.create({\n\n /**\n Set to `true` when the object is frozen. Use this property to detect\n whether your object is frozen or not.\n\n @property isFrozen\n @type Boolean\n */\n isFrozen: false,\n\n /**\n Freezes the object. Once this method has been called the object should\n no longer allow any properties to be edited.\n\n @method freeze\n @return {Object} receiver\n */\n freeze: function() {\n if (get(this, 'isFrozen')) return this;\n set(this, 'isFrozen', true);\n return this;\n }\n\n });\n\n var FROZEN_ERROR = \"Frozen object cannot be modified.\";\n\n __exports__.Freezable = Freezable;\n __exports__.FROZEN_ERROR = FROZEN_ERROR;\n });\ndefine(\"ember-runtime/mixins/mutable_array\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/error\",\"ember-metal/mixin\",\"ember-runtime/mixins/array\",\"ember-runtime/mixins/mutable_enumerable\",\"ember-runtime/mixins/enumerable\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n\n // require('ember-runtime/mixins/array');\n // require('ember-runtime/mixins/mutable_enumerable');\n\n // ..........................................................\n // CONSTANTS\n //\n\n var OUT_OF_RANGE_EXCEPTION = \"Index out of range\";\n var EMPTY = [];\n\n // ..........................................................\n // HELPERS\n //\n\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var isArray = __dependency3__.isArray;\n var EmberError = __dependency4__[\"default\"];\n var Mixin = __dependency5__.Mixin;\n var required = __dependency5__.required;\n var EmberArray = __dependency6__[\"default\"];\n var MutableEnumerable = __dependency7__[\"default\"];\n var Enumerable = __dependency8__[\"default\"];\n /**\n This mixin defines the API for modifying array-like objects. These methods\n can be applied only to a collection that keeps its items in an ordered set.\n It builds upon the Array mixin and adds methods to modify the array.\n Concrete implementations of this class include ArrayProxy and ArrayController.\n\n It is important to use the methods in this class to modify arrays so that\n changes are observable. This allows the binding system in Ember to function\n correctly.\n\n\n Note that an Array can change even if it does not implement this mixin.\n For example, one might implement a SparseArray that cannot be directly\n modified, but if its underlying enumerable changes, it will change also.\n\n @class MutableArray\n @namespace Ember\n @uses Ember.Array\n @uses Ember.MutableEnumerable\n */\n var MutableArray = Mixin.create(EmberArray, MutableEnumerable, {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n You should replace amt objects started at idx with the objects in the\n passed array. You should also call `this.enumerableContentDidChange()`\n\n @method replace\n @param {Number} idx Starting index in the array to replace. If\n idx >= length, then append to the end of the array.\n @param {Number} amt Number of elements that should be removed from\n the array, starting at *idx*.\n @param {Array} objects An array of zero or more objects that should be\n inserted into the array at *idx*\n */\n replace: required(),\n\n /**\n Remove all elements from the array. This is useful if you\n want to reuse an existing array without having to recreate it.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n color.length(); // 3\n colors.clear(); // []\n colors.length(); // 0\n ```\n\n @method clear\n @return {Ember.Array} An empty Array.\n */\n clear: function () {\n var len = get(this, 'length');\n if (len === 0) return this;\n this.replace(0, len, EMPTY);\n return this;\n },\n\n /**\n This will use the primitive `replace()` method to insert an object at the\n specified index.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.insertAt(2, \"yellow\"); // [\"red\", \"green\", \"yellow\", \"blue\"]\n colors.insertAt(5, \"orange\"); // Error: Index out of range\n ```\n\n @method insertAt\n @param {Number} idx index of insert the object at.\n @param {Object} object object to insert\n @return {Ember.Array} receiver\n */\n insertAt: function(idx, object) {\n if (idx > get(this, 'length')) throw new EmberError(OUT_OF_RANGE_EXCEPTION);\n this.replace(idx, 0, [object]);\n return this;\n },\n\n /**\n Remove an object at the specified index using the `replace()` primitive\n method. You can pass either a single index, or a start and a length.\n\n If you pass a start and length that is beyond the\n length this method will throw an `OUT_OF_RANGE_EXCEPTION`.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\", \"yellow\", \"orange\"];\n colors.removeAt(0); // [\"green\", \"blue\", \"yellow\", \"orange\"]\n colors.removeAt(2, 2); // [\"green\", \"blue\"]\n colors.removeAt(4, 2); // Error: Index out of range\n ```\n\n @method removeAt\n @param {Number} start index, start of range\n @param {Number} len length of passing range\n @return {Ember.Array} receiver\n */\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new EmberError(OUT_OF_RANGE_EXCEPTION);\n }\n\n // fast case\n if (len === undefined) len = 1;\n this.replace(start, len, EMPTY);\n }\n\n return this;\n },\n\n /**\n Push the object onto the end of the array. Works just like `push()` but it\n is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\"];\n colors.pushObject(\"black\"); // [\"red\", \"green\", \"black\"]\n colors.pushObject([\"yellow\"]); // [\"red\", \"green\", [\"yellow\"]]\n ```\n\n @method pushObject\n @param {*} obj object to push\n @return object same object passed as a param\n */\n pushObject: function(obj) {\n this.insertAt(get(this, 'length'), obj);\n return obj;\n },\n\n /**\n Add the objects in the passed numerable to the end of the array. Defers\n notifying observers of the change until all objects are added.\n\n ```javascript\n var colors = [\"red\"];\n colors.pushObjects([\"yellow\", \"orange\"]); // [\"red\", \"yellow\", \"orange\"]\n ```\n\n @method pushObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n pushObjects: function(objects) {\n if (!(Enumerable.detect(objects) || isArray(objects))) {\n throw new TypeError(\"Must pass Ember.Enumerable to Ember.MutableArray#pushObjects\");\n }\n this.replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n /**\n Pop object from array or nil if none are left. Works just like `pop()` but\n it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.popObject(); // \"blue\"\n console.log(colors); // [\"red\", \"green\"]\n ```\n\n @method popObject\n @return object\n */\n popObject: function() {\n var len = get(this, 'length');\n if (len === 0) return null;\n\n var ret = this.objectAt(len-1);\n this.removeAt(len-1, 1);\n return ret;\n },\n\n /**\n Shift an object from start of array or nil if none are left. Works just\n like `shift()` but it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.shiftObject(); // \"red\"\n console.log(colors); // [\"green\", \"blue\"]\n ```\n\n @method shiftObject\n @return object\n */\n shiftObject: function() {\n if (get(this, 'length') === 0) return null;\n var ret = this.objectAt(0);\n this.removeAt(0);\n return ret;\n },\n\n /**\n Unshift an object to start of array. Works just like `unshift()` but it is\n KVO-compliant.\n\n ```javascript\n var colors = [\"red\"];\n colors.unshiftObject(\"yellow\"); // [\"yellow\", \"red\"]\n colors.unshiftObject([\"black\"]); // [[\"black\"], \"yellow\", \"red\"]\n ```\n\n @method unshiftObject\n @param {*} obj object to unshift\n @return object same object passed as a param\n */\n unshiftObject: function(obj) {\n this.insertAt(0, obj);\n return obj;\n },\n\n /**\n Adds the named objects to the beginning of the array. Defers notifying\n observers until all objects have been added.\n\n ```javascript\n var colors = [\"red\"];\n colors.unshiftObjects([\"black\", \"white\"]); // [\"black\", \"white\", \"red\"]\n colors.unshiftObjects(\"yellow\"); // Type Error: 'undefined' is not a function\n ```\n\n @method unshiftObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n unshiftObjects: function(objects) {\n this.replace(0, 0, objects);\n return this;\n },\n\n /**\n Reverse objects in the array. Works just like `reverse()` but it is\n KVO-compliant.\n\n @method reverseObjects\n @return {Ember.Array} receiver\n */\n reverseObjects: function() {\n var len = get(this, 'length');\n if (len === 0) return this;\n var objects = this.toArray().reverse();\n this.replace(0, len, objects);\n return this;\n },\n\n /**\n Replace all the the receiver's content with content of the argument.\n If argument is an empty array receiver will be cleared.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.setObjects([\"black\", \"white\"]); // [\"black\", \"white\"]\n colors.setObjects([]); // []\n ```\n\n @method setObjects\n @param {Ember.Array} objects array whose content will be used for replacing\n the content of the receiver\n @return {Ember.Array} receiver with the new content\n */\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this.replace(0, len, objects);\n return this;\n },\n\n // ..........................................................\n // IMPLEMENT Ember.MutableEnumerable\n //\n\n /**\n Remove all occurances of an object in the array.\n\n ```javascript\n var cities = [\"Chicago\", \"Berlin\", \"Lima\", \"Chicago\"];\n cities.removeObject(\"Chicago\"); // [\"Berlin\", \"Lima\"]\n cities.removeObject(\"Lima\"); // [\"Berlin\"]\n cities.removeObject(\"Tokyo\") // [\"Berlin\"]\n ```\n\n @method removeObject\n @param {*} obj object to remove\n @return {Ember.Array} receiver\n */\n removeObject: function(obj) {\n var loc = get(this, 'length') || 0;\n while(--loc >= 0) {\n var curObject = this.objectAt(loc);\n if (curObject === obj) this.removeAt(loc);\n }\n return this;\n },\n\n /**\n Push the object onto the end of the array if it is not already\n present in the array.\n\n ```javascript\n var cities = [\"Chicago\", \"Berlin\"];\n cities.addObject(\"Lima\"); // [\"Chicago\", \"Berlin\", \"Lima\"]\n cities.addObject(\"Berlin\"); // [\"Chicago\", \"Berlin\", \"Lima\"]\n ```\n\n @method addObject\n @param {*} obj object to add, if not already present\n @return {Ember.Array} receiver\n */\n addObject: function(obj) {\n if (!this.contains(obj)) this.pushObject(obj);\n return this;\n }\n\n });\n\n __exports__[\"default\"] = MutableArray;\n });\ndefine(\"ember-runtime/mixins/mutable_enumerable\",\n [\"ember-metal/enumerable_utils\",\"ember-runtime/mixins/enumerable\",\"ember-metal/mixin\",\"ember-metal/property_events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var EnumerableUtils = __dependency1__[\"default\"];\n var Enumerable = __dependency2__[\"default\"];\n var Mixin = __dependency3__.Mixin;\n var required = __dependency3__.required;\n var beginPropertyChanges = __dependency4__.beginPropertyChanges;\n var endPropertyChanges = __dependency4__.endPropertyChanges;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var forEach = EnumerableUtils.forEach;\n\n /**\n This mixin defines the API for modifying generic enumerables. These methods\n can be applied to an object regardless of whether it is ordered or\n unordered.\n\n Note that an Enumerable can change even if it does not implement this mixin.\n For example, a MappedEnumerable cannot be directly modified but if its\n underlying enumerable changes, it will change also.\n\n ## Adding Objects\n\n To add an object to an enumerable, use the `addObject()` method. This\n method will only add the object to the enumerable if the object is not\n already present and is of a type supported by the enumerable.\n\n ```javascript\n set.addObject(contact);\n ```\n\n ## Removing Objects\n\n To remove an object from an enumerable, use the `removeObject()` method. This\n will only remove the object if it is present in the enumerable, otherwise\n this method has no effect.\n\n ```javascript\n set.removeObject(contact);\n ```\n\n ## Implementing In Your Own Code\n\n If you are implementing an object and want to support this API, just include\n this mixin in your class and implement the required methods. In your unit\n tests, be sure to apply the Ember.MutableEnumerableTests to your object.\n\n @class MutableEnumerable\n @namespace Ember\n @uses Ember.Enumerable\n */\n var MutableEnumerable = Mixin.create(Enumerable, {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to add the passed object to the receiver if the object is not\n already present in the collection. If the object is present, this method\n has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method addObject\n @param {Object} object The object to add to the enumerable.\n @return {Object} the passed object\n */\n addObject: required(Function),\n\n /**\n Adds each object in the passed enumerable to the receiver.\n\n @method addObjects\n @param {Ember.Enumerable} objects the objects to add.\n @return {Object} receiver\n */\n addObjects: function(objects) {\n beginPropertyChanges(this);\n forEach(objects, function(obj) { this.addObject(obj); }, this);\n endPropertyChanges(this);\n return this;\n },\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to remove the passed object from the receiver collection if the\n object is present in the collection. If the object is not present,\n this method has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method removeObject\n @param {Object} object The object to remove from the enumerable.\n @return {Object} the passed object\n */\n removeObject: required(Function),\n\n\n /**\n Removes each object in the passed enumerable from the receiver.\n\n @method removeObjects\n @param {Ember.Enumerable} objects the objects to remove\n @return {Object} receiver\n */\n removeObjects: function(objects) {\n beginPropertyChanges(this);\n for (var i = objects.length - 1; i >= 0; i--) {\n this.removeObject(objects[i]);\n }\n endPropertyChanges(this);\n return this;\n }\n });\n\n __exports__[\"default\"] = MutableEnumerable;\n });\ndefine(\"ember-runtime/mixins/observable\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/get_properties\",\"ember-metal/set_properties\",\"ember-metal/mixin\",\"ember-metal/events\",\"ember-metal/property_events\",\"ember-metal/observer\",\"ember-metal/computed\",\"ember-metal/is_none\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n\n var get = __dependency2__.get;\n var getWithDefault = __dependency2__.getWithDefault;\n var set = __dependency3__.set;\n var apply = __dependency4__.apply;\n var getProperties = __dependency5__[\"default\"];\n var setProperties = __dependency6__[\"default\"];\n var Mixin = __dependency7__.Mixin;\n var hasListeners = __dependency8__.hasListeners;\n var beginPropertyChanges = __dependency9__.beginPropertyChanges;\n var propertyWillChange = __dependency9__.propertyWillChange;\n var propertyDidChange = __dependency9__.propertyDidChange;\n var endPropertyChanges = __dependency9__.endPropertyChanges;\n var addObserver = __dependency10__.addObserver;\n var addBeforeObserver = __dependency10__.addBeforeObserver;\n var removeObserver = __dependency10__.removeObserver;\n var observersFor = __dependency10__.observersFor;\n var cacheFor = __dependency11__.cacheFor;\n var isNone = __dependency12__.isNone;\n\n\n var slice = Array.prototype.slice;\n /**\n ## Overview\n\n This mixin provides properties and property observing functionality, core\n features of the Ember object model.\n\n Properties and observers allow one object to observe changes to a\n property on another object. This is one of the fundamental ways that\n models, controllers and views communicate with each other in an Ember\n application.\n\n Any object that has this mixin applied can be used in observer\n operations. That includes `Ember.Object` and most objects you will\n interact with as you write your Ember application.\n\n Note that you will not generally apply this mixin to classes yourself,\n but you will use the features provided by this module frequently, so it\n is important to understand how to use it.\n\n ## Using `get()` and `set()`\n\n Because of Ember's support for bindings and observers, you will always\n access properties using the get method, and set properties using the\n set method. This allows the observing objects to be notified and\n computed properties to be handled properly.\n\n More documentation about `get` and `set` are below.\n\n ## Observing Property Changes\n\n You typically observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n Although this is the most common way to add an observer, this capability\n is actually built into the `Ember.Object` class on top of two methods\n defined in this mixin: `addObserver` and `removeObserver`. You can use\n these two methods to add and remove observers yourself if you need to\n do so at runtime.\n\n To add an observer for a property, call:\n\n ```javascript\n object.addObserver('propertyKey', targetObject, targetAction)\n ```\n\n This will call the `targetAction` method on the `targetObject` whenever\n the value of the `propertyKey` changes.\n\n Note that if `propertyKey` is a computed property, the observer will be\n called when any of the property dependencies are changed, even if the\n resulting value of the computed property is unchanged. This is necessary\n because computed properties are not computed until `get` is called.\n\n @class Observable\n @namespace Ember\n */\n var Observable = Mixin.create({\n\n /**\n Retrieves the value of a property from the object.\n\n This method is usually similar to using `object[keyName]` or `object.keyName`,\n however it supports both computed properties and the unknownProperty\n handler.\n\n Because `get` unifies the syntax for accessing all these kinds\n of properties, it can make many refactorings easier, such as replacing a\n simple property with a computed property, or vice versa.\n\n ### Computed Properties\n\n Computed properties are methods defined with the `property` modifier\n declared at the end, such as:\n\n ```javascript\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n }.property('firstName', 'lastName')\n ```\n\n When you call `get` on a computed property, the function will be\n called and the return value will be returned instead of the function\n itself.\n\n ### Unknown Properties\n\n Likewise, if you try to call `get` on a property whose value is\n `undefined`, the `unknownProperty()` method will be called on the object.\n If this method returns any value other than `undefined`, it will be returned\n instead. This allows you to implement \"virtual\" properties that are\n not defined upfront.\n\n @method get\n @param {String} keyName The property to retrieve\n @return {Object} The property value or undefined.\n */\n get: function(keyName) {\n return get(this, keyName);\n },\n\n /**\n To get multiple properties at once, call `getProperties`\n with a list of strings or an array:\n\n ```javascript\n record.getProperties('firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n record.getProperties(['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param {String...|Array} list of keys to get\n @return {Hash}\n */\n getProperties: function() {\n return apply(null, getProperties, [this].concat(slice.call(arguments)));\n },\n\n /**\n Sets the provided key or path to the value.\n\n This method is generally very similar to calling `object[key] = value` or\n `object.key = value`, except that it provides support for computed\n properties, the `setUnknownProperty()` method and property observers.\n\n ### Computed Properties\n\n If you try to set a value on a key that has a computed property handler\n defined (see the `get()` method for an example), then `set()` will call\n that method, passing both the value and key instead of simply changing\n the value itself. This is useful for those times when you need to\n implement a property that is composed of one or more member\n properties.\n\n ### Unknown Properties\n\n If you try to set a value on a key that is undefined in the target\n object, then the `setUnknownProperty()` handler will be called instead. This\n gives you an opportunity to implement complex \"virtual\" properties that\n are not predefined on the object. If `setUnknownProperty()` returns\n undefined, then `set()` will simply set the value on the object.\n\n ### Property Observers\n\n In addition to changing the property, `set()` will also register a property\n change with the object. Unless you have placed this call inside of a\n `beginPropertyChanges()` and `endPropertyChanges(),` any \"local\" observers\n (i.e. observer methods declared on the same object), will be called\n immediately. Any \"remote\" observers (i.e. observer methods declared on\n another object) will be placed in a queue and called at a later time in a\n coalesced manner.\n\n ### Chaining\n\n In addition to property changes, `set()` returns the value of the object\n itself so you can do chaining like this:\n\n ```javascript\n record.set('firstName', 'Charles').set('lastName', 'Jolley');\n ```\n\n @method set\n @param {String} keyName The property to set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n set: function(keyName, value) {\n set(this, keyName, value);\n return this;\n },\n\n\n /**\n Sets a list of properties at once. These properties are set inside\n a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n observers will be buffered.\n\n ```javascript\n record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });\n ```\n\n @method setProperties\n @param {Hash} hash the hash of keys and values to set\n @return {Ember.Observable}\n */\n setProperties: function(hash) {\n return setProperties(this, hash);\n },\n\n /**\n Begins a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call this\n method at the beginning of the changes to begin deferring change\n notifications. When you are done making changes, call\n `endPropertyChanges()` to deliver the deferred change notifications and end\n deferring.\n\n @method beginPropertyChanges\n @return {Ember.Observable}\n */\n beginPropertyChanges: function() {\n beginPropertyChanges();\n return this;\n },\n\n /**\n Ends a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call\n `beginPropertyChanges()` at the beginning of the changes to defer change\n notifications. When you are done making changes, call this method to\n deliver the deferred change notifications and end deferring.\n\n @method endPropertyChanges\n @return {Ember.Observable}\n */\n endPropertyChanges: function() {\n endPropertyChanges();\n return this;\n },\n\n /**\n Notify the observer system that a property is about to change.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyDidChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyWillChange\n @param {String} keyName The property key that is about to change.\n @return {Ember.Observable}\n */\n propertyWillChange: function(keyName) {\n propertyWillChange(this, keyName);\n return this;\n },\n\n /**\n Notify the observer system that a property has just changed.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyWillChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyDidChange\n @param {String} keyName The property key that has just changed.\n @return {Ember.Observable}\n */\n propertyDidChange: function(keyName) {\n propertyDidChange(this, keyName);\n return this;\n },\n\n /**\n Convenience method to call `propertyWillChange` and `propertyDidChange` in\n succession.\n\n @method notifyPropertyChange\n @param {String} keyName The property key to be notified about.\n @return {Ember.Observable}\n */\n notifyPropertyChange: function(keyName) {\n this.propertyWillChange(keyName);\n this.propertyDidChange(keyName);\n return this;\n },\n\n addBeforeObserver: function(key, target, method) {\n addBeforeObserver(this, key, target, method);\n },\n\n /**\n Adds an observer on a property.\n\n This is the core method used to register an observer for a property.\n\n Once you call this method, any time the key's value is set, your observer\n will be notified. Note that the observers are triggered any time the\n value is set, regardless of whether it has actually changed. Your\n observer should be prepared to handle that.\n\n You can also pass an optional context parameter to this method. The\n context will be passed to your observer method whenever it is triggered.\n Note that if you add the same target/method pair on a key multiple times\n with different context parameters, your observer will only be called once\n with the last context you passed.\n\n ### Observer Methods\n\n Observer methods you pass should generally have the following signature if\n you do not pass a `context` parameter:\n\n ```javascript\n fooDidChange: function(sender, key, value, rev) { };\n ```\n\n The sender is the object that changed. The key is the property that\n changes. The value property is currently reserved and unused. The rev\n is the last property revision of the object when it changed, which you can\n use to detect if the key value has really changed or not.\n\n If you pass a `context` parameter, the context will be passed before the\n revision like so:\n\n ```javascript\n fooDidChange: function(sender, key, value, context, rev) { };\n ```\n\n Usually you will not need the value, context or revision parameters at\n the end. In this case, it is common to write observer methods that take\n only a sender and key value as parameters or, if you aren't interested in\n any of these values, to write an observer that has no parameters at all.\n\n @method addObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n */\n addObserver: function(key, target, method) {\n addObserver(this, key, target, method);\n },\n\n /**\n Remove an observer you have previously registered on this object. Pass\n the same key, target, and method you passed to `addObserver()` and your\n target will no longer receive notifications.\n\n @method removeObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n */\n removeObserver: function(key, target, method) {\n removeObserver(this, key, target, method);\n },\n\n /**\n Returns `true` if the object currently has observers registered for a\n particular key. You can use this method to potentially defer performing\n an expensive action until someone begins observing a particular property\n on the object.\n\n @method hasObserverFor\n @param {String} key Key to check\n @return {Boolean}\n */\n hasObserverFor: function(key) {\n return hasListeners(this, key+':change');\n },\n\n /**\n Retrieves the value of a property, or a default value in the case that the\n property returns `undefined`.\n\n ```javascript\n person.getWithDefault('lastName', 'Doe');\n ```\n\n @method getWithDefault\n @param {String} keyName The name of the property to retrieve\n @param {Object} defaultValue The value to return if the property value is undefined\n @return {Object} The property value or the defaultValue.\n */\n getWithDefault: function(keyName, defaultValue) {\n return getWithDefault(this, keyName, defaultValue);\n },\n\n /**\n Set the value of a property to the current value plus some amount.\n\n ```javascript\n person.incrementProperty('age');\n team.incrementProperty('score', 2);\n ```\n\n @method incrementProperty\n @param {String} keyName The name of the property to increment\n @param {Number} increment The amount to increment by. Defaults to 1\n @return {Number} The new property value\n */\n incrementProperty: function(keyName, increment) {\n if (isNone(increment)) { increment = 1; }\n Ember.assert(\"Must pass a numeric value to incrementProperty\", (!isNaN(parseFloat(increment)) && isFinite(increment)));\n set(this, keyName, (parseFloat(get(this, keyName)) || 0) + increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a property to the current value minus some amount.\n\n ```javascript\n player.decrementProperty('lives');\n orc.decrementProperty('health', 5);\n ```\n\n @method decrementProperty\n @param {String} keyName The name of the property to decrement\n @param {Number} decrement The amount to decrement by. Defaults to 1\n @return {Number} The new property value\n */\n decrementProperty: function(keyName, decrement) {\n if (isNone(decrement)) { decrement = 1; }\n Ember.assert(\"Must pass a numeric value to decrementProperty\", (!isNaN(parseFloat(decrement)) && isFinite(decrement)));\n set(this, keyName, (get(this, keyName) || 0) - decrement);\n return get(this, keyName);\n },\n\n /**\n Set the value of a boolean property to the opposite of it's\n current value.\n\n ```javascript\n starship.toggleProperty('warpDriveEngaged');\n ```\n\n @method toggleProperty\n @param {String} keyName The name of the property to toggle\n @return {Object} The new property value\n */\n toggleProperty: function(keyName) {\n set(this, keyName, !get(this, keyName));\n return get(this, keyName);\n },\n\n /**\n Returns the cached value of a computed property, if it exists.\n This allows you to inspect the value of a computed property\n without accidentally invoking it if it is intended to be\n generated lazily.\n\n @method cacheFor\n @param {String} keyName\n @return {Object} The cached value of the computed property, if any\n */\n cacheFor: function(keyName) {\n return cacheFor(this, keyName);\n },\n\n // intended for debugging purposes\n observersForKey: function(keyName) {\n return observersFor(this, keyName);\n }\n });\n\n __exports__[\"default\"] = Observable;\n });\ndefine(\"ember-runtime/mixins/promise_proxy\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/computed\",\"ember-metal/mixin\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var computed = __dependency3__.computed;\n var Mixin = __dependency4__.Mixin;\n var EmberError = __dependency5__[\"default\"];\n\n var not = computed.not, or = computed.or;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n function tap(proxy, promise) {\n set(proxy, 'isFulfilled', false);\n set(proxy, 'isRejected', false);\n\n return promise.then(function(value) {\n set(proxy, 'isFulfilled', true);\n set(proxy, 'content', value);\n return value;\n }, function(reason) {\n set(proxy, 'isRejected', true);\n set(proxy, 'reason', reason);\n throw reason;\n }, \"Ember: PromiseProxy\");\n }\n\n /**\n A low level mixin making ObjectProxy, ObjectController or ArrayController's promise aware.\n\n ```javascript\n var ObjectPromiseController = Ember.ObjectController.extend(Ember.PromiseProxyMixin);\n\n var controller = ObjectPromiseController.create({\n promise: $.getJSON('/some/remote/data.json')\n });\n\n controller.then(function(json){\n // the json\n }, function(reason) {\n // the reason why you have no json\n });\n ```\n\n the controller has bindable attributes which\n track the promises life cycle\n\n ```javascript\n controller.get('isPending') //=> true\n controller.get('isSettled') //=> false\n controller.get('isRejected') //=> false\n controller.get('isFulfilled') //=> false\n ```\n\n When the the $.getJSON completes, and the promise is fulfilled\n with json, the life cycle attributes will update accordingly.\n\n ```javascript\n controller.get('isPending') //=> false\n controller.get('isSettled') //=> true\n controller.get('isRejected') //=> false\n controller.get('isFulfilled') //=> true\n ```\n\n As the controller is an ObjectController, and the json now its content,\n all the json properties will be available directly from the controller.\n\n ```javascript\n // Assuming the following json:\n {\n firstName: 'Stefan',\n lastName: 'Penner'\n }\n\n // both properties will accessible on the controller\n controller.get('firstName') //=> 'Stefan'\n controller.get('lastName') //=> 'Penner'\n ```\n\n If the controller is backing a template, the attributes are\n bindable from within that template\n\n ```handlebars\n {{#if isPending}}\n loading...\n {{else}}\n firstName: {{firstName}}\n lastName: {{lastName}}\n {{/if}}\n ```\n @class Ember.PromiseProxyMixin\n */\n var PromiseProxyMixin = Mixin.create({\n /**\n If the proxied promise is rejected this will contain the reason\n provided.\n\n @property reason\n @default null\n */\n reason: null,\n\n /**\n Once the proxied promise has settled this will become `false`.\n\n @property isPending\n @default true\n */\n isPending: not('isSettled').readOnly(),\n\n /**\n Once the proxied promise has settled this will become `true`.\n\n @property isSettled\n @default false\n */\n isSettled: or('isRejected', 'isFulfilled').readOnly(),\n\n /**\n Will become `true` if the proxied promise is rejected.\n\n @property isRejected\n @default false\n */\n isRejected: false,\n\n /**\n Will become `true` if the proxied promise is fulfilled.\n\n @property isFullfilled\n @default false\n */\n isFulfilled: false,\n\n /**\n The promise whose fulfillment value is being proxied by this object.\n\n This property must be specified upon creation, and should not be\n changed once created.\n\n Example:\n\n ```javascript\n Ember.ObjectController.extend(Ember.PromiseProxyMixin).create({\n promise: <thenable>\n });\n ```\n\n @property promise\n */\n promise: computed(function(key, promise) {\n if (arguments.length === 2) {\n return tap(this, promise);\n } else {\n throw new EmberError(\"PromiseProxy's promise must be set\");\n }\n }),\n\n /**\n An alias to the proxied promise's `then`.\n\n See RSVP.Promise.then.\n\n @method then\n @param {Function} callback\n @return {RSVP.Promise}\n */\n then: promiseAlias('then'),\n\n /**\n An alias to the proxied promise's `catch`.\n\n See RSVP.Promise.catch.\n\n @method catch\n @param {Function} callback\n @return {RSVP.Promise}\n @since 1.3.0\n */\n 'catch': promiseAlias('catch'),\n\n /**\n An alias to the proxied promise's `finally`.\n\n See RSVP.Promise.finally.\n\n @method finally\n @param {Function} callback\n @return {RSVP.Promise}\n @since 1.3.0\n */\n 'finally': promiseAlias('finally')\n\n });\n\n function promiseAlias(name) {\n return function () {\n var promise = get(this, 'promise');\n return promise[name].apply(promise, arguments);\n };\n }\n\n __exports__[\"default\"] = PromiseProxyMixin;\n });\ndefine(\"ember-runtime/mixins/sortable\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/enumerable_utils\",\"ember-metal/mixin\",\"ember-runtime/mixins/mutable_enumerable\",\"ember-runtime/compare\",\"ember-metal/observer\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.A\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EnumerableUtils = __dependency4__[\"default\"];\n var Mixin = __dependency5__.Mixin;\n var MutableEnumerable = __dependency6__[\"default\"];\n var compare = __dependency7__[\"default\"];\n var addObserver = __dependency8__.addObserver;\n var removeObserver = __dependency8__.removeObserver;\n var computed = __dependency9__.computed;\n var beforeObserver = __dependency5__.beforeObserver;\n var observer = __dependency5__.observer;\n //ES6TODO: should we access these directly from their package or from how thier exposed in ember-metal?\n\n var forEach = EnumerableUtils.forEach;\n\n /**\n `Ember.SortableMixin` provides a standard interface for array proxies\n to specify a sort order and maintain this sorting when objects are added,\n removed, or updated without changing the implicit order of their underlying\n content array:\n\n ```javascript\n songs = [\n {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'},\n {trackNumber: 2, title: 'Back in the U.S.S.R.'},\n {trackNumber: 3, title: 'Glass Onion'},\n ];\n\n songsController = Ember.ArrayController.create({\n content: songs,\n sortProperties: ['trackNumber'],\n sortAscending: true\n });\n\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.addObject({trackNumber: 1, title: 'Dear Prudence'});\n songsController.get('firstObject'); // {trackNumber: 1, title: 'Dear Prudence'}\n ```\n\n If you add or remove the properties to sort by or change the sort direction the content\n sort order will be automatically updated.\n\n ```javascript\n songsController.set('sortProperties', ['title']);\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.toggleProperty('sortAscending');\n songsController.get('firstObject'); // {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'}\n ```\n\n SortableMixin works by sorting the arrangedContent array, which is the array that\n arrayProxy displays. Due to the fact that the underlying 'content' array is not changed, that\n array will not display the sorted list:\n\n ```javascript\n songsController.get('content').get('firstObject'); // Returns the unsorted original content\n songsController.get('firstObject'); // Returns the sorted content.\n ```\n\n Although the sorted content can also be accessed through the arrangedContent property,\n it is preferable to use the proxied class and not the arrangedContent array directly.\n\n @class SortableMixin\n @namespace Ember\n @uses Ember.MutableEnumerable\n */\n var SortableMixin = Mixin.create(MutableEnumerable, {\n\n /**\n Specifies which properties dictate the arrangedContent's sort order.\n\n When specifying multiple properties the sorting will use properties\n from the `sortProperties` array prioritized from first to last.\n\n @property {Array} sortProperties\n */\n sortProperties: null,\n\n /**\n Specifies the arrangedContent's sort direction.\n Sorts the content in ascending order by default. Set to `false` to\n use descending order.\n\n @property {Boolean} sortAscending\n @default true\n */\n sortAscending: true,\n\n /**\n The function used to compare two values. You can override this if you\n want to do custom comparisons. Functions must be of the type expected by\n Array#sort, i.e.\n return 0 if the two parameters are equal,\n return a negative value if the first parameter is smaller than the second or\n return a positive value otherwise:\n\n ```javascript\n function(x,y) { // These are assumed to be integers\n if (x === y)\n return 0;\n return x < y ? -1 : 1;\n }\n ```\n\n @property sortFunction\n @type {Function}\n @default Ember.compare\n */\n sortFunction: compare,\n\n orderBy: function(item1, item2) {\n var result = 0,\n sortProperties = get(this, 'sortProperties'),\n sortAscending = get(this, 'sortAscending'),\n sortFunction = get(this, 'sortFunction');\n\n Ember.assert(\"you need to define `sortProperties`\", !!sortProperties);\n\n forEach(sortProperties, function(propertyName) {\n if (result === 0) {\n result = sortFunction.call(this, get(item1, propertyName), get(item2, propertyName));\n if ((result !== 0) && !sortAscending) {\n result = (-1) * result;\n }\n }\n }, this);\n\n return result;\n },\n\n destroy: function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super();\n },\n\n isSorted: computed.notEmpty('sortProperties'),\n\n /**\n Overrides the default arrangedContent from arrayProxy in order to sort by sortFunction.\n Also sets up observers for each sortProperty on each item in the content Array.\n\n @property arrangedContent\n */\n\n arrangedContent: computed('content', 'sortProperties.@each', function(key, value) {\n var content = get(this, 'content'),\n isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties'),\n self = this;\n\n if (content && isSorted) {\n content = content.slice();\n content.sort(function(item1, item2) {\n return self.orderBy(item1, item2);\n });\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n return Ember.A(content);\n }\n\n return content;\n }),\n\n _contentWillChange: beforeObserver('content', function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n this._super();\n }),\n\n sortPropertiesWillChange: beforeObserver('sortProperties', function() {\n this._lastSortAscending = undefined;\n }),\n\n sortPropertiesDidChange: observer('sortProperties', function() {\n this._lastSortAscending = undefined;\n }),\n\n sortAscendingWillChange: beforeObserver('sortAscending', function() {\n this._lastSortAscending = get(this, 'sortAscending');\n }),\n\n sortAscendingDidChange: observer('sortAscending', function() {\n if (this._lastSortAscending !== undefined && get(this, 'sortAscending') !== this._lastSortAscending) {\n var arrangedContent = get(this, 'arrangedContent');\n arrangedContent.reverseObjects();\n }\n }),\n\n contentArrayWillChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted');\n\n if (isSorted) {\n var arrangedContent = get(this, 'arrangedContent');\n var removedObjects = array.slice(idx, idx+removedCount);\n var sortProperties = get(this, 'sortProperties');\n\n forEach(removedObjects, function(item) {\n arrangedContent.removeObject(item);\n\n forEach(sortProperties, function(sortProperty) {\n removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n contentArrayDidChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties');\n\n if (isSorted) {\n var addedObjects = array.slice(idx, idx+addedCount);\n\n forEach(addedObjects, function(item) {\n this.insertItemSorted(item);\n\n forEach(sortProperties, function(sortProperty) {\n addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n insertItemSorted: function(item) {\n var arrangedContent = get(this, 'arrangedContent');\n var length = get(arrangedContent, 'length');\n\n var idx = this._binarySearch(item, 0, length);\n arrangedContent.insertAt(idx, item);\n },\n\n contentItemSortPropertyDidChange: function(item) {\n var arrangedContent = get(this, 'arrangedContent'),\n oldIndex = arrangedContent.indexOf(item),\n leftItem = arrangedContent.objectAt(oldIndex - 1),\n rightItem = arrangedContent.objectAt(oldIndex + 1),\n leftResult = leftItem && this.orderBy(item, leftItem),\n rightResult = rightItem && this.orderBy(item, rightItem);\n\n if (leftResult < 0 || rightResult > 0) {\n arrangedContent.removeObject(item);\n this.insertItemSorted(item);\n }\n },\n\n _binarySearch: function(item, low, high) {\n var mid, midItem, res, arrangedContent;\n\n if (low === high) {\n return low;\n }\n\n arrangedContent = get(this, 'arrangedContent');\n\n mid = low + Math.floor((high - low) / 2);\n midItem = arrangedContent.objectAt(mid);\n\n res = this.orderBy(midItem, item);\n\n if (res < 0) {\n return this._binarySearch(item, mid+1, high);\n } else if (res > 0) {\n return this._binarySearch(item, low, mid);\n }\n\n return mid;\n }\n });\n\n __exports__[\"default\"] = SortableMixin;\n });\ndefine(\"ember-runtime/mixins/target_action_support\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/mixin\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.lookup, Ember.assert\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var typeOf = __dependency4__.typeOf;\n var Mixin = __dependency5__.Mixin;\n var computed = __dependency6__.computed;\n\n /**\n `Ember.TargetActionSupport` is a mixin that can be included in a class\n to add a `triggerAction` method with semantics similar to the Handlebars\n `{{action}}` helper. In normal Ember usage, the `{{action}}` helper is\n usually the best choice. This mixin is most often useful when you are\n doing more complex event handling in View objects.\n\n See also `Ember.ViewTargetActionSupport`, which has\n view-aware defaults for target and actionContext.\n\n @class TargetActionSupport\n @namespace Ember\n @extends Ember.Mixin\n */\n var TargetActionSupport = Mixin.create({\n target: null,\n action: null,\n actionContext: null,\n\n targetObject: computed(function() {\n var target = get(this, 'target');\n\n if (typeOf(target) === \"string\") {\n var value = get(this, target);\n if (value === undefined) { value = get(Ember.lookup, target); }\n return value;\n } else {\n return target;\n }\n }).property('target'),\n\n actionContextObject: computed(function() {\n var actionContext = get(this, 'actionContext');\n\n if (typeOf(actionContext) === \"string\") {\n var value = get(this, actionContext);\n if (value === undefined) { value = get(Ember.lookup, actionContext); }\n return value;\n } else {\n return actionContext;\n }\n }).property('actionContext'),\n\n /**\n Send an `action` with an `actionContext` to a `target`. The action, actionContext\n and target will be retrieved from properties of the object. For example:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n action: 'save',\n actionContext: Ember.computed.alias('context'),\n click: function() {\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `target`, `action`, and `actionContext` can be provided as properties of\n an optional object argument to `triggerAction` as well.\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n click: function() {\n this.triggerAction({\n action: 'save',\n target: this.get('controller'),\n actionContext: this.get('context'),\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `actionContext` defaults to the object you are mixing `TargetActionSupport` into.\n But `target` and `action` must be specified either as properties or with the argument\n to `triggerAction`, or a combination:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n click: function() {\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with a reference to `this`,\n // to the current controller\n }\n });\n ```\n\n @method triggerAction\n @param opts {Hash} (optional, with the optional keys action, target and/or actionContext)\n @return {Boolean} true if the action was sent successfully and did not return false\n */\n triggerAction: function(opts) {\n opts = opts || {};\n var action = opts.action || get(this, 'action'),\n target = opts.target || get(this, 'targetObject'),\n actionContext = opts.actionContext;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n return ret.concat(options);\n }\n\n if (typeof actionContext === 'undefined') {\n actionContext = get(this, 'actionContextObject') || this;\n }\n\n if (target && action) {\n var ret;\n\n if (target.send) {\n ret = target.send.apply(target, args(actionContext, action));\n } else {\n Ember.assert(\"The action '\" + action + \"' did not exist on \" + target, typeof target[action] === 'function');\n ret = target[action].apply(target, args(actionContext));\n }\n\n if (ret !== false) ret = true;\n\n return ret;\n } else {\n return false;\n }\n }\n });\n\n __exports__[\"default\"] = TargetActionSupport;\n });\ndefine(\"ember-runtime/system/application\",\n [\"ember-runtime/system/namespace\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Namespace = __dependency1__[\"default\"];\n\n var Application = Namespace.extend();\n __exports__[\"default\"] = Application;\n });\ndefine(\"ember-runtime/system/array_proxy\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/computed\",\"ember-metal/mixin\",\"ember-metal/property_events\",\"ember-metal/error\",\"ember-runtime/system/object\",\"ember-runtime/mixins/mutable_array\",\"ember-runtime/mixins/enumerable\",\"ember-runtime/system/string\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.K, Ember.assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var isArray = __dependency4__.isArray;\n var apply = __dependency4__.apply;\n var computed = __dependency5__.computed;\n var beforeObserver = __dependency6__.beforeObserver;\n var observer = __dependency6__.observer;\n var beginPropertyChanges = __dependency7__.beginPropertyChanges;\n var endPropertyChanges = __dependency7__.endPropertyChanges;\n var EmberError = __dependency8__[\"default\"];\n var EmberObject = __dependency9__[\"default\"];var MutableArray = __dependency10__[\"default\"];var Enumerable = __dependency11__[\"default\"];\n var fmt = __dependency12__.fmt;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var OUT_OF_RANGE_EXCEPTION = \"Index out of range\";\n var EMPTY = [];\n var alias = computed.alias;\n var K = Ember.K;\n\n /**\n An ArrayProxy wraps any other object that implements `Ember.Array` and/or\n `Ember.MutableArray,` forwarding all requests. This makes it very useful for\n a number of binding use cases or other cases where being able to swap\n out the underlying array is useful.\n\n A simple example of usage:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });\n\n ap.get('firstObject'); // 'dog'\n ap.set('content', ['amoeba', 'paramecium']);\n ap.get('firstObject'); // 'amoeba'\n ```\n\n This class can also be useful as a layer to transform the contents of\n an array, as they are accessed. This can be done by overriding\n `objectAtContent`:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({\n content: Ember.A(pets),\n objectAtContent: function(idx) {\n return this.get('content').objectAt(idx).toUpperCase();\n }\n });\n\n ap.get('firstObject'); // . 'DOG'\n ```\n\n @class ArrayProxy\n @namespace Ember\n @extends Ember.Object\n @uses Ember.MutableArray\n */\n var ArrayProxy = EmberObject.extend(MutableArray, {\n\n /**\n The content array. Must be an object that implements `Ember.Array` and/or\n `Ember.MutableArray.`\n\n @property content\n @type Ember.Array\n */\n content: null,\n\n /**\n The array that the proxy pretends to be. In the default `ArrayProxy`\n implementation, this and `content` are the same. Subclasses of `ArrayProxy`\n can override this property to provide things like sorting and filtering.\n\n @property arrangedContent\n */\n arrangedContent: alias('content'),\n\n /**\n Should actually retrieve the object at the specified index from the\n content. You can override this method in subclasses to transform the\n content item to something new.\n\n This method will only be called if content is non-`null`.\n\n @method objectAtContent\n @param {Number} idx The index to retrieve.\n @return {Object} the value or undefined if none found\n */\n objectAtContent: function(idx) {\n return get(this, 'arrangedContent').objectAt(idx);\n },\n\n /**\n Should actually replace the specified objects on the content array.\n You can override this method in subclasses to transform the content item\n into something new.\n\n This method will only be called if content is non-`null`.\n\n @method replaceContent\n @param {Number} idx The starting index\n @param {Number} amt The number of items to remove from the content.\n @param {Array} objects Optional array of objects to insert or null if no\n objects.\n @return {void}\n */\n replaceContent: function(idx, amt, objects) {\n get(this, 'content').replace(idx, amt, objects);\n },\n\n /**\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @private\n @method _contentWillChange\n */\n _contentWillChange: beforeObserver('content', function() {\n this._teardownContent();\n }),\n\n _teardownContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n contentArrayWillChange: K,\n contentArrayDidChange: K,\n\n /**\n Invoked when the content property changes. Notifies observers that the\n entire array content has changed.\n\n @private\n @method _contentDidChange\n */\n _contentDidChange: observer('content', function() {\n var content = get(this, 'content');\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", content !== this);\n\n this._setupContent();\n }),\n\n _setupContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n Ember.assert(fmt('ArrayProxy expects an Array or ' +\n 'Ember.ArrayProxy, but you passed %@', [typeof content]),\n isArray(content) || content.isDestroyed);\n\n content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n _arrangedContentWillChange: beforeObserver('arrangedContent', function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n this.arrangedContentArrayWillChange(this, 0, len, undefined);\n this.arrangedContentWillChange(this);\n\n this._teardownArrangedContent(arrangedContent);\n }),\n\n _arrangedContentDidChange: observer('arrangedContent', function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", arrangedContent !== this);\n\n this._setupArrangedContent();\n\n this.arrangedContentDidChange(this);\n this.arrangedContentArrayDidChange(this, 0, undefined, len);\n }),\n\n _setupArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n Ember.assert(fmt('ArrayProxy expects an Array or ' +\n 'Ember.ArrayProxy, but you passed %@', [typeof arrangedContent]),\n isArray(arrangedContent) || arrangedContent.isDestroyed);\n\n arrangedContent.addArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n _teardownArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.removeArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n arrangedContentWillChange: K,\n arrangedContentDidChange: K,\n\n objectAt: function(idx) {\n return get(this, 'content') && this.objectAtContent(idx);\n },\n\n length: computed(function() {\n var arrangedContent = get(this, 'arrangedContent');\n return arrangedContent ? get(arrangedContent, 'length') : 0;\n // No dependencies since Enumerable notifies length of change\n }),\n\n _replace: function(idx, amt, objects) {\n var content = get(this, 'content');\n Ember.assert('The content property of '+ this.constructor + ' should be set before modifying it', content);\n if (content) this.replaceContent(idx, amt, objects);\n return this;\n },\n\n replace: function() {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n apply(this, this._replace, arguments);\n } else {\n throw new EmberError(\"Using replace on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n _insertAt: function(idx, object) {\n if (idx > get(this, 'content.length')) throw new EmberError(OUT_OF_RANGE_EXCEPTION);\n this._replace(idx, 0, [object]);\n return this;\n },\n\n insertAt: function(idx, object) {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n return this._insertAt(idx, object);\n } else {\n throw new EmberError(\"Using insertAt on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n var content = get(this, 'content'),\n arrangedContent = get(this, 'arrangedContent'),\n indices = [], i;\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new EmberError(OUT_OF_RANGE_EXCEPTION);\n }\n\n if (len === undefined) len = 1;\n\n // Get a list of indices in original content to remove\n for (i=start; i<start+len; i++) {\n // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent\n indices.push(content.indexOf(arrangedContent.objectAt(i)));\n }\n\n // Replace in reverse order since indices will change\n indices.sort(function(a,b) { return b - a; });\n\n beginPropertyChanges();\n for (i=0; i<indices.length; i++) {\n this._replace(indices[i], 1, EMPTY);\n }\n endPropertyChanges();\n }\n\n return this ;\n },\n\n pushObject: function(obj) {\n this._insertAt(get(this, 'content.length'), obj) ;\n return obj ;\n },\n\n pushObjects: function(objects) {\n if (!(Enumerable.detect(objects) || isArray(objects))) {\n throw new TypeError(\"Must pass Ember.Enumerable to Ember.MutableArray#pushObjects\");\n }\n this._replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this._replace(0, len, objects);\n return this;\n },\n\n unshiftObject: function(obj) {\n this._insertAt(0, obj) ;\n return obj ;\n },\n\n unshiftObjects: function(objects) {\n this._replace(0, 0, objects);\n return this;\n },\n\n slice: function() {\n var arr = this.toArray();\n return arr.slice.apply(arr, arguments);\n },\n\n arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentWillChange(idx, removedCnt, addedCnt);\n },\n\n arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentDidChange(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n this._setupContent();\n this._setupArrangedContent();\n },\n\n willDestroy: function() {\n this._teardownArrangedContent();\n this._teardownContent();\n }\n });\n\n __exports__[\"default\"] = ArrayProxy;\n });\ndefine(\"ember-runtime/system/container\",\n [\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var set = __dependency1__[\"default\"];\n\n var Container = requireModule('container')[\"default\"];\n Container.set = set;\n\n __exports__[\"default\"] = Container;\n });\ndefine(\"ember-runtime/system/core_object\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/platform\",\"ember-metal/watching\",\"ember-metal/chains\",\"ember-metal/events\",\"ember-metal/mixin\",\"ember-metal/enumerable_utils\",\"ember-metal/error\",\"ember-runtime/keys\",\"ember-runtime/mixins/action_handler\",\"ember-metal/properties\",\"ember-metal/binding\",\"ember-metal/computed\",\"ember-metal/run_loop\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.ENV.MANDATORY_SETTER, Ember.assert, Ember.K, Ember.config\n\n // NOTE: this object should never be included directly. Instead use `Ember.Object`.\n // We only define this separately so that `Ember.Set` can depend on it.\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n var apply = __dependency4__.apply;\n var create = __dependency5__.create;\n var generateGuid = __dependency4__.generateGuid;\n var GUID_KEY = __dependency4__.GUID_KEY;\n var meta = __dependency4__.meta;\n var META_KEY = __dependency4__.META_KEY;\n var makeArray = __dependency4__.makeArray;\n var rewatch = __dependency6__.rewatch;\n var finishChains = __dependency7__.finishChains;\n var sendEvent = __dependency8__.sendEvent;\n var IS_BINDING = __dependency9__.IS_BINDING;\n var Mixin = __dependency9__.Mixin;\n var required = __dependency9__.required;\n var EnumerableUtils = __dependency10__[\"default\"];\n var EmberError = __dependency11__[\"default\"];\n var platform = __dependency5__.platform;\n var keys = __dependency12__[\"default\"];\n var ActionHandler = __dependency13__[\"default\"];\n var defineProperty = __dependency14__.defineProperty;\n var Binding = __dependency15__.Binding;\n var ComputedProperty = __dependency16__.ComputedProperty;\n var run = __dependency17__[\"default\"];\n var destroy = __dependency6__.destroy;\n\n\n var o_create = create,\n o_defineProperty = platform.defineProperty,\n schedule = run.schedule,\n applyMixin = Mixin._apply,\n finishPartial = Mixin.finishPartial,\n reopen = Mixin.prototype.reopen,\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n indexOf = EnumerableUtils.indexOf,\n K = Ember.K;\n\n var undefinedDescriptor = {\n configurable: true,\n writable: true,\n enumerable: false,\n value: undefined\n };\n\n var nullDescriptor = {\n configurable: true,\n writable: true,\n enumerable: false,\n value: null\n };\n\n function makeCtor() {\n\n // Note: avoid accessing any properties on the object since it makes the\n // method a lot faster. This is glue code so we want it to be as fast as\n // possible.\n\n var wasApplied = false, initMixins, initProperties;\n\n var Class = function() {\n if (!wasApplied) {\n Class.proto(); // prepare prototype...\n }\n o_defineProperty(this, GUID_KEY, nullDescriptor);\n o_defineProperty(this, '__nextSuper', undefinedDescriptor);\n var m = meta(this), proto = m.proto;\n m.proto = this;\n if (initMixins) {\n // capture locally so we can clear the closed over variable\n var mixins = initMixins;\n initMixins = null;\n apply(this, this.reopen, mixins);\n }\n if (initProperties) {\n // capture locally so we can clear the closed over variable\n var props = initProperties;\n initProperties = null;\n\n var concatenatedProperties = this.concatenatedProperties;\n\n for (var i = 0, l = props.length; i < l; i++) {\n var properties = props[i];\n\n Ember.assert(\"Ember.Object.create no longer supports mixing in other definitions, use createWithMixins instead.\", !(properties instanceof Mixin));\n\n if (typeof properties !== 'object' && properties !== undefined) {\n throw new EmberError(\"Ember.Object.create only accepts objects.\");\n }\n\n if (!properties) { continue; }\n\n var keyNames = keys(properties);\n\n for (var j = 0, ll = keyNames.length; j < ll; j++) {\n var keyName = keyNames[j];\n if (!properties.hasOwnProperty(keyName)) { continue; }\n\n var value = properties[keyName];\n\n if (IS_BINDING.test(keyName)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[keyName] = value;\n }\n\n var desc = m.descs[keyName];\n\n Ember.assert(\"Ember.Object.create no longer supports defining computed properties. Define computed properties using extend() or reopen() before calling create().\", !(value instanceof ComputedProperty));\n Ember.assert(\"Ember.Object.create no longer supports defining methods that call _super.\", !(typeof value === 'function' && value.toString().indexOf('._super') !== -1));\n Ember.assert(\"`actions` must be provided at extend time, not at create \" +\n \"time, when Ember.ActionHandler is used (i.e. views, \" +\n \"controllers & routes).\", !((keyName === 'actions') && ActionHandler.detect(this)));\n\n if (concatenatedProperties && indexOf(concatenatedProperties, keyName) >= 0) {\n var baseValue = this[keyName];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n value = baseValue.concat(value);\n } else {\n value = makeArray(baseValue).concat(value);\n }\n } else {\n value = makeArray(value);\n }\n }\n\n if (desc) {\n desc.set(this, keyName, value);\n } else {\n if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) {\n this.setUnknownProperty(keyName, value);\n } else if (MANDATORY_SETTER) {\n defineProperty(this, keyName, null, value); // setup mandatory setter\n } else {\n this[keyName] = value;\n }\n }\n }\n }\n }\n finishPartial(this, m);\n apply(this, this.init, arguments);\n m.proto = proto;\n finishChains(this);\n sendEvent(this, \"init\");\n };\n\n Class.toString = Mixin.prototype.toString;\n Class.willReopen = function() {\n if (wasApplied) {\n Class.PrototypeMixin = Mixin.create(Class.PrototypeMixin);\n }\n\n wasApplied = false;\n };\n Class._initMixins = function(args) { initMixins = args; };\n Class._initProperties = function(args) { initProperties = args; };\n\n Class.proto = function() {\n var superclass = Class.superclass;\n if (superclass) { superclass.proto(); }\n\n if (!wasApplied) {\n wasApplied = true;\n Class.PrototypeMixin.applyPartial(Class.prototype);\n rewatch(Class.prototype);\n }\n\n return this.prototype;\n };\n\n return Class;\n\n }\n\n /**\n @class CoreObject\n @namespace Ember\n */\n var CoreObject = makeCtor();\n CoreObject.toString = function() { return \"Ember.CoreObject\"; };\n\n CoreObject.PrototypeMixin = Mixin.create({\n reopen: function() {\n applyMixin(this, arguments, true);\n return this;\n },\n\n /**\n An overridable method called when objects are instantiated. By default,\n does nothing unless it is overridden during class definition.\n\n Example:\n\n ```javascript\n App.Person = Ember.Object.extend({\n init: function() {\n alert('Name is ' + this.get('name'));\n }\n });\n\n var steve = App.Person.create({\n name: \"Steve\"\n });\n\n // alerts 'Name is Steve'.\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n @method init\n */\n init: function() {},\n\n /**\n Defines the properties that will be concatenated from the superclass\n (instead of overridden).\n\n By default, when you extend an Ember class a property defined in\n the subclass overrides a property with the same name that is defined\n in the superclass. However, there are some cases where it is preferable\n to build up a property's value by combining the superclass' property\n value with the subclass' value. An example of this in use within Ember\n is the `classNames` property of `Ember.View`.\n\n Here is some sample code showing the difference between a concatenated\n property and a normal one:\n\n ```javascript\n App.BarView = Ember.View.extend({\n someNonConcatenatedProperty: ['bar'],\n classNames: ['bar']\n });\n\n App.FooBarView = App.BarView.extend({\n someNonConcatenatedProperty: ['foo'],\n classNames: ['foo'],\n });\n\n var fooBarView = App.FooBarView.create();\n fooBarView.get('someNonConcatenatedProperty'); // ['foo']\n fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']\n ```\n\n This behavior extends to object creation as well. Continuing the\n above example:\n\n ```javascript\n var view = App.FooBarView.create({\n someNonConcatenatedProperty: ['baz'],\n classNames: ['baz']\n })\n view.get('someNonConcatenatedProperty'); // ['baz']\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n Adding a single property that is not an array will just add it in the array:\n\n ```javascript\n var view = App.FooBarView.create({\n classNames: 'baz'\n })\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n\n Using the `concatenatedProperties` property, we can tell to Ember that mix\n the content of the properties.\n\n In `Ember.View` the `classNameBindings` and `attributeBindings` properties\n are also concatenated, in addition to `classNames`.\n\n This feature is available for you to use throughout the Ember object model,\n although typical app developers are likely to use it infrequently. Since\n it changes expectations about behavior of properties, you should properly\n document its usage in each individual concatenated property (to not\n mislead your users to think they can override the property in a subclass).\n\n @property concatenatedProperties\n @type Array\n @default null\n */\n concatenatedProperties: null,\n\n /**\n Destroyed object property flag.\n\n if this property is `true` the observers and bindings were already\n removed by the effect of calling the `destroy()` method.\n\n @property isDestroyed\n @default false\n */\n isDestroyed: false,\n\n /**\n Destruction scheduled flag. The `destroy()` method has been called.\n\n The object stays intact until the end of the run loop at which point\n the `isDestroyed` flag is set.\n\n @property isDestroying\n @default false\n */\n isDestroying: false,\n\n /**\n Destroys an object by setting the `isDestroyed` flag and removing its\n metadata, which effectively destroys observers and bindings.\n\n If you try to set a property on a destroyed object, an exception will be\n raised.\n\n Note that destruction is scheduled for the end of the run loop and does not\n happen immediately. It will set an isDestroying flag immediately.\n\n @method destroy\n @return {Ember.Object} receiver\n */\n destroy: function() {\n if (this.isDestroying) { return; }\n this.isDestroying = true;\n\n schedule('actions', this, this.willDestroy);\n schedule('destroy', this, this._scheduledDestroy);\n return this;\n },\n\n /**\n Override to implement teardown.\n\n @method willDestroy\n */\n willDestroy: K,\n\n /**\n Invoked by the run loop to actually destroy the object. This is\n scheduled for execution by the `destroy` method.\n\n @private\n @method _scheduledDestroy\n */\n _scheduledDestroy: function() {\n if (this.isDestroyed) { return; }\n destroy(this);\n this.isDestroyed = true;\n },\n\n bind: function(to, from) {\n if (!(from instanceof Binding)) { from = Binding.from(from); }\n from.to(to).connect(this);\n return from;\n },\n\n /**\n Returns a string representation which attempts to provide more information\n than Javascript's `toString` typically does, in a generic way for all Ember\n objects.\n\n ```javascript\n App.Person = Em.Object.extend()\n person = App.Person.create()\n person.toString() //=> \"<App.Person:ember1024>\"\n ```\n\n If the object's class is not defined on an Ember namespace, it will\n indicate it is a subclass of the registered superclass:\n\n ```javascript\n Student = App.Person.extend()\n student = Student.create()\n student.toString() //=> \"<(subclass of App.Person):ember1025>\"\n ```\n\n If the method `toStringExtension` is defined, its return value will be\n included in the output.\n\n ```javascript\n App.Teacher = App.Person.extend({\n toStringExtension: function() {\n return this.get('fullName');\n }\n });\n teacher = App.Teacher.create()\n teacher.toString(); //=> \"<App.Teacher:ember1026:Tom Dale>\"\n ```\n\n @method toString\n @return {String} string representation\n */\n toString: function toString() {\n var hasToStringExtension = typeof this.toStringExtension === 'function',\n extension = hasToStringExtension ? \":\" + this.toStringExtension() : '';\n var ret = '<'+this.constructor.toString()+':'+guidFor(this)+extension+'>';\n this.toString = makeToString(ret);\n return ret;\n }\n });\n\n CoreObject.PrototypeMixin.ownerConstructor = CoreObject;\n\n function makeToString(ret) {\n return function() { return ret; };\n }\n\n if (Ember.config.overridePrototypeMixin) {\n Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);\n }\n\n CoreObject.__super__ = null;\n\n var ClassMixin = Mixin.create({\n\n ClassMixin: required(),\n\n PrototypeMixin: required(),\n\n isClass: true,\n\n isMethod: false,\n\n /**\n Creates a new subclass.\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n alert(thing);\n }\n });\n ```\n\n This defines a new subclass of Ember.Object: `App.Person`. It contains one method: `say()`.\n\n You can also create a subclass from any existing class by calling its `extend()` method. For example, you might want to create a subclass of Ember's built-in `Ember.View` class:\n\n ```javascript\n App.PersonView = Ember.View.extend({\n tagName: 'li',\n classNameBindings: ['isAdministrator']\n });\n ```\n\n When defining a subclass, you can override methods but still access the implementation of your parent class by calling the special `_super()` method:\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n var name = this.get('name');\n alert(name + ' says: ' + thing);\n }\n });\n\n App.Soldier = App.Person.extend({\n say: function(thing) {\n this._super(thing + \", sir!\");\n },\n march: function(numberOfHours) {\n alert(this.get('name') + ' marches for ' + numberOfHours + ' hours.')\n }\n });\n\n var yehuda = App.Soldier.create({\n name: \"Yehuda Katz\"\n });\n\n yehuda.say(\"Yes\"); // alerts \"Yehuda Katz says: Yes, sir!\"\n ```\n\n The `create()` on line #17 creates an *instance* of the `App.Soldier` class. The `extend()` on line #8 creates a *subclass* of `App.Person`. Any instance of the `App.Person` class will *not* have the `march()` method.\n\n You can also pass `Mixin` classes to add additional properties to the subclass.\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n alert(this.get('name') + ' says: ' + thing);\n }\n });\n\n App.SingingMixin = Mixin.create({\n sing: function(thing){\n alert(this.get('name') + ' sings: la la la ' + thing);\n }\n });\n\n App.BroadwayStar = App.Person.extend(App.SingingMixin, {\n dance: function() {\n alert(this.get('name') + ' dances: tap tap tap tap ');\n }\n });\n ```\n\n The `App.BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`.\n\n @method extend\n @static\n\n @param {Mixin} [mixins]* One or more Mixin classes\n @param {Object} [arguments]* Object containing values to use within the new class\n */\n extend: function() {\n var Class = makeCtor(), proto;\n Class.ClassMixin = Mixin.create(this.ClassMixin);\n Class.PrototypeMixin = Mixin.create(this.PrototypeMixin);\n\n Class.ClassMixin.ownerConstructor = Class;\n Class.PrototypeMixin.ownerConstructor = Class;\n\n reopen.apply(Class.PrototypeMixin, arguments);\n\n Class.superclass = this;\n Class.__super__ = this.prototype;\n\n proto = Class.prototype = o_create(this.prototype);\n proto.constructor = Class;\n generateGuid(proto);\n meta(proto).proto = proto; // this will disable observers on prototype\n\n Class.ClassMixin.apply(Class);\n return Class;\n },\n\n /**\n Equivalent to doing `extend(arguments).create()`.\n If possible use the normal `create` method instead.\n\n @method createWithMixins\n @static\n @param [arguments]*\n */\n createWithMixins: function() {\n var C = this;\n if (arguments.length>0) { this._initMixins(arguments); }\n return new C();\n },\n\n /**\n Creates an instance of a class. Accepts either no arguments, or an object\n containing values to initialize the newly instantiated object with.\n\n ```javascript\n App.Person = Ember.Object.extend({\n helloWorld: function() {\n alert(\"Hi, my name is \" + this.get('name'));\n }\n });\n\n var tom = App.Person.create({\n name: 'Tom Dale'\n });\n\n tom.helloWorld(); // alerts \"Hi, my name is Tom Dale\".\n ```\n\n `create` will call the `init` function if defined during\n `Ember.AnyObject.extend`\n\n If no arguments are passed to `create`, it will not set values to the new\n instance during initialization:\n\n ```javascript\n var noName = App.Person.create();\n noName.helloWorld(); // alerts undefined\n ```\n\n NOTE: For performance reasons, you cannot declare methods or computed\n properties during `create`. You should instead declare methods and computed\n properties when using `extend` or use the `createWithMixins` shorthand.\n\n @method create\n @static\n @param [arguments]*\n */\n create: function() {\n var C = this;\n if (arguments.length>0) { this._initProperties(arguments); }\n return new C();\n },\n\n /**\n Augments a constructor's prototype with additional\n properties and functions:\n\n ```javascript\n MyObject = Ember.Object.extend({\n name: 'an object'\n });\n\n o = MyObject.create();\n o.get('name'); // 'an object'\n\n MyObject.reopen({\n say: function(msg){\n console.log(msg);\n }\n })\n\n o2 = MyObject.create();\n o2.say(\"hello\"); // logs \"hello\"\n\n o.say(\"goodbye\"); // logs \"goodbye\"\n ```\n\n To add functions and properties to the constructor itself,\n see `reopenClass`\n\n @method reopen\n */\n reopen: function() {\n this.willReopen();\n apply(this.PrototypeMixin, reopen, arguments);\n return this;\n },\n\n /**\n Augments a constructor's own properties and functions:\n\n ```javascript\n MyObject = Ember.Object.extend({\n name: 'an object'\n });\n\n MyObject.reopenClass({\n canBuild: false\n });\n\n MyObject.canBuild; // false\n o = MyObject.create();\n ```\n\n In other words, this creates static properties and functions for the class. These are only available on the class\n and not on any instance of that class.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name : \"\",\n sayHello : function(){\n alert(\"Hello. My name is \" + this.get('name'));\n }\n });\n\n App.Person.reopenClass({\n species : \"Homo sapiens\",\n createPerson: function(newPersonsName){\n return App.Person.create({\n name:newPersonsName\n });\n }\n });\n\n var tom = App.Person.create({\n name : \"Tom Dale\"\n });\n var yehuda = App.Person.createPerson(\"Yehuda Katz\");\n\n tom.sayHello(); // \"Hello. My name is Tom Dale\"\n yehuda.sayHello(); // \"Hello. My name is Yehuda Katz\"\n alert(App.Person.species); // \"Homo sapiens\"\n ```\n\n Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda`\n variables. They are only valid on `App.Person`.\n\n To add functions and properties to instances of\n a constructor by extending the constructor's prototype\n see `reopen`\n\n @method reopenClass\n */\n reopenClass: function() {\n apply(this.ClassMixin, reopen, arguments);\n applyMixin(this, arguments, false);\n return this;\n },\n\n detect: function(obj) {\n if ('function' !== typeof obj) { return false; }\n while(obj) {\n if (obj===this) { return true; }\n obj = obj.superclass;\n }\n return false;\n },\n\n detectInstance: function(obj) {\n return obj instanceof this;\n },\n\n /**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For\n example, computed property functions may close over variables that are then\n no longer available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```javascript\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n Once you've done this, you can retrieve the values saved to the computed\n property from your class like this:\n\n ```javascript\n MyClass.metaForProperty('person');\n ```\n\n This will return the original hash that was passed to `meta()`.\n\n @method metaForProperty\n @param key {String} property name\n */\n metaForProperty: function(key) {\n var meta = this.proto()[META_KEY],\n desc = meta && meta.descs[key];\n\n Ember.assert(\"metaForProperty() could not find a computed property with key '\"+key+\"'.\", !!desc && desc instanceof ComputedProperty);\n return desc._meta || {};\n },\n\n /**\n Iterate over each computed property for the class, passing its name\n and any associated metadata (see `metaForProperty`) to the callback.\n\n @method eachComputedProperty\n @param {Function} callback\n @param {Object} binding\n */\n eachComputedProperty: function(callback, binding) {\n var proto = this.proto(),\n descs = meta(proto).descs,\n empty = {},\n property;\n\n for (var name in descs) {\n property = descs[name];\n\n if (property instanceof ComputedProperty) {\n callback.call(binding || this, name, property._meta || empty);\n }\n }\n }\n\n });\n\n ClassMixin.ownerConstructor = CoreObject;\n\n if (Ember.config.overrideClassMixin) {\n Ember.config.overrideClassMixin(ClassMixin);\n }\n\n CoreObject.ClassMixin = ClassMixin;\n ClassMixin.apply(CoreObject);\n\n __exports__[\"default\"] = CoreObject;\n });\ndefine(\"ember-runtime/system/deferred\",\n [\"ember-runtime/mixins/deferred\",\"ember-metal/property_get\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var DeferredMixin = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var EmberObject = __dependency3__[\"default\"];\n\n var Deferred = EmberObject.extend(DeferredMixin);\n\n Deferred.reopenClass({\n promise: function(callback, binding) {\n var deferred = Deferred.create();\n callback.call(binding, deferred);\n return deferred;\n }\n });\n\n __exports__[\"default\"] = Deferred;\n });\ndefine(\"ember-runtime/system/each_proxy\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/enumerable_utils\",\"ember-metal/array\",\"ember-runtime/mixins/array\",\"ember-runtime/system/object\",\"ember-metal/computed\",\"ember-metal/observer\",\"ember-metal/events\",\"ember-metal/properties\",\"ember-metal/property_events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n var EnumerableUtils = __dependency5__[\"default\"];\n var indexOf = __dependency6__.indexOf;\n var EmberArray = __dependency7__[\"default\"];\n // ES6TODO: WAT? Circular dep?\n var EmberObject = __dependency8__[\"default\"];\n var computed = __dependency9__.computed;\n var addObserver = __dependency10__.addObserver;\n var addBeforeObserver = __dependency10__.addBeforeObserver;\n var removeBeforeObserver = __dependency10__.removeBeforeObserver;\n var removeObserver = __dependency10__.removeObserver;\n var typeOf = __dependency4__.typeOf;\n var watchedEvents = __dependency11__.watchedEvents;\n var defineProperty = __dependency12__.defineProperty;\n var beginPropertyChanges = __dependency13__.beginPropertyChanges;\n var propertyDidChange = __dependency13__.propertyDidChange;\n var propertyWillChange = __dependency13__.propertyWillChange;\n var endPropertyChanges = __dependency13__.endPropertyChanges;\n var changeProperties = __dependency13__.changeProperties;\n\n var forEach = EnumerableUtils.forEach;\n\n var EachArray = EmberObject.extend(EmberArray, {\n\n init: function(content, keyName, owner) {\n this._super();\n this._keyName = keyName;\n this._owner = owner;\n this._content = content;\n },\n\n objectAt: function(idx) {\n var item = this._content.objectAt(idx);\n return item && get(item, this._keyName);\n },\n\n length: computed(function() {\n var content = this._content;\n return content ? get(content, 'length') : 0;\n })\n\n });\n\n var IS_OBSERVER = /^.+:(before|change)$/;\n\n function addObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects, guid;\n if (!objects) objects = proxy._objects = {};\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.assert('When using @each to observe the array ' + content + ', the array must return an object', typeOf(item) === 'instance' || typeOf(item) === 'object');\n addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n addObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n // keep track of the index each item was found at so we can map\n // it back when the obj changes.\n guid = guidFor(item);\n if (!objects[guid]) objects[guid] = [];\n objects[guid].push(loc);\n }\n }\n }\n\n function removeObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects;\n if (!objects) objects = proxy._objects = {};\n var indicies, guid;\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n removeObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n guid = guidFor(item);\n indicies = objects[guid];\n indicies[indexOf.call(indicies, loc)] = null;\n }\n }\n }\n\n /**\n This is the object instance returned when you get the `@each` property on an\n array. It uses the unknownProperty handler to automatically create\n EachArray instances for property names.\n\n @private\n @class EachProxy\n @namespace Ember\n @extends Ember.Object\n */\n var EachProxy = EmberObject.extend({\n\n init: function(content) {\n this._super();\n this._content = content;\n content.addArrayObserver(this);\n\n // in case someone is already observing some keys make sure they are\n // added\n forEach(watchedEvents(this), function(eventName) {\n this.didAddListener(eventName);\n }, this);\n },\n\n /**\n You can directly access mapped properties by simply requesting them.\n The `unknownProperty` handler will generate an EachArray of each item.\n\n @method unknownProperty\n @param keyName {String}\n @param value {*}\n */\n unknownProperty: function(keyName, value) {\n var ret;\n ret = new EachArray(this._content, keyName, this);\n defineProperty(this, keyName, null, ret);\n this.beginObservingContentKey(keyName);\n return ret;\n },\n\n // ..........................................................\n // ARRAY CHANGES\n // Invokes whenever the content array itself changes.\n\n arrayWillChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = removedCnt>0 ? idx+removedCnt : -1;\n beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) { removeObserverForContentKey(content, key, this, idx, lim); }\n\n propertyWillChange(this, key);\n }\n\n propertyWillChange(this._content, '@each');\n endPropertyChanges(this);\n },\n\n arrayDidChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, lim;\n\n lim = addedCnt>0 ? idx+addedCnt : -1;\n changeProperties(function() {\n for(var key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) { addObserverForContentKey(content, key, this, idx, lim); }\n\n propertyDidChange(this, key);\n }\n\n propertyDidChange(this._content, '@each');\n }, this);\n },\n\n // ..........................................................\n // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS\n // Start monitoring keys based on who is listening...\n\n didAddListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.beginObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n didRemoveListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.stopObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n // ..........................................................\n // CONTENT KEY OBSERVING\n // Actual watch keys on the source content.\n\n beginObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (!keys) keys = this._keys = {};\n if (!keys[keyName]) {\n keys[keyName] = 1;\n var content = this._content,\n len = get(content, 'length');\n addObserverForContentKey(content, keyName, this, 0, len);\n } else {\n keys[keyName]++;\n }\n },\n\n stopObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {\n var content = this._content,\n len = get(content, 'length');\n removeObserverForContentKey(content, keyName, this, 0, len);\n }\n },\n\n contentKeyWillChange: function(obj, keyName) {\n propertyWillChange(this, keyName);\n },\n\n contentKeyDidChange: function(obj, keyName) {\n propertyDidChange(this, keyName);\n }\n\n });\n\n __exports__.EachArray = EachArray;\n __exports__.EachProxy = EachProxy;\n });\ndefine(\"ember-runtime/system/lazy_load\",\n [\"ember-metal/core\",\"ember-metal/array\",\"ember-runtime/system/native_array\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /*globals CustomEvent */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.ENV.EMBER_LOAD_HOOKS\n var forEach = __dependency2__.forEach;\n // make sure Ember.A is setup.\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var loadHooks = Ember.ENV.EMBER_LOAD_HOOKS || {};\n var loaded = {};\n\n /**\n Detects when a specific package of Ember (e.g. 'Ember.Handlebars')\n has fully loaded and is available for extension.\n\n The provided `callback` will be called with the `name` passed\n resolved from a string into the object:\n\n ``` javascript\n Ember.onLoad('Ember.Handlebars' function(hbars) {\n hbars.registerHelper(...);\n });\n ```\n\n @method onLoad\n @for Ember\n @param name {String} name of hook\n @param callback {Function} callback to be called\n */\n function onLoad(name, callback) {\n var object;\n\n loadHooks[name] = loadHooks[name] || Ember.A();\n loadHooks[name].pushObject(callback);\n\n if (object = loaded[name]) {\n callback(object);\n }\n };\n\n /**\n Called when an Ember.js package (e.g Ember.Handlebars) has finished\n loading. Triggers any callbacks registered for this event.\n\n @method runLoadHooks\n @for Ember\n @param name {String} name of hook\n @param object {Object} object to pass to callbacks\n */\n function runLoadHooks(name, object) {\n loaded[name] = object;\n\n if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === \"function\") {\n var event = new CustomEvent(name, {detail: object, name: name});\n window.dispatchEvent(event);\n }\n\n if (loadHooks[name]) {\n forEach.call(loadHooks[name], function(callback) {\n callback(object);\n });\n }\n };\n\n __exports__.onLoad = onLoad;\n __exports__.runLoadHooks = runLoadHooks;\n });\ndefine(\"ember-runtime/system/namespace\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/array\",\"ember-metal/utils\",\"ember-metal/mixin\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n // Ember.lookup, Ember.BOOTED, Ember.deprecate, Ember.NAME_KEY, Ember.anyUnprocessedMixins\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var indexOf = __dependency3__.indexOf;\n var GUID_KEY = __dependency4__.GUID_KEY;\n var guidFor = __dependency4__.guidFor;\n var Mixin = __dependency5__.Mixin;\n\n var EmberObject = __dependency6__[\"default\"];\n\n /**\n A Namespace is an object usually used to contain other objects or methods\n such as an application or framework. Create a namespace anytime you want\n to define one of these new containers.\n\n # Example Usage\n\n ```javascript\n MyFramework = Ember.Namespace.create({\n VERSION: '1.0.0'\n });\n ```\n\n @class Namespace\n @namespace Ember\n @extends Ember.Object\n */\n var Namespace = EmberObject.extend({\n isNamespace: true,\n\n init: function() {\n Namespace.NAMESPACES.push(this);\n Namespace.PROCESSED = false;\n },\n\n toString: function() {\n var name = get(this, 'name');\n if (name) { return name; }\n\n findNamespaces();\n return this[NAME_KEY];\n },\n\n nameClasses: function() {\n processNamespace([this.toString()], this, {});\n },\n\n destroy: function() {\n var namespaces = Namespace.NAMESPACES,\n toString = this.toString();\n\n if (toString) {\n Ember.lookup[toString] = undefined;\n delete Namespace.NAMESPACES_BY_ID[toString];\n }\n namespaces.splice(indexOf.call(namespaces, this), 1);\n this._super();\n }\n });\n\n Namespace.reopenClass({\n NAMESPACES: [Ember],\n NAMESPACES_BY_ID: {},\n PROCESSED: false,\n processAll: processAllNamespaces,\n byName: function(name) {\n if (!Ember.BOOTED) {\n processAllNamespaces();\n }\n\n return NAMESPACES_BY_ID[name];\n }\n });\n\n var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;\n\n var hasOwnProp = ({}).hasOwnProperty;\n\n function processNamespace(paths, root, seen) {\n var idx = paths.length;\n\n NAMESPACES_BY_ID[paths.join('.')] = root;\n\n // Loop over all of the keys in the namespace, looking for classes\n for(var key in root) {\n if (!hasOwnProp.call(root, key)) { continue; }\n var obj = root[key];\n\n // If we are processing the `Ember` namespace, for example, the\n // `paths` will start with `[\"Ember\"]`. Every iteration through\n // the loop will update the **second** element of this list with\n // the key, so processing `Ember.View` will make the Array\n // `['Ember', 'View']`.\n paths[idx] = key;\n\n // If we have found an unprocessed class\n if (obj && obj.toString === classToString) {\n // Replace the class' `toString` with the dot-separated path\n // and set its `NAME_KEY`\n obj.toString = makeToString(paths.join('.'));\n obj[NAME_KEY] = paths.join('.');\n\n // Support nested namespaces\n } else if (obj && obj.isNamespace) {\n // Skip aliased namespaces\n if (seen[guidFor(obj)]) { continue; }\n seen[guidFor(obj)] = true;\n\n // Process the child namespace\n processNamespace(paths, obj, seen);\n }\n }\n\n paths.length = idx; // cut out last item\n }\n\n var STARTS_WITH_UPPERCASE = /^[A-Z]/;\n\n function findNamespaces() {\n var lookup = Ember.lookup, obj, isNamespace;\n\n if (Namespace.PROCESSED) { return; }\n\n for (var prop in lookup) {\n // Only process entities that start with uppercase A-Z\n if (!STARTS_WITH_UPPERCASE.test(prop)) { continue; }\n\n // Unfortunately, some versions of IE don't support window.hasOwnProperty\n if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }\n\n // At times we are not allowed to access certain properties for security reasons.\n // There are also times where even if we can access them, we are not allowed to access their properties.\n try {\n obj = lookup[prop];\n isNamespace = obj && obj.isNamespace;\n } catch (e) {\n continue;\n }\n\n if (isNamespace) {\n obj[NAME_KEY] = prop;\n }\n }\n }\n\n var NAME_KEY = Ember.NAME_KEY = GUID_KEY + '_name';\n\n function superClassString(mixin) {\n var superclass = mixin.superclass;\n if (superclass) {\n if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }\n else { return superClassString(superclass); }\n } else {\n return;\n }\n }\n\n function classToString() {\n if (!Ember.BOOTED && !this[NAME_KEY]) {\n processAllNamespaces();\n }\n\n var ret;\n\n if (this[NAME_KEY]) {\n ret = this[NAME_KEY];\n } else if (this._toString) {\n ret = this._toString;\n } else {\n var str = superClassString(this);\n if (str) {\n ret = \"(subclass of \" + str + \")\";\n } else {\n ret = \"(unknown mixin)\";\n }\n this.toString = makeToString(ret);\n }\n\n return ret;\n }\n\n function processAllNamespaces() {\n var unprocessedNamespaces = !Namespace.PROCESSED,\n unprocessedMixins = Ember.anyUnprocessedMixins;\n\n if (unprocessedNamespaces) {\n findNamespaces();\n Namespace.PROCESSED = true;\n }\n\n if (unprocessedNamespaces || unprocessedMixins) {\n var namespaces = Namespace.NAMESPACES, namespace;\n for (var i=0, l=namespaces.length; i<l; i++) {\n namespace = namespaces[i];\n processNamespace([namespace.toString()], namespace, {});\n }\n\n Ember.anyUnprocessedMixins = false;\n }\n }\n\n function makeToString(ret) {\n return function() { return ret; };\n }\n\n Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB.\n\n __exports__[\"default\"] = Namespace;\n });\ndefine(\"ember-runtime/system/native_array\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/enumerable_utils\",\"ember-metal/mixin\",\"ember-runtime/mixins/array\",\"ember-runtime/mixins/mutable_array\",\"ember-runtime/mixins/observable\",\"ember-runtime/mixins/copyable\",\"ember-runtime/mixins/freezable\",\"ember-runtime/copy\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.EXTEND_PROTOTYPES\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EnumerableUtils = __dependency4__[\"default\"];\n var Mixin = __dependency5__.Mixin;\n var EmberArray = __dependency6__[\"default\"];\n var MutableArray = __dependency7__[\"default\"];\n var Observable = __dependency8__[\"default\"];\n var Copyable = __dependency9__[\"default\"];\n var FROZEN_ERROR = __dependency10__.FROZEN_ERROR;\n var copy = __dependency11__[\"default\"];\n\n var replace = EnumerableUtils._replace,\n forEach = EnumerableUtils.forEach;\n\n // Add Ember.Array to Array.prototype. Remove methods with native\n // implementations and supply some more optimized versions of generic methods\n // because they are so common.\n\n /**\n The NativeArray mixin contains the properties needed to to make the native\n Array support Ember.MutableArray and all of its dependent APIs. Unless you\n have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to\n false, this will be applied automatically. Otherwise you can apply the mixin\n at anytime by calling `Ember.NativeArray.activate`.\n\n @class NativeArray\n @namespace Ember\n @uses Ember.MutableArray\n @uses Ember.Observable\n @uses Ember.Copyable\n */\n var NativeArray = Mixin.create(MutableArray, Observable, Copyable, {\n\n // because length is a built-in property we need to know to just get the\n // original property.\n get: function(key) {\n if (key==='length') return this.length;\n else if ('number' === typeof key) return this[key];\n else return this._super(key);\n },\n\n objectAt: function(idx) {\n return this[idx];\n },\n\n // primitive for array support.\n replace: function(idx, amt, objects) {\n\n if (this.isFrozen) throw FROZEN_ERROR;\n\n // if we replaced exactly the same number of items, then pass only the\n // replaced range. Otherwise, pass the full remaining array length\n // since everything has shifted\n var len = objects ? get(objects, 'length') : 0;\n this.arrayContentWillChange(idx, amt, len);\n\n if (len === 0) {\n this.splice(idx, amt);\n } else {\n replace(this, idx, amt, objects);\n }\n\n this.arrayContentDidChange(idx, amt, len);\n return this;\n },\n\n // If you ask for an unknown property, then try to collect the value\n // from member items.\n unknownProperty: function(key, value) {\n var ret;// = this.reducedProperty(key, value) ;\n if ((value !== undefined) && ret === undefined) {\n ret = this[key] = value;\n }\n return ret ;\n },\n\n // If browser did not implement indexOf natively, then override with\n // specialized version\n indexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = 0;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n lastIndexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = len-1;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n copy: function(deep) {\n if (deep) {\n return this.map(function(item) { return copy(item, true); });\n }\n\n return this.slice();\n }\n });\n\n // Remove any methods implemented natively so we don't override them\n var ignore = ['length'];\n forEach(NativeArray.keys(), function(methodName) {\n if (Array.prototype[methodName]) ignore.push(methodName);\n });\n\n if (ignore.length>0) {\n NativeArray = NativeArray.without.apply(NativeArray, ignore);\n }\n\n /**\n Creates an `Ember.NativeArray` from an Array like object.\n Does not modify the original object. Ember.A is not needed if\n `Ember.EXTEND_PROTOTYPES` is `true` (the default value). However,\n it is recommended that you use Ember.A when creating addons for\n ember or when you can not guarantee that `Ember.EXTEND_PROTOTYPES`\n will be `true`.\n\n Example\n\n ```js\n var Pagination = Ember.CollectionView.extend({\n tagName: 'ul',\n classNames: ['pagination'],\n\n init: function() {\n this._super();\n if (!this.get('content')) {\n this.set('content', Ember.A());\n }\n }\n });\n ```\n\n @method A\n @for Ember\n @return {Ember.NativeArray}\n */\n var A = function(arr) {\n if (arr === undefined) { arr = []; }\n return EmberArray.detect(arr) ? arr : NativeArray.apply(arr);\n };\n\n /**\n Activates the mixin on the Array.prototype if not already applied. Calling\n this method more than once is safe. This will be called when ember is loaded\n unless you have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array`\n set to `false`.\n\n Example\n\n ```js\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n Ember.NativeArray.activate();\n }\n ```\n\n @method activate\n @for Ember.NativeArray\n @static\n @return {void}\n */\n NativeArray.activate = function() {\n NativeArray.apply(Array.prototype);\n\n A = function(arr) { return arr || []; };\n };\n\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n NativeArray.activate();\n }\n\n Ember.A = A; // ES6TODO: Setting A onto the object returned by ember-metal/core to avoid circles\n __exports__.A = A;\n __exports__.NativeArray = NativeArray;__exports__[\"default\"] = NativeArray;\n });\ndefine(\"ember-runtime/system/object\",\n [\"ember-runtime/system/core_object\",\"ember-runtime/mixins/observable\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var CoreObject = __dependency1__[\"default\"];\n var Observable = __dependency2__[\"default\"];\n\n /**\n `Ember.Object` is the main base class for all Ember objects. It is a subclass\n of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,\n see the documentation for each of these.\n\n @class Object\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.Observable\n */\n var EmberObject = CoreObject.extend(Observable);\n EmberObject.toString = function() { return \"Ember.Object\"; };\n\n __exports__[\"default\"] = EmberObject;\n });\ndefine(\"ember-runtime/system/object_proxy\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/observer\",\"ember-metal/property_events\",\"ember-metal/computed\",\"ember-metal/properties\",\"ember-metal/mixin\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var meta = __dependency4__.meta;\n var addObserver = __dependency5__.addObserver;\n var removeObserver = __dependency5__.removeObserver;\n var addBeforeObserver = __dependency5__.addBeforeObserver;\n var removeBeforeObserver = __dependency5__.removeBeforeObserver;\n var propertyWillChange = __dependency6__.propertyWillChange;\n var propertyDidChange = __dependency6__.propertyDidChange;\n var computed = __dependency7__.computed;\n var defineProperty = __dependency8__.defineProperty;\n var observer = __dependency9__.observer;\n var fmt = __dependency10__.fmt;\n var EmberObject = __dependency11__[\"default\"];\n\n function contentPropertyWillChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyWillChange(this, key);\n }\n\n function contentPropertyDidChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyDidChange(this, key);\n }\n\n /**\n `Ember.ObjectProxy` forwards all properties not defined by the proxy itself\n to a proxied `content` object.\n\n ```javascript\n object = Ember.Object.create({\n name: 'Foo'\n });\n\n proxy = Ember.ObjectProxy.create({\n content: object\n });\n\n // Access and change existing properties\n proxy.get('name') // 'Foo'\n proxy.set('name', 'Bar');\n object.get('name') // 'Bar'\n\n // Create new 'description' property on `object`\n proxy.set('description', 'Foo is a whizboo baz');\n object.get('description') // 'Foo is a whizboo baz'\n ```\n\n While `content` is unset, setting a property to be delegated will throw an\n Error.\n\n ```javascript\n proxy = Ember.ObjectProxy.create({\n content: null,\n flag: null\n });\n proxy.set('flag', true);\n proxy.get('flag'); // true\n proxy.get('foo'); // undefined\n proxy.set('foo', 'data'); // throws Error\n ```\n\n Delegated properties can be bound to and will change when content is updated.\n\n Computed properties on the proxy itself can depend on delegated properties.\n\n ```javascript\n ProxyWithComputedProperty = Ember.ObjectProxy.extend({\n fullName: function () {\n var firstName = this.get('firstName'),\n lastName = this.get('lastName');\n if (firstName && lastName) {\n return firstName + ' ' + lastName;\n }\n return firstName || lastName;\n }.property('firstName', 'lastName')\n });\n\n proxy = ProxyWithComputedProperty.create();\n\n proxy.get('fullName'); // undefined\n proxy.set('content', {\n firstName: 'Tom', lastName: 'Dale'\n }); // triggers property change for fullName on proxy\n\n proxy.get('fullName'); // 'Tom Dale'\n ```\n\n @class ObjectProxy\n @namespace Ember\n @extends Ember.Object\n */\n var ObjectProxy = EmberObject.extend({\n /**\n The object whose properties will be forwarded.\n\n @property content\n @type Ember.Object\n @default null\n */\n content: null,\n _contentDidChange: observer('content', function() {\n Ember.assert(\"Can't set ObjectProxy's content to itself\", get(this, 'content') !== this);\n }),\n\n isTruthy: computed.bool('content'),\n\n _debugContainerKey: null,\n\n willWatchProperty: function (key) {\n var contentKey = 'content.' + key;\n addBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n addObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n didUnwatchProperty: function (key) {\n var contentKey = 'content.' + key;\n removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n removeObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n unknownProperty: function (key) {\n var content = get(this, 'content');\n if (content) {\n return get(content, key);\n }\n },\n\n setUnknownProperty: function (key, value) {\n var m = meta(this);\n if (m.proto === this) {\n // if marked as prototype then just defineProperty\n // rather than delegate\n defineProperty(this, key, null, value);\n return value;\n }\n\n var content = get(this, 'content');\n Ember.assert(fmt(\"Cannot delegate set('%@', %@) to the 'content' property of object proxy %@: its 'content' is undefined.\", [key, value, this]), content);\n return set(content, key, value);\n }\n\n });\n\n __exports__[\"default\"] = ObjectProxy;\n });\ndefine(\"ember-runtime/system/set\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/is_none\",\"ember-runtime/system/string\",\"ember-runtime/system/core_object\",\"ember-runtime/mixins/mutable_enumerable\",\"ember-runtime/mixins/enumerable\",\"ember-runtime/mixins/copyable\",\"ember-runtime/mixins/freezable\",\"ember-metal/error\",\"ember-metal/property_events\",\"ember-metal/mixin\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.isNone\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n var isNone = __dependency5__.isNone;\n var fmt = __dependency6__.fmt;\n var CoreObject = __dependency7__[\"default\"];\n var MutableEnumerable = __dependency8__[\"default\"];\n var Enumerable = __dependency9__[\"default\"];\n var Copyable = __dependency10__[\"default\"];\n var Freezable = __dependency11__.Freezable;\n var FROZEN_ERROR = __dependency11__.FROZEN_ERROR;\n var EmberError = __dependency12__[\"default\"];\n var propertyWillChange = __dependency13__.propertyWillChange;\n var propertyDidChange = __dependency13__.propertyDidChange;\n var aliasMethod = __dependency14__.aliasMethod;\n var computed = __dependency15__.computed;\n\n /**\n An unordered collection of objects.\n\n A Set works a bit like an array except that its items are not ordered. You\n can create a set to efficiently test for membership for an object. You can\n also iterate through a set just like an array, even accessing objects by\n index, however there is no guarantee as to their order.\n\n All Sets are observable via the Enumerable Observer API - which works\n on any enumerable object including both Sets and Arrays.\n\n ## Creating a Set\n\n You can create a set like you would most objects using\n `new Ember.Set()`. Most new sets you create will be empty, but you can\n also initialize the set with some content by passing an array or other\n enumerable of objects to the constructor.\n\n Finally, you can pass in an existing set and the set will be copied. You\n can also create a copy of a set by calling `Ember.Set#copy()`.\n\n ```javascript\n // creates a new empty set\n var foundNames = new Ember.Set();\n\n // creates a set with four names in it.\n var names = new Ember.Set([\"Charles\", \"Tom\", \"Juan\", \"Alex\"]); // :P\n\n // creates a copy of the names set.\n var namesCopy = new Ember.Set(names);\n\n // same as above.\n var anotherNamesCopy = names.copy();\n ```\n\n ## Adding/Removing Objects\n\n You generally add or remove objects from a set using `add()` or\n `remove()`. You can add any type of object including primitives such as\n numbers, strings, and booleans.\n\n Unlike arrays, objects can only exist one time in a set. If you call `add()`\n on a set with the same object multiple times, the object will only be added\n once. Likewise, calling `remove()` with the same object multiple times will\n remove the object the first time and have no effect on future calls until\n you add the object to the set again.\n\n NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do\n so will be ignored.\n\n In addition to add/remove you can also call `push()`/`pop()`. Push behaves\n just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary\n object, remove it and return it. This is a good way to use a set as a job\n queue when you don't care which order the jobs are executed in.\n\n ## Testing for an Object\n\n To test for an object's presence in a set you simply call\n `Ember.Set#contains()`.\n\n ## Observing changes\n\n When using `Ember.Set`, you can observe the `\"[]\"` property to be\n alerted whenever the content changes. You can also add an enumerable\n observer to the set to be notified of specific objects that are added and\n removed from the set. See [Ember.Enumerable](/api/classes/Ember.Enumerable.html)\n for more information on enumerables.\n\n This is often unhelpful. If you are filtering sets of objects, for instance,\n it is very inefficient to re-filter all of the items each time the set\n changes. It would be better if you could just adjust the filtered set based\n on what was changed on the original set. The same issue applies to merging\n sets, as well.\n\n ## Other Methods\n\n `Ember.Set` primary implements other mixin APIs. For a complete reference\n on the methods you will use with `Ember.Set`, please consult these mixins.\n The most useful ones will be `Ember.Enumerable` and\n `Ember.MutableEnumerable` which implement most of the common iterator\n methods you are used to on Array.\n\n Note that you can also use the `Ember.Copyable` and `Ember.Freezable`\n APIs on `Ember.Set` as well. Once a set is frozen it can no longer be\n modified. The benefit of this is that when you call `frozenCopy()` on it,\n Ember will avoid making copies of the set. This allows you to write\n code that can know with certainty when the underlying set data will or\n will not be modified.\n\n @class Set\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.MutableEnumerable\n @uses Ember.Copyable\n @uses Ember.Freezable\n @since Ember 0.9\n */\n var Set = CoreObject.extend(MutableEnumerable, Copyable, Freezable,\n {\n\n // ..........................................................\n // IMPLEMENT ENUMERABLE APIS\n //\n\n /**\n This property will change as the number of objects in the set changes.\n\n @property length\n @type number\n @default 0\n */\n length: 0,\n\n /**\n Clears the set. This is useful if you want to reuse an existing set\n without having to recreate it.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.length; // 3\n colors.clear();\n colors.length; // 0\n ```\n\n @method clear\n @return {Ember.Set} An empty Set\n */\n clear: function() {\n if (this.isFrozen) { throw new EmberError(FROZEN_ERROR); }\n\n var len = get(this, 'length');\n if (len === 0) { return this; }\n\n var guid;\n\n this.enumerableContentWillChange(len, 0);\n propertyWillChange(this, 'firstObject');\n propertyWillChange(this, 'lastObject');\n\n for (var i=0; i < len; i++) {\n guid = guidFor(this[i]);\n delete this[guid];\n delete this[i];\n }\n\n set(this, 'length', 0);\n\n propertyDidChange(this, 'firstObject');\n propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(len, 0);\n\n return this;\n },\n\n /**\n Returns true if the passed object is also an enumerable that contains the\n same objects as the receiver.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"],\n same_colors = new Ember.Set(colors);\n\n same_colors.isEqual(colors); // true\n same_colors.isEqual([\"purple\", \"brown\"]); // false\n ```\n\n @method isEqual\n @param {Ember.Set} obj the other object.\n @return {Boolean}\n */\n isEqual: function(obj) {\n // fail fast\n if (!Enumerable.detect(obj)) return false;\n\n var loc = get(this, 'length');\n if (get(obj, 'length') !== loc) return false;\n\n while(--loc >= 0) {\n if (!obj.contains(this[loc])) return false;\n }\n\n return true;\n },\n\n /**\n Adds an object to the set. Only non-`null` objects can be added to a set\n and those can only be added once. If the object is already in the set or\n the passed value is null this method will have no effect.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"red\"); // [\"blue\", \"red\"]\n colors.add(null); // [\"blue\", \"red\"]\n colors.add(undefined); // [\"blue\", \"red\"]\n ```\n\n @method add\n @param {Object} obj The object to add.\n @return {Ember.Set} The set itself.\n */\n add: aliasMethod('addObject'),\n\n /**\n Removes the object from the set if it is found. If you pass a `null` value\n or an object that is already not in the set, this method will have no\n effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.remove(\"red\"); // [\"blue\", \"green\"]\n colors.remove(\"purple\"); // [\"blue\", \"green\"]\n colors.remove(null); // [\"blue\", \"green\"]\n ```\n\n @method remove\n @param {Object} obj The object to remove\n @return {Ember.Set} The set itself.\n */\n remove: aliasMethod('removeObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.pop(); // \"blue\"\n colors.pop(); // \"green\"\n colors.pop(); // null\n ```\n\n @method pop\n @return {Object} The removed object from the set or null.\n */\n pop: function() {\n if (get(this, 'isFrozen')) throw new EmberError(FROZEN_ERROR);\n var obj = this.length > 0 ? this[this.length-1] : null;\n this.remove(obj);\n return obj;\n },\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.push(\"red\"); // [\"red\"]\n colors.push(\"green\"); // [\"red\", \"green\"]\n colors.push(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method push\n @return {Ember.Set} The set itself.\n */\n push: aliasMethod('addObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n This is an alias for `Ember.Set.pop()`.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.shift(); // \"blue\"\n colors.shift(); // \"green\"\n colors.shift(); // null\n ```\n\n @method shift\n @return {Object} The removed object from the set or null.\n */\n shift: aliasMethod('pop'),\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias of `Ember.Set.push()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.unshift(\"red\"); // [\"red\"]\n colors.unshift(\"green\"); // [\"red\", \"green\"]\n colors.unshift(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method unshift\n @return {Ember.Set} The set itself.\n */\n unshift: aliasMethod('push'),\n\n /**\n Adds each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.addObjects()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.addEach([\"red\", \"green\", \"blue\"]); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method addEach\n @param {Ember.Enumerable} objects the objects to add.\n @return {Ember.Set} The set itself.\n */\n addEach: aliasMethod('addObjects'),\n\n /**\n Removes each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.removeObjects()`\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.removeEach([\"red\", \"blue\"]); // [\"green\"]\n ```\n\n @method removeEach\n @param {Ember.Enumerable} objects the objects to remove.\n @return {Ember.Set} The set itself.\n */\n removeEach: aliasMethod('removeObjects'),\n\n // ..........................................................\n // PRIVATE ENUMERABLE SUPPORT\n //\n\n init: function(items) {\n this._super();\n if (items) this.addObjects(items);\n },\n\n // implement Ember.Enumerable\n nextObject: function(idx) {\n return this[idx];\n },\n\n // more optimized version\n firstObject: computed(function() {\n return this.length > 0 ? this[0] : undefined;\n }),\n\n // more optimized version\n lastObject: computed(function() {\n return this.length > 0 ? this[this.length-1] : undefined;\n }),\n\n // implements Ember.MutableEnumerable\n addObject: function(obj) {\n if (get(this, 'isFrozen')) throw new EmberError(FROZEN_ERROR);\n if (isNone(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n added ;\n\n if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added\n\n added = [obj];\n\n this.enumerableContentWillChange(null, added);\n propertyWillChange(this, 'lastObject');\n\n len = get(this, 'length');\n this[guid] = len;\n this[len] = obj;\n set(this, 'length', len+1);\n\n propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(null, added);\n\n return this;\n },\n\n // implements Ember.MutableEnumerable\n removeObject: function(obj) {\n if (get(this, 'isFrozen')) throw new EmberError(FROZEN_ERROR);\n if (isNone(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n isFirst = idx === 0,\n isLast = idx === len-1,\n last, removed;\n\n\n if (idx>=0 && idx<len && (this[idx] === obj)) {\n removed = [obj];\n\n this.enumerableContentWillChange(removed, null);\n if (isFirst) { propertyWillChange(this, 'firstObject'); }\n if (isLast) { propertyWillChange(this, 'lastObject'); }\n\n // swap items - basically move the item to the end so it can be removed\n if (idx < len-1) {\n last = this[len-1];\n this[idx] = last;\n this[guidFor(last)] = idx;\n }\n\n delete this[guid];\n delete this[len-1];\n set(this, 'length', len-1);\n\n if (isFirst) { propertyDidChange(this, 'firstObject'); }\n if (isLast) { propertyDidChange(this, 'lastObject'); }\n this.enumerableContentDidChange(removed, null);\n }\n\n return this;\n },\n\n // optimized version\n contains: function(obj) {\n return this[guidFor(obj)]>=0;\n },\n\n copy: function() {\n var C = this.constructor, ret = new C(), loc = get(this, 'length');\n set(ret, 'length', loc);\n while(--loc>=0) {\n ret[loc] = this[loc];\n ret[guidFor(this[loc])] = loc;\n }\n return ret;\n },\n\n toString: function() {\n var len = this.length, idx, array = [];\n for(idx = 0; idx < len; idx++) {\n array[idx] = this[idx];\n }\n return fmt(\"Ember.Set<%@>\", [array.join(',')]);\n }\n\n });\n\n\n __exports__[\"default\"] = Set;\n });\ndefine(\"ember-runtime/system/string\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.STRINGS, Ember.FEATURES\n var EmberInspect = __dependency2__.inspect;\n\n\n var STRING_DASHERIZE_REGEXP = (/[ _]/g);\n var STRING_DASHERIZE_CACHE = {};\n var STRING_DECAMELIZE_REGEXP = (/([a-z\\d])([A-Z])/g);\n var STRING_CAMELIZE_REGEXP = (/(\\-|_|\\.|\\s)+(.)?/g);\n var STRING_UNDERSCORE_REGEXP_1 = (/([a-z\\d])([A-Z]+)/g);\n var STRING_UNDERSCORE_REGEXP_2 = (/\\-|\\s+/g);\n\n function fmt(str, formats) {\n // first, replace any ORDERED replacements.\n var idx = 0; // the current index for non-numerical replacements\n return str.replace(/%@([0-9]+)?/g, function(s, argIndex) {\n argIndex = (argIndex) ? parseInt(argIndex, 10) - 1 : idx++;\n s = formats[argIndex];\n return (s === null) ? '(null)' : (s === undefined) ? '' : EmberInspect(s);\n }) ;\n }\n\n function loc(str, formats) {\n str = Ember.STRINGS[str] || str;\n return fmt(str, formats);\n }\n\n function w(str) {\n return str.split(/\\s+/);\n }\n\n function decamelize(str) {\n return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();\n }\n\n function dasherize(str) {\n var cache = STRING_DASHERIZE_CACHE,\n hit = cache.hasOwnProperty(str),\n ret;\n\n if (hit) {\n return cache[str];\n } else {\n ret = decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');\n cache[str] = ret;\n }\n\n return ret;\n }\n\n function camelize(str) {\n return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) {\n return chr ? chr.toUpperCase() : '';\n }).replace(/^([A-Z])/, function(match, separator, chr) {\n return match.toLowerCase();\n });\n }\n\n function classify(str) {\n var parts = str.split(\".\"),\n out = [];\n\n for (var i=0, l=parts.length; i<l; i++) {\n var camelized = camelize(parts[i]);\n out.push(camelized.charAt(0).toUpperCase() + camelized.substr(1));\n }\n\n return out.join(\".\");\n }\n\n function underscore(str) {\n return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').\n replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase();\n }\n\n function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substr(1);\n }\n\n /**\n Defines the hash of localized strings for the current language. Used by\n the `Ember.String.loc()` helper. To localize, add string values to this\n hash.\n\n @property STRINGS\n @for Ember\n @type Hash\n */\n Ember.STRINGS = {};\n\n /**\n Defines string helper methods including string formatting and localization.\n Unless `Ember.EXTEND_PROTOTYPES.String` is `false` these methods will also be\n added to the `String.prototype` as well.\n\n @class String\n @namespace Ember\n @static\n */\n var EmberStringUtils = {\n\n /**\n Apply formatting options to the string. This will look for occurrences\n of \"%@\" in your string and substitute them with the arguments you pass into\n this method. If you want to control the specific order of replacement,\n you can add a number after the key as well to indicate which argument\n you want to insert.\n\n Ordered insertions are most useful when building loc strings where values\n you need to insert may appear in different orders.\n\n ```javascript\n \"Hello %@ %@\".fmt('John', 'Doe'); // \"Hello John Doe\"\n \"Hello %@2, %@1\".fmt('John', 'Doe'); // \"Hello Doe, John\"\n ```\n\n @method fmt\n @param {String} str The string to format\n @param {Array} formats An array of parameters to interpolate into string.\n @return {String} formatted string\n */\n fmt: fmt,\n\n /**\n Formats the passed string, but first looks up the string in the localized\n strings hash. This is a convenient way to localize text. See\n `Ember.String.fmt()` for more information on formatting.\n\n Note that it is traditional but not required to prefix localized string\n keys with an underscore or other character so you can easily identify\n localized strings.\n\n ```javascript\n Ember.STRINGS = {\n '_Hello World': 'Bonjour le monde',\n '_Hello %@ %@': 'Bonjour %@ %@'\n };\n\n Ember.String.loc(\"_Hello World\"); // 'Bonjour le monde';\n Ember.String.loc(\"_Hello %@ %@\", [\"John\", \"Smith\"]); // \"Bonjour John Smith\";\n ```\n\n @method loc\n @param {String} str The string to format\n @param {Array} formats Optional array of parameters to interpolate into string.\n @return {String} formatted string\n */\n loc: loc,\n\n /**\n Splits a string into separate units separated by spaces, eliminating any\n empty strings in the process. This is a convenience method for split that\n is mostly useful when applied to the `String.prototype`.\n\n ```javascript\n Ember.String.w(\"alpha beta gamma\").forEach(function(key) {\n console.log(key);\n });\n\n // > alpha\n // > beta\n // > gamma\n ```\n\n @method w\n @param {String} str The string to split\n @return {Array} array containing the split strings\n */\n w: w,\n\n /**\n Converts a camelized string into all lower case separated by underscores.\n\n ```javascript\n 'innerHTML'.decamelize(); // 'inner_html'\n 'action_name'.decamelize(); // 'action_name'\n 'css-class-name'.decamelize(); // 'css-class-name'\n 'my favorite items'.decamelize(); // 'my favorite items'\n ```\n\n @method decamelize\n @param {String} str The string to decamelize.\n @return {String} the decamelized string.\n */\n decamelize: decamelize,\n\n /**\n Replaces underscores, spaces, or camelCase with dashes.\n\n ```javascript\n 'innerHTML'.dasherize(); // 'inner-html'\n 'action_name'.dasherize(); // 'action-name'\n 'css-class-name'.dasherize(); // 'css-class-name'\n 'my favorite items'.dasherize(); // 'my-favorite-items'\n ```\n\n @method dasherize\n @param {String} str The string to dasherize.\n @return {String} the dasherized string.\n */\n dasherize: dasherize,\n\n /**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.camelize(); // 'innerHTML'\n 'action_name'.camelize(); // 'actionName'\n 'css-class-name'.camelize(); // 'cssClassName'\n 'my favorite items'.camelize(); // 'myFavoriteItems'\n 'My Favorite Items'.camelize(); // 'myFavoriteItems'\n ```\n\n @method camelize\n @param {String} str The string to camelize.\n @return {String} the camelized string.\n */\n camelize: camelize,\n\n /**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.classify(); // 'InnerHTML'\n 'action_name'.classify(); // 'ActionName'\n 'css-class-name'.classify(); // 'CssClassName'\n 'my favorite items'.classify(); // 'MyFavoriteItems'\n ```\n\n @method classify\n @param {String} str the string to classify\n @return {String} the classified string\n */\n classify: classify,\n\n /**\n More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n form of a string.\n\n ```javascript\n 'innerHTML'.underscore(); // 'inner_html'\n 'action_name'.underscore(); // 'action_name'\n 'css-class-name'.underscore(); // 'css_class_name'\n 'my favorite items'.underscore(); // 'my_favorite_items'\n ```\n\n @method underscore\n @param {String} str The string to underscore.\n @return {String} the underscored string.\n */\n underscore: underscore,\n\n /**\n Returns the Capitalized form of a string\n\n ```javascript\n 'innerHTML'.capitalize() // 'InnerHTML'\n 'action_name'.capitalize() // 'Action_name'\n 'css-class-name'.capitalize() // 'Css-class-name'\n 'my favorite items'.capitalize() // 'My favorite items'\n ```\n\n @method capitalize\n @param {String} str The string to capitalize.\n @return {String} The capitalized string.\n */\n capitalize: capitalize\n };\n\n __exports__[\"default\"] = EmberStringUtils;\n __exports__.fmt = fmt;\n __exports__.loc = loc;\n __exports__.w = w;\n __exports__.decamelize = decamelize;\n __exports__.dasherize = dasherize;\n __exports__.camelize = camelize;\n __exports__.classify = classify;\n __exports__.underscore = underscore;\n __exports__.capitalize = capitalize;\n });\ndefine(\"ember-runtime/system/subarray\",\n [\"ember-metal/property_get\",\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var EmberError = __dependency2__[\"default\"];\n var EnumerableUtils = __dependency3__[\"default\"];\n\n var RETAIN = 'r',\n FILTER = 'f';\n\n function Operation (type, count) {\n this.type = type;\n this.count = count;\n }\n\n /**\n An `Ember.SubArray` tracks an array in a way similar to, but more specialized\n than, `Ember.TrackedArray`. It is useful for keeping track of the indexes of\n items within a filtered array.\n\n @class SubArray\n @namespace Ember\n */\n function SubArray (length) {\n if (arguments.length < 1) { length = 0; }\n\n if (length > 0) {\n this._operations = [new Operation(RETAIN, length)];\n } else {\n this._operations = [];\n }\n };\n\n SubArray.prototype = {\n /**\n Track that an item was added to the tracked array.\n\n @method addItem\n\n @param {number} index The index of the item in the tracked array.\n @param {boolean} match `true` iff the item is included in the subarray.\n\n @return {number} The index of the item in the subarray.\n */\n addItem: function(index, match) {\n var returnValue = -1,\n itemType = match ? RETAIN : FILTER,\n self = this;\n\n this._findOperation(index, function(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) {\n var newOperation, splitOperation;\n\n if (itemType === operation.type) {\n ++operation.count;\n } else if (index === rangeStart) {\n // insert to the left of `operation`\n self._operations.splice(operationIndex, 0, new Operation(itemType, 1));\n } else {\n newOperation = new Operation(itemType, 1);\n splitOperation = new Operation(operation.type, rangeEnd - index + 1);\n operation.count = index - rangeStart;\n\n self._operations.splice(operationIndex + 1, 0, newOperation, splitOperation);\n }\n\n if (match) {\n if (operation.type === RETAIN) {\n returnValue = seenInSubArray + (index - rangeStart);\n } else {\n returnValue = seenInSubArray;\n }\n }\n\n self._composeAt(operationIndex);\n }, function(seenInSubArray) {\n self._operations.push(new Operation(itemType, 1));\n\n if (match) {\n returnValue = seenInSubArray;\n }\n\n self._composeAt(self._operations.length-1);\n });\n\n return returnValue;\n },\n\n /**\n Track that an item was removed from the tracked array.\n\n @method removeItem\n\n @param {number} index The index of the item in the tracked array.\n\n @return {number} The index of the item in the subarray, or `-1` if the item\n was not in the subarray.\n */\n removeItem: function(index) {\n var returnValue = -1,\n self = this;\n\n this._findOperation(index, function (operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) {\n if (operation.type === RETAIN) {\n returnValue = seenInSubArray + (index - rangeStart);\n }\n\n if (operation.count > 1) {\n --operation.count;\n } else {\n self._operations.splice(operationIndex, 1);\n self._composeAt(operationIndex);\n }\n }, function() {\n throw new EmberError(\"Can't remove an item that has never been added.\");\n });\n\n return returnValue;\n },\n\n\n _findOperation: function (index, foundCallback, notFoundCallback) {\n var operationIndex,\n len,\n operation,\n rangeStart,\n rangeEnd,\n seenInSubArray = 0;\n\n // OPTIMIZE: change to balanced tree\n // find leftmost operation to the right of `index`\n for (operationIndex = rangeStart = 0, len = this._operations.length; operationIndex < len; rangeStart = rangeEnd + 1, ++operationIndex) {\n operation = this._operations[operationIndex];\n rangeEnd = rangeStart + operation.count - 1;\n\n if (index >= rangeStart && index <= rangeEnd) {\n foundCallback(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray);\n return;\n } else if (operation.type === RETAIN) {\n seenInSubArray += operation.count;\n }\n }\n\n notFoundCallback(seenInSubArray);\n },\n\n _composeAt: function(index) {\n var op = this._operations[index],\n otherOp;\n\n if (!op) {\n // Composing out of bounds is a no-op, as when removing the last operation\n // in the list.\n return;\n }\n\n if (index > 0) {\n otherOp = this._operations[index-1];\n if (otherOp.type === op.type) {\n op.count += otherOp.count;\n this._operations.splice(index-1, 1);\n --index;\n }\n }\n\n if (index < this._operations.length-1) {\n otherOp = this._operations[index+1];\n if (otherOp.type === op.type) {\n op.count += otherOp.count;\n this._operations.splice(index+1, 1);\n }\n }\n },\n\n toString: function () {\n var str = \"\";\n forEach(this._operations, function (operation) {\n str += \" \" + operation.type + \":\" + operation.count;\n });\n return str.substring(1);\n }\n };\n\n __exports__[\"default\"] = SubArray;\n });\ndefine(\"ember-runtime/system/tracked_array\",\n [\"ember-metal/property_get\",\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var EnumerableUtils = __dependency2__[\"default\"];\n\n var forEach = EnumerableUtils.forEach,\n RETAIN = 'r',\n INSERT = 'i',\n DELETE = 'd';\n\n\n /**\n An `Ember.TrackedArray` tracks array operations. It's useful when you want to\n lazily compute the indexes of items in an array after they've been shifted by\n subsequent operations.\n\n @class TrackedArray\n @namespace Ember\n @param {array} [items=[]] The array to be tracked. This is used just to get\n the initial items for the starting state of retain:n.\n */\n function TrackedArray(items) {\n if (arguments.length < 1) { items = []; }\n\n var length = get(items, 'length');\n\n if (length) {\n this._operations = [new ArrayOperation(RETAIN, length, items)];\n } else {\n this._operations = [];\n }\n }\n\n TrackedArray.RETAIN = RETAIN;\n TrackedArray.INSERT = INSERT;\n TrackedArray.DELETE = DELETE;\n\n TrackedArray.prototype = {\n\n /**\n Track that `newItems` were added to the tracked array at `index`.\n\n @method addItems\n @param index\n @param newItems\n */\n addItems: function (index, newItems) {\n var count = get(newItems, 'length');\n if (count < 1) { return; }\n\n var match = this._findArrayOperation(index),\n arrayOperation = match.operation,\n arrayOperationIndex = match.index,\n arrayOperationRangeStart = match.rangeStart,\n composeIndex,\n splitIndex,\n splitItems,\n splitArrayOperation,\n newArrayOperation;\n\n newArrayOperation = new ArrayOperation(INSERT, count, newItems);\n\n if (arrayOperation) {\n if (!match.split) {\n // insert left of arrayOperation\n this._operations.splice(arrayOperationIndex, 0, newArrayOperation);\n composeIndex = arrayOperationIndex;\n } else {\n this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation);\n composeIndex = arrayOperationIndex + 1;\n }\n } else {\n // insert at end\n this._operations.push(newArrayOperation);\n composeIndex = arrayOperationIndex;\n }\n\n this._composeInsert(composeIndex);\n },\n\n /**\n Track that `count` items were removed at `index`.\n\n @method removeItems\n @param index\n @param count\n */\n removeItems: function (index, count) {\n if (count < 1) { return; }\n\n var match = this._findArrayOperation(index),\n arrayOperation = match.operation,\n arrayOperationIndex = match.index,\n arrayOperationRangeStart = match.rangeStart,\n newArrayOperation,\n composeIndex;\n\n newArrayOperation = new ArrayOperation(DELETE, count);\n if (!match.split) {\n // insert left of arrayOperation\n this._operations.splice(arrayOperationIndex, 0, newArrayOperation);\n composeIndex = arrayOperationIndex;\n } else {\n this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation);\n composeIndex = arrayOperationIndex + 1;\n }\n\n return this._composeDelete(composeIndex);\n },\n\n /**\n Apply all operations, reducing them to retain:n, for `n`, the number of\n items in the array.\n\n `callback` will be called for each operation and will be passed the following arguments:\n\n * {array} items The items for the given operation\n * {number} offset The computed offset of the items, ie the index in the\n array of the first item for this operation.\n * {string} operation The type of the operation. One of\n `Ember.TrackedArray.{RETAIN, DELETE, INSERT}`\n\n @method apply\n @param {function} callback\n */\n apply: function (callback) {\n var items = [],\n offset = 0;\n\n forEach(this._operations, function (arrayOperation, operationIndex) {\n callback(arrayOperation.items, offset, arrayOperation.type, operationIndex);\n\n if (arrayOperation.type !== DELETE) {\n offset += arrayOperation.count;\n items = items.concat(arrayOperation.items);\n }\n });\n\n this._operations = [new ArrayOperation(RETAIN, items.length, items)];\n },\n\n /**\n Return an `ArrayOperationMatch` for the operation that contains the item at `index`.\n\n @method _findArrayOperation\n\n @param {number} index the index of the item whose operation information\n should be returned.\n @private\n */\n _findArrayOperation: function (index) {\n var arrayOperationIndex,\n len,\n split = false,\n arrayOperation,\n arrayOperationRangeStart,\n arrayOperationRangeEnd;\n\n // OPTIMIZE: we could search these faster if we kept a balanced tree.\n // find leftmost arrayOperation to the right of `index`\n for (arrayOperationIndex = arrayOperationRangeStart = 0, len = this._operations.length; arrayOperationIndex < len; ++arrayOperationIndex) {\n arrayOperation = this._operations[arrayOperationIndex];\n\n if (arrayOperation.type === DELETE) { continue; }\n\n arrayOperationRangeEnd = arrayOperationRangeStart + arrayOperation.count - 1;\n\n if (index === arrayOperationRangeStart) {\n break;\n } else if (index > arrayOperationRangeStart && index <= arrayOperationRangeEnd) {\n split = true;\n break;\n } else {\n arrayOperationRangeStart = arrayOperationRangeEnd + 1;\n }\n }\n\n return new ArrayOperationMatch(arrayOperation, arrayOperationIndex, split, arrayOperationRangeStart);\n },\n\n _split: function (arrayOperationIndex, splitIndex, newArrayOperation) {\n var arrayOperation = this._operations[arrayOperationIndex],\n splitItems = arrayOperation.items.slice(splitIndex),\n splitArrayOperation = new ArrayOperation(arrayOperation.type, splitItems.length, splitItems);\n\n // truncate LHS\n arrayOperation.count = splitIndex;\n arrayOperation.items = arrayOperation.items.slice(0, splitIndex);\n\n this._operations.splice(arrayOperationIndex + 1, 0, newArrayOperation, splitArrayOperation);\n },\n\n // see SubArray for a better implementation.\n _composeInsert: function (index) {\n var newArrayOperation = this._operations[index],\n leftArrayOperation = this._operations[index-1], // may be undefined\n rightArrayOperation = this._operations[index+1], // may be undefined\n leftOp = leftArrayOperation && leftArrayOperation.type,\n rightOp = rightArrayOperation && rightArrayOperation.type;\n\n if (leftOp === INSERT) {\n // merge left\n leftArrayOperation.count += newArrayOperation.count;\n leftArrayOperation.items = leftArrayOperation.items.concat(newArrayOperation.items);\n\n if (rightOp === INSERT) {\n // also merge right (we have split an insert with an insert)\n leftArrayOperation.count += rightArrayOperation.count;\n leftArrayOperation.items = leftArrayOperation.items.concat(rightArrayOperation.items);\n this._operations.splice(index, 2);\n } else {\n // only merge left\n this._operations.splice(index, 1);\n }\n } else if (rightOp === INSERT) {\n // merge right\n newArrayOperation.count += rightArrayOperation.count;\n newArrayOperation.items = newArrayOperation.items.concat(rightArrayOperation.items);\n this._operations.splice(index + 1, 1);\n }\n },\n\n _composeDelete: function (index) {\n var arrayOperation = this._operations[index],\n deletesToGo = arrayOperation.count,\n leftArrayOperation = this._operations[index-1], // may be undefined\n leftOp = leftArrayOperation && leftArrayOperation.type,\n nextArrayOperation,\n nextOp,\n nextCount,\n removeNewAndNextOp = false,\n removedItems = [];\n\n if (leftOp === DELETE) {\n arrayOperation = leftArrayOperation;\n index -= 1;\n }\n\n for (var i = index + 1; deletesToGo > 0; ++i) {\n nextArrayOperation = this._operations[i];\n nextOp = nextArrayOperation.type;\n nextCount = nextArrayOperation.count;\n\n if (nextOp === DELETE) {\n arrayOperation.count += nextCount;\n continue;\n }\n\n if (nextCount > deletesToGo) {\n // d:2 {r,i}:5 we reduce the retain or insert, but it stays\n removedItems = removedItems.concat(nextArrayOperation.items.splice(0, deletesToGo));\n nextArrayOperation.count -= deletesToGo;\n\n // In the case where we truncate the last arrayOperation, we don't need to\n // remove it; also the deletesToGo reduction is not the entirety of\n // nextCount\n i -= 1;\n nextCount = deletesToGo;\n\n deletesToGo = 0;\n } else {\n if (nextCount === deletesToGo) {\n // Handle edge case of d:2 i:2 in which case both operations go away\n // during composition.\n removeNewAndNextOp = true;\n }\n removedItems = removedItems.concat(nextArrayOperation.items);\n deletesToGo -= nextCount;\n }\n\n if (nextOp === INSERT) {\n // d:2 i:3 will result in delete going away\n arrayOperation.count -= nextCount;\n }\n }\n\n if (arrayOperation.count > 0) {\n // compose our new delete with possibly several operations to the right of\n // disparate types\n this._operations.splice(index+1, i-1-index);\n } else {\n // The delete operation can go away; it has merely reduced some other\n // operation, as in d:3 i:4; it may also have eliminated that operation,\n // as in d:3 i:3.\n this._operations.splice(index, removeNewAndNextOp ? 2 : 1);\n }\n\n return removedItems;\n },\n\n toString: function () {\n var str = \"\";\n forEach(this._operations, function (operation) {\n str += \" \" + operation.type + \":\" + operation.count;\n });\n return str.substring(1);\n }\n };\n\n /**\n Internal data structure to represent an array operation.\n\n @method ArrayOperation\n @private\n @param {string} type The type of the operation. One of\n `Ember.TrackedArray.{RETAIN, INSERT, DELETE}`\n @param {number} count The number of items in this operation.\n @param {array} items The items of the operation, if included. RETAIN and\n INSERT include their items, DELETE does not.\n */\n function ArrayOperation (operation, count, items) {\n this.type = operation; // RETAIN | INSERT | DELETE\n this.count = count;\n this.items = items;\n }\n\n /**\n Internal data structure used to include information when looking up operations\n by item index.\n\n @method ArrayOperationMatch\n @private\n @param {ArrayOperation} operation\n @param {number} index The index of `operation` in the array of operations.\n @param {boolean} split Whether or not the item index searched for would\n require a split for a new operation type.\n @param {number} rangeStart The index of the first item in the operation,\n with respect to the tracked array. The index of the last item can be computed\n from `rangeStart` and `operation.count`.\n */\n function ArrayOperationMatch(operation, index, split, rangeStart) {\n this.operation = operation;\n this.index = index;\n this.split = split;\n this.rangeStart = rangeStart;\n }\n\n __exports__[\"default\"] = TrackedArray;\n });\n})();\n//@ sourceURL=ember-runtime");minispade.register('ember-testing', "(function() {minispade.require(\"ember-routing\");\nminispade.require(\"ember-application\");\ndefine(\"ember-testing/adapters/adapter\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.K\n var inspect = __dependency2__.inspect;\n var EmberObject = __dependency3__[\"default\"];\n\n /**\n @module ember\n @submodule ember-testing\n */\n\n /**\n The primary purpose of this class is to create hooks that can be implemented\n by an adapter for various test frameworks.\n\n @class Adapter\n @namespace Ember.Test\n */\n var Adapter = EmberObject.extend({\n /**\n This callback will be called whenever an async operation is about to start.\n\n Override this to call your framework's methods that handle async\n operations.\n\n @public\n @method asyncStart\n */\n asyncStart: Ember.K,\n\n /**\n This callback will be called whenever an async operation has completed.\n\n @public\n @method asyncEnd\n */\n asyncEnd: Ember.K,\n\n /**\n Override this method with your testing framework's false assertion.\n This function is called whenever an exception occurs causing the testing\n promise to fail.\n\n QUnit example:\n\n ```javascript\n exception: function(error) {\n ok(false, error);\n };\n ```\n\n @public\n @method exception\n @param {String} error The exception to be raised.\n */\n exception: function(error) {\n throw error;\n }\n });\n\n __exports__[\"default\"] = Adapter;\n });\ndefine(\"ember-testing/adapters/qunit\",\n [\"ember-testing/adapters/adapter\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Adapter = __dependency1__[\"default\"];\n var inspect = __dependency2__.inspect;\n\n /**\n This class implements the methods defined by Ember.Test.Adapter for the\n QUnit testing framework.\n\n @class QUnitAdapter\n @namespace Ember.Test\n @extends Ember.Test.Adapter\n */\n var QUnitAdapter = Adapter.extend({\n asyncStart: function() {\n QUnit.stop();\n },\n asyncEnd: function() {\n QUnit.start();\n },\n exception: function(error) {\n ok(false, inspect(error));\n }\n });\n\n __exports__[\"default\"] = QUnitAdapter;\n });\ndefine(\"ember-testing/helpers\",\n [\"ember-metal/property_get\",\"ember-metal/error\",\"ember-metal/run_loop\",\"ember-views/system/jquery\",\"ember-testing/test\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {\n \"use strict\";\n var get = __dependency1__.get;\n var EmberError = __dependency2__[\"default\"];\n var run = __dependency3__[\"default\"];\n var jQuery = __dependency4__[\"default\"];\n var Test = __dependency5__[\"default\"];\n\n /**\n * @module ember\n * @submodule ember-testing\n */\n\n var helper = Test.registerHelper,\n asyncHelper = Test.registerAsyncHelper,\n countAsync = 0;\n\n function currentRouteName(app){\n var appController = app.__container__.lookup('controller:application');\n\n return get(appController, 'currentRouteName');\n }\n\n function currentPath(app){\n var appController = app.__container__.lookup('controller:application');\n\n return get(appController, 'currentPath');\n }\n\n function currentURL(app){\n var router = app.__container__.lookup('router:main');\n\n return get(router, 'location').getURL();\n }\n\n function visit(app, url) {\n var router = app.__container__.lookup('router:main');\n router.location.setURL(url);\n\n if (app._readinessDeferrals > 0) {\n router['initialURL'] = url;\n run(app, 'advanceReadiness');\n delete router['initialURL'];\n } else {\n run(app, app.handleURL, url);\n }\n\n return wait(app);\n }\n\n function click(app, selector, context) {\n var $el = findWithAssert(app, selector, context);\n run($el, 'mousedown');\n\n if ($el.is(':input')) {\n var type = $el.prop('type');\n if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {\n run($el, function(){\n // Firefox does not trigger the `focusin` event if the window\n // does not have focus. If the document doesn't have focus just\n // use trigger('focusin') instead.\n if (!document.hasFocus || document.hasFocus()) {\n this.focus();\n } else {\n this.trigger('focusin');\n }\n });\n }\n }\n\n run($el, 'mouseup');\n run($el, 'click');\n\n return wait(app);\n }\n\n function triggerEvent(app, selector, context, type, options){\n if (arguments.length === 3) {\n type = context;\n context = null;\n }\n\n if (typeof options === 'undefined') {\n options = {};\n }\n\n var $el = findWithAssert(app, selector, context);\n\n var event = jQuery.Event(type, options);\n\n run($el, 'trigger', event);\n\n return wait(app);\n }\n\n function keyEvent(app, selector, context, type, keyCode) {\n if (typeof keyCode === 'undefined') {\n keyCode = type;\n type = context;\n context = null;\n }\n\n return triggerEvent(app, selector, context, type, { keyCode: keyCode, which: keyCode });\n }\n\n function fillIn(app, selector, context, text) {\n var $el;\n if (typeof text === 'undefined') {\n text = context;\n context = null;\n }\n $el = findWithAssert(app, selector, context);\n run(function() {\n $el.val(text).change();\n });\n return wait(app);\n }\n\n function findWithAssert(app, selector, context) {\n var $el = find(app, selector, context);\n if ($el.length === 0) {\n throw new EmberError(\"Element \" + selector + \" not found.\");\n }\n return $el;\n }\n\n function find(app, selector, context) {\n var $el;\n context = context || get(app, 'rootElement');\n $el = app.$(selector, context);\n\n return $el;\n }\n\n function andThen(app, callback) {\n return wait(app, callback(app));\n }\n\n function wait(app, value) {\n return Test.promise(function(resolve) {\n // If this is the first async promise, kick off the async test\n if (++countAsync === 1) {\n Test.adapter.asyncStart();\n }\n\n // Every 10ms, poll for the async thing to have finished\n var watcher = setInterval(function() {\n // 1. If the router is loading, keep polling\n var routerIsLoading = !!app.__container__.lookup('router:main').router.activeTransition;\n if (routerIsLoading) { return; }\n\n // 2. If there are pending Ajax requests, keep polling\n if (Test.pendingAjaxRequests) { return; }\n\n // 3. If there are scheduled timers or we are inside of a run loop, keep polling\n if (run.hasScheduledTimers() || run.currentRunLoop) { return; }\n if (Test.waiters && Test.waiters.any(function(waiter) {\n var context = waiter[0];\n var callback = waiter[1];\n return !callback.call(context);\n })) { return; }\n // Stop polling\n clearInterval(watcher);\n\n // If this is the last async promise, end the async test\n if (--countAsync === 0) {\n Test.adapter.asyncEnd();\n }\n\n // Synchronously resolve the promise\n run(null, resolve, value);\n }, 10);\n });\n\n }\n\n\n /**\n * Loads a route, sets up any controllers, and renders any templates associated\n * with the route as though a real user had triggered the route change while\n * using your app.\n *\n * Example:\n *\n * ```javascript\n * visit('posts/index').then(function() {\n * // assert something\n * });\n * ```\n *\n * @method visit\n * @param {String} url the name of the route\n * @return {RSVP.Promise}\n */\n asyncHelper('visit', visit);\n\n /**\n * Clicks an element and triggers any actions triggered by the element's `click`\n * event.\n *\n * Example:\n *\n * ```javascript\n * click('.some-jQuery-selector').then(function() {\n * // assert something\n * });\n * ```\n *\n * @method click\n * @param {String} selector jQuery selector for finding element on the DOM\n * @return {RSVP.Promise}\n */\n asyncHelper('click', click);\n\n /**\n * Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode\n *\n * Example:\n *\n * ```javascript\n * keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {\n * // assert something\n * });\n * ```\n *\n * @method keyEvent\n * @param {String} selector jQuery selector for finding element on the DOM\n * @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup`\n * @param {Number} keyCode the keyCode of the simulated key event\n * @return {RSVP.Promise}\n * @since 1.5.0\n */\n asyncHelper('keyEvent', keyEvent);\n\n /**\n * Fills in an input element with some text.\n *\n * Example:\n *\n * ```javascript\n * fillIn('#email', 'you@example.com').then(function() {\n * // assert something\n * });\n * ```\n *\n * @method fillIn\n * @param {String} selector jQuery selector finding an input element on the DOM\n * to fill text with\n * @param {String} text text to place inside the input element\n * @return {RSVP.Promise}\n */\n asyncHelper('fillIn', fillIn);\n\n /**\n * Finds an element in the context of the app's container element. A simple alias\n * for `app.$(selector)`.\n *\n * Example:\n *\n * ```javascript\n * var $el = find('.my-selector');\n * ```\n *\n * @method find\n * @param {String} selector jQuery string selector for element lookup\n * @return {Object} jQuery object representing the results of the query\n */\n helper('find', find);\n\n /**\n * Like `find`, but throws an error if the element selector returns no results.\n *\n * Example:\n *\n * ```javascript\n * var $el = findWithAssert('.doesnt-exist'); // throws error\n * ```\n *\n * @method findWithAssert\n * @param {String} selector jQuery selector string for finding an element within\n * the DOM\n * @return {Object} jQuery object representing the results of the query\n * @throws {Error} throws error if jQuery object returned has a length of 0\n */\n helper('findWithAssert', findWithAssert);\n\n /**\n Causes the run loop to process any pending events. This is used to ensure that\n any async operations from other helpers (or your assertions) have been processed.\n\n This is most often used as the return value for the helper functions (see 'click',\n 'fillIn','visit',etc).\n\n Example:\n\n ```javascript\n Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) {\n visit('secured/path/here')\n .fillIn('#username', username)\n .fillIn('#password', username)\n .click('.submit')\n\n return wait();\n });\n\n @method wait\n @param {Object} value The value to be returned.\n @return {RSVP.Promise}\n */\n asyncHelper('wait', wait);\n asyncHelper('andThen', andThen);\n\n\n /**\n Returns the currently active route name.\n\n Example:\n\n ```javascript\n function validateRouteName(){\n equal(currentRouteName(), 'some.path', \"correct route was transitioned into.\");\n }\n\n visit('/some/path').then(validateRouteName)\n ```\n\n @method currentRouteName\n @return {Object} The name of the currently active route.\n @since 1.5.0\n */\n helper('currentRouteName', currentRouteName);\n\n /**\n Returns the current path.\n\n Example:\n\n ```javascript\n function validateURL(){\n equal(currentPath(), 'some.path.index', \"correct path was transitioned into.\");\n }\n\n click('#some-link-id').then(validateURL);\n ```\n\n @method currentPath\n @return {Object} The currently active path.\n @since 1.5.0\n */\n helper('currentPath', currentPath);\n\n /**\n Returns the current URL.\n\n Example:\n\n ```javascript\n function validateURL(){\n equal(currentURL(), '/some/path', \"correct URL was transitioned into.\");\n }\n\n click('#some-link-id').then(validateURL);\n ```\n\n @method currentURL\n @return {Object} The currently active URL.\n @since 1.5.0\n */\n helper('currentURL', currentURL);\n\n /**\n Triggers the given event on the element identified by the provided selector.\n\n Example:\n\n ```javascript\n triggerEvent('#some-elem-id', 'blur');\n ```\n\n This is actually used internally by the `keyEvent` helper like so:\n\n ```javascript\n triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 });\n ```\n\n @method triggerEvent\n @param {String} selector jQuery selector for finding element on the DOM\n @param {String} type The event type to be triggered.\n @param {String} options The options to be passed to jQuery.Event.\n @return {RSVP.Promise}\n @since 1.5.0\n */\n asyncHelper('triggerEvent', triggerEvent);\n });\ndefine(\"ember-testing/initializers\",\n [\"ember-runtime/system/lazy_load\"],\n function(__dependency1__) {\n \"use strict\";\n var onLoad = __dependency1__.onLoad;\n\n var name = 'deferReadiness in `testing` mode';\n\n onLoad('Ember.Application', function(Application) {\n if (!Application.initializers[name]) {\n Application.initializer({\n name: name,\n\n initialize: function(container, application){\n if (application.testing) {\n application.deferReadiness();\n }\n }\n });\n }\n });\n });\ndefine(\"ember-testing\",\n [\"ember-metal/core\",\"ember-testing/initializers\",\"ember-testing/support\",\"ember-testing/setup_for_testing\",\"ember-testing/test\",\"ember-testing/adapters/adapter\",\"ember-testing/adapters/qunit\",\"ember-testing/helpers\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n\n // to setup initializer\n // to handle various edge cases\n\n var setupForTesting = __dependency4__[\"default\"];\n var Test = __dependency5__[\"default\"];\n var Adapter = __dependency6__[\"default\"];\n var QUnitAdapter = __dependency7__[\"default\"];\n // adds helpers to helpers object in Test\n\n /**\n Ember Testing\n\n @module ember\n @submodule ember-testing\n @requires ember-application\n */\n\n Ember.Test = Test;\n Ember.Test.Adapter = Adapter;\n Ember.Test.QUnitAdapter = QUnitAdapter;\n Ember.setupForTesting = setupForTesting;\n });\ndefine(\"ember-testing/setup_for_testing\",\n [\"ember-metal/core\",\"ember-testing/adapters/qunit\",\"ember-views/system/jquery\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // import Test from \"ember-testing/test\"; // ES6TODO: fix when cycles are supported\n var QUnitAdapter = __dependency2__[\"default\"];\n var jQuery = __dependency3__[\"default\"];\n\n var Test;\n\n function incrementAjaxPendingRequests(){\n Test.pendingAjaxRequests++;\n }\n\n function decrementAjaxPendingRequests(){\n Ember.assert(\"An ajaxComplete event which would cause the number of pending AJAX \" +\n \"requests to be negative has been triggered. This is most likely \" +\n \"caused by AJAX events that were started before calling \" +\n \"`injectTestHelpers()`.\", Test.pendingAjaxRequests !== 0);\n Test.pendingAjaxRequests--;\n }\n\n /**\n Sets Ember up for testing. This is useful to perform\n basic setup steps in order to unit test.\n\n Use `App.setupForTesting` to perform integration tests (full\n application testing).\n\n @method setupForTesting\n @namespace Ember\n @since 1.5.0\n */\n function setupForTesting() {\n if (!Test) { Test = requireModule('ember-testing/test')['default']; }\n\n Ember.testing = true;\n\n // if adapter is not manually set default to QUnit\n if (!Test.adapter) {\n Test.adapter = QUnitAdapter.create();\n }\n\n if (!Test.pendingAjaxRequests) {\n Test.pendingAjaxRequests = 0;\n }\n\n jQuery(document).off('ajaxSend', incrementAjaxPendingRequests);\n jQuery(document).off('ajaxComplete', decrementAjaxPendingRequests);\n jQuery(document).on('ajaxSend', incrementAjaxPendingRequests);\n jQuery(document).on('ajaxComplete', decrementAjaxPendingRequests);\n };\n\n __exports__[\"default\"] = setupForTesting;\n });\ndefine(\"ember-testing/support\",\n [\"ember-metal/core\",\"ember-views/system/jquery\"],\n function(__dependency1__, __dependency2__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var jQuery = __dependency2__[\"default\"];\n\n /**\n @module ember\n @submodule ember-testing\n */\n\n var $ = jQuery;\n\n /**\n This method creates a checkbox and triggers the click event to fire the\n passed in handler. It is used to correct for a bug in older versions\n of jQuery (e.g 1.8.3).\n\n @private\n @method testCheckboxClick\n */\n function testCheckboxClick(handler) {\n $('<input type=\"checkbox\">')\n .css({ position: 'absolute', left: '-1000px', top: '-1000px' })\n .appendTo('body')\n .on('click', handler)\n .trigger('click')\n .remove();\n }\n\n $(function() {\n /*\n Determine whether a checkbox checked using jQuery's \"click\" method will have\n the correct value for its checked property.\n\n If we determine that the current jQuery version exhibits this behavior,\n patch it to work correctly as in the commit for the actual fix:\n https://github.com/jquery/jquery/commit/1fb2f92.\n */\n testCheckboxClick(function() {\n if (!this.checked && !$.event.special.click) {\n $.event.special.click = {\n // For checkbox, fire native event so checked state will be right\n trigger: function() {\n if ($.nodeName( this, \"input\" ) && this.type === \"checkbox\" && this.click) {\n this.click();\n return false;\n }\n }\n };\n }\n });\n\n // Try again to verify that the patch took effect or blow up.\n testCheckboxClick(function() {\n Ember.warn(\"clicked checkboxes should be checked! the jQuery patch didn't work\", this.checked);\n });\n });\n });\ndefine(\"ember-testing/test\",\n [\"ember-metal/core\",\"ember-metal/run_loop\",\"ember-metal/platform\",\"ember-runtime/compare\",\"ember-runtime/ext/rsvp\",\"ember-testing/setup_for_testing\",\"ember-application/system/application\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var emberRun = __dependency2__[\"default\"];\n var create = __dependency3__.create;\n var compare = __dependency4__[\"default\"];\n var RSVP = __dependency5__[\"default\"];\n var setupForTesting = __dependency6__[\"default\"];\n var EmberApplication = __dependency7__[\"default\"];\n\n /**\n @module ember\n @submodule ember-testing\n */\n var slice = [].slice,\n helpers = {},\n injectHelpersCallbacks = [];\n\n /**\n This is a container for an assortment of testing related functionality:\n\n * Choose your default test adapter (for your framework of choice).\n * Register/Unregister additional test helpers.\n * Setup callbacks to be fired when the test helpers are injected into\n your application.\n\n @class Test\n @namespace Ember\n */\n var Test = {\n\n /**\n `registerHelper` is used to register a test helper that will be injected\n when `App.injectTestHelpers` is called.\n\n The helper method will always be called with the current Application as\n the first parameter.\n\n For example:\n\n ```javascript\n Ember.Test.registerHelper('boot', function(app) {\n Ember.run(app, app.advanceReadiness);\n });\n ```\n\n This helper can later be called without arguments because it will be\n called with `app` as the first parameter.\n\n ```javascript\n App = Ember.Application.create();\n App.injectTestHelpers();\n boot();\n ```\n\n @public\n @method registerHelper\n @param {String} name The name of the helper method to add.\n @param {Function} helperMethod\n @param options {Object}\n */\n registerHelper: function(name, helperMethod) {\n helpers[name] = {\n method: helperMethod,\n meta: { wait: false }\n };\n },\n\n /**\n `registerAsyncHelper` is used to register an async test helper that will be injected\n when `App.injectTestHelpers` is called.\n\n The helper method will always be called with the current Application as\n the first parameter.\n\n For example:\n\n ```javascript\n Ember.Test.registerAsyncHelper('boot', function(app) {\n Ember.run(app, app.advanceReadiness);\n });\n ```\n\n The advantage of an async helper is that it will not run\n until the last async helper has completed. All async helpers\n after it will wait for it complete before running.\n\n\n For example:\n\n ```javascript\n Ember.Test.registerAsyncHelper('deletePost', function(app, postId) {\n click('.delete-' + postId);\n });\n\n // ... in your test\n visit('/post/2');\n deletePost(2);\n visit('/post/3');\n deletePost(3);\n ```\n\n @public\n @method registerAsyncHelper\n @param {String} name The name of the helper method to add.\n @param {Function} helperMethod\n @since 1.2.0\n */\n registerAsyncHelper: function(name, helperMethod) {\n helpers[name] = {\n method: helperMethod,\n meta: { wait: true }\n };\n },\n\n /**\n Remove a previously added helper method.\n\n Example:\n\n ```javascript\n Ember.Test.unregisterHelper('wait');\n ```\n\n @public\n @method unregisterHelper\n @param {String} name The helper to remove.\n */\n unregisterHelper: function(name) {\n delete helpers[name];\n delete Test.Promise.prototype[name];\n },\n\n /**\n Used to register callbacks to be fired whenever `App.injectTestHelpers`\n is called.\n\n The callback will receive the current application as an argument.\n\n Example:\n\n ```javascript\n Ember.Test.onInjectHelpers(function() {\n Ember.$(document).ajaxSend(function() {\n Test.pendingAjaxRequests++;\n });\n\n Ember.$(document).ajaxComplete(function() {\n Test.pendingAjaxRequests--;\n });\n });\n ```\n\n @public\n @method onInjectHelpers\n @param {Function} callback The function to be called.\n */\n onInjectHelpers: function(callback) {\n injectHelpersCallbacks.push(callback);\n },\n\n /**\n This returns a thenable tailored for testing. It catches failed\n `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception`\n callback in the last chained then.\n\n This method should be returned by async helpers such as `wait`.\n\n @public\n @method promise\n @param {Function} resolver The function used to resolve the promise.\n */\n promise: function(resolver) {\n return new Test.Promise(resolver);\n },\n\n /**\n Used to allow ember-testing to communicate with a specific testing\n framework.\n\n You can manually set it before calling `App.setupForTesting()`.\n\n Example:\n\n ```javascript\n Ember.Test.adapter = MyCustomAdapter.create()\n ```\n\n If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`.\n\n @public\n @property adapter\n @type {Class} The adapter to be used.\n @default Ember.Test.QUnitAdapter\n */\n adapter: null,\n\n /**\n Replacement for `Ember.RSVP.resolve`\n The only difference is this uses\n and instance of `Ember.Test.Promise`\n\n @public\n @method resolve\n @param {Mixed} The value to resolve\n @since 1.2.0\n */\n resolve: function(val) {\n return Test.promise(function(resolve) {\n return resolve(val);\n });\n },\n\n /**\n This allows ember-testing to play nicely with other asynchronous\n events, such as an application that is waiting for a CSS3\n transition or an IndexDB transaction.\n\n For example:\n\n ```javascript\n Ember.Test.registerWaiter(function() {\n return myPendingTransactions() == 0;\n });\n ```\n The `context` argument allows you to optionally specify the `this`\n with which your callback will be invoked.\n\n For example:\n\n ```javascript\n Ember.Test.registerWaiter(MyDB, MyDB.hasPendingTransactions);\n ```\n\n @public\n @method registerWaiter\n @param {Object} context (optional)\n @param {Function} callback\n @since 1.2.0\n */\n registerWaiter: function(context, callback) {\n if (arguments.length === 1) {\n callback = context;\n context = null;\n }\n if (!this.waiters) {\n this.waiters = Ember.A();\n }\n this.waiters.push([context, callback]);\n },\n /**\n `unregisterWaiter` is used to unregister a callback that was\n registered with `registerWaiter`.\n\n @public\n @method unregisterWaiter\n @param {Object} context (optional)\n @param {Function} callback\n @since 1.2.0\n */\n unregisterWaiter: function(context, callback) {\n var pair;\n if (!this.waiters) { return; }\n if (arguments.length === 1) {\n callback = context;\n context = null;\n }\n pair = [context, callback];\n this.waiters = Ember.A(this.waiters.filter(function(elt) {\n return compare(elt, pair)!==0;\n }));\n }\n };\n\n function helper(app, name) {\n var fn = helpers[name].method,\n meta = helpers[name].meta;\n\n return function() {\n var args = slice.call(arguments),\n lastPromise = Test.lastPromise;\n\n args.unshift(app);\n\n // some helpers are not async and\n // need to return a value immediately.\n // example: `find`\n if (!meta.wait) {\n return fn.apply(app, args);\n }\n\n if (!lastPromise) {\n // It's the first async helper in current context\n lastPromise = fn.apply(app, args);\n } else {\n // wait for last helper's promise to resolve\n // and then execute\n run(function() {\n lastPromise = Test.resolve(lastPromise).then(function() {\n return fn.apply(app, args);\n });\n });\n }\n\n return lastPromise;\n };\n }\n\n function run(fn) {\n if (!emberRun.currentRunLoop) {\n emberRun(fn);\n } else {\n fn();\n }\n }\n\n EmberApplication.reopen({\n /**\n This property contains the testing helpers for the current application. These\n are created once you call `injectTestHelpers` on your `Ember.Application`\n instance. The included helpers are also available on the `window` object by\n default, but can be used from this object on the individual application also.\n\n @property testHelpers\n @type {Object}\n @default {}\n */\n testHelpers: {},\n\n /**\n This property will contain the original methods that were registered\n on the `helperContainer` before `injectTestHelpers` is called.\n\n When `removeTestHelpers` is called, these methods are restored to the\n `helperContainer`.\n\n @property originalMethods\n @type {Object}\n @default {}\n @private\n @since 1.3.0\n */\n originalMethods: {},\n\n\n /**\n This property indicates whether or not this application is currently in\n testing mode. This is set when `setupForTesting` is called on the current\n application.\n\n @property testing\n @type {Boolean}\n @default false\n @since 1.3.0\n */\n testing: false,\n\n /**\n This hook defers the readiness of the application, so that you can start\n the app when your tests are ready to run. It also sets the router's\n location to 'none', so that the window's location will not be modified\n (preventing both accidental leaking of state between tests and interference\n with your testing framework).\n\n Example:\n\n ```\n App.setupForTesting();\n ```\n\n @method setupForTesting\n */\n setupForTesting: function() {\n setupForTesting();\n\n this.testing = true;\n\n this.Router.reopen({\n location: 'none'\n });\n },\n\n /**\n This will be used as the container to inject the test helpers into. By\n default the helpers are injected into `window`.\n\n @property helperContainer\n @type {Object} The object to be used for test helpers.\n @default window\n @since 1.2.0\n */\n helperContainer: window,\n\n /**\n This injects the test helpers into the `helperContainer` object. If an object is provided\n it will be used as the helperContainer. If `helperContainer` is not set it will default\n to `window`. If a function of the same name has already been defined it will be cached\n (so that it can be reset if the helper is removed with `unregisterHelper` or\n `removeTestHelpers`).\n\n Any callbacks registered with `onInjectHelpers` will be called once the\n helpers have been injected.\n\n Example:\n ```\n App.injectTestHelpers();\n ```\n\n @method injectTestHelpers\n */\n injectTestHelpers: function(helperContainer) {\n if (helperContainer) { this.helperContainer = helperContainer; }\n\n this.testHelpers = {};\n for (var name in helpers) {\n this.originalMethods[name] = this.helperContainer[name];\n this.testHelpers[name] = this.helperContainer[name] = helper(this, name);\n protoWrap(Test.Promise.prototype, name, helper(this, name), helpers[name].meta.wait);\n }\n\n for(var i = 0, l = injectHelpersCallbacks.length; i < l; i++) {\n injectHelpersCallbacks[i](this);\n }\n },\n\n /**\n This removes all helpers that have been registered, and resets and functions\n that were overridden by the helpers.\n\n Example:\n\n ```javascript\n App.removeTestHelpers();\n ```\n\n @public\n @method removeTestHelpers\n */\n removeTestHelpers: function() {\n for (var name in helpers) {\n this.helperContainer[name] = this.originalMethods[name];\n delete this.testHelpers[name];\n delete this.originalMethods[name];\n }\n }\n });\n\n // This method is no longer needed\n // But still here for backwards compatibility\n // of helper chaining\n function protoWrap(proto, name, callback, isAsync) {\n proto[name] = function() {\n var args = arguments;\n if (isAsync) {\n return callback.apply(this, args);\n } else {\n return this.then(function() {\n return callback.apply(this, args);\n });\n }\n };\n }\n\n Test.Promise = function() {\n RSVP.Promise.apply(this, arguments);\n Test.lastPromise = this;\n };\n\n Test.Promise.prototype = create(RSVP.Promise.prototype);\n Test.Promise.prototype.constructor = Test.Promise;\n\n // Patch `then` to isolate async methods\n // specifically `Ember.Test.lastPromise`\n var originalThen = RSVP.Promise.prototype.then;\n Test.Promise.prototype.then = function(onSuccess, onFailure) {\n return originalThen.call(this, function(val) {\n return isolate(onSuccess, val);\n }, onFailure);\n };\n\n // This method isolates nested async methods\n // so that they don't conflict with other last promises.\n //\n // 1. Set `Ember.Test.lastPromise` to null\n // 2. Invoke method\n // 3. Return the last promise created during method\n // 4. Restore `Ember.Test.lastPromise` to original value\n function isolate(fn, val) {\n var value, lastPromise;\n\n // Reset lastPromise for nested helpers\n Test.lastPromise = null;\n\n value = fn(val);\n\n lastPromise = Test.lastPromise;\n\n // If the method returned a promise\n // return that promise. If not,\n // return the last async helper's promise\n if ((value && (value instanceof Test.Promise)) || !lastPromise) {\n return value;\n } else {\n run(function() {\n lastPromise = Test.resolve(lastPromise).then(function() {\n return value;\n });\n });\n return lastPromise;\n }\n }\n\n __exports__[\"default\"] = Test;\n });\n})();\n//@ sourceURL=ember-testing");minispade.register('ember-views', "(function() {minispade.require(\"ember-runtime\");\ndefine(\"ember-views\",\n [\"ember-runtime\",\"ember-views/system/jquery\",\"ember-views/system/utils\",\"ember-views/system/render_buffer\",\"ember-views/system/ext\",\"ember-views/views/states\",\"ember-views/views/view\",\"ember-views/views/container_view\",\"ember-views/views/collection_view\",\"ember-views/views/component\",\"ember-views/system/event_dispatcher\",\"ember-views/mixins/view_target_action_support\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n /**\n Ember Views\n\n @module ember\n @submodule ember-views\n @requires ember-runtime\n @main ember-views\n */\n\n // BEGIN IMPORTS\n var Ember = __dependency1__[\"default\"];\n var jQuery = __dependency2__[\"default\"];\n var setInnerHTML = __dependency3__.setInnerHTML;\n var isSimpleClick = __dependency3__.isSimpleClick;\n var RenderBuffer = __dependency4__[\"default\"];\n // for the side effect of extending Ember.run.queues\n var cloneStates = __dependency6__.cloneStates;\n var states = __dependency6__.states;\n\n var CoreView = __dependency7__.CoreView;\n var View = __dependency7__.View;\n var ViewCollection = __dependency7__.ViewCollection;\n var ContainerView = __dependency8__[\"default\"];\n var CollectionView = __dependency9__[\"default\"];\n var Component = __dependency10__[\"default\"];\n\n var EventDispatcher = __dependency11__[\"default\"];\n var ViewTargetActionSupport = __dependency12__[\"default\"];\n // END IMPORTS\n\n /**\n Alias for jQuery\n\n @method $\n @for Ember\n */\n\n // BEGIN EXPORTS\n Ember.$ = jQuery;\n\n Ember.ViewTargetActionSupport = ViewTargetActionSupport;\n Ember.RenderBuffer = RenderBuffer;\n\n var ViewUtils = Ember.ViewUtils = {};\n ViewUtils.setInnerHTML = setInnerHTML;\n ViewUtils.isSimpleClick = isSimpleClick;\n\n Ember.CoreView = CoreView;\n Ember.View = View;\n Ember.View.states = states;\n Ember.View.cloneStates = cloneStates;\n\n Ember._ViewCollection = ViewCollection;\n Ember.ContainerView = ContainerView;\n Ember.CollectionView = CollectionView;\n Ember.Component = Component;\n Ember.EventDispatcher = EventDispatcher;\n // END EXPORTS\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-views/mixins/component_template_deprecation\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/mixin\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.deprecate\n var get = __dependency2__.get;\n var Mixin = __dependency3__.Mixin;\n\n /**\n The ComponentTemplateDeprecation mixin is used to provide a useful\n deprecation warning when using either `template` or `templateName` with\n a component. The `template` and `templateName` properties specified at\n extend time are moved to `layout` and `layoutName` respectively.\n\n `Ember.ComponentTemplateDeprecation` is used internally by Ember in\n `Ember.Component`.\n\n @class ComponentTemplateDeprecation\n @namespace Ember\n */\n var ComponentTemplateDeprecation = Mixin.create({\n /**\n @private\n\n Moves `templateName` to `layoutName` and `template` to `layout` at extend\n time if a layout is not also specified.\n\n Note that this currently modifies the mixin themselves, which is technically\n dubious but is practically of little consequence. This may change in the\n future.\n\n @method willMergeMixin\n @since 1.4.0\n */\n willMergeMixin: function(props) {\n // must call _super here to ensure that the ActionHandler\n // mixin is setup properly (moves actions -> _actions)\n //\n // Calling super is only OK here since we KNOW that\n // there is another Mixin loaded first.\n this._super.apply(this, arguments);\n\n var deprecatedProperty, replacementProperty,\n layoutSpecified = (props.layoutName || props.layout || get(this, 'layoutName'));\n\n if (props.templateName && !layoutSpecified) {\n deprecatedProperty = 'templateName';\n replacementProperty = 'layoutName';\n\n props.layoutName = props.templateName;\n delete props['templateName'];\n }\n\n if (props.template && !layoutSpecified) {\n deprecatedProperty = 'template';\n replacementProperty = 'layout';\n\n props.layout = props.template;\n delete props['template'];\n }\n\n if (deprecatedProperty) {\n Ember.deprecate('Do not specify ' + deprecatedProperty + ' on a Component, use ' + replacementProperty + ' instead.', false);\n }\n }\n });\n\n __exports__[\"default\"] = ComponentTemplateDeprecation;\n });\ndefine(\"ember-views/mixins/view_target_action_support\",\n [\"ember-metal/mixin\",\"ember-runtime/mixins/target_action_support\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Mixin = __dependency1__.Mixin;\n var TargetActionSupport = __dependency2__[\"default\"];\n\n // ES6TODO: computed should have its own export path so you can do import {defaultTo} from computed\n var computed = __dependency3__.computed;\n var alias = computed.alias;\n\n /**\n `Ember.ViewTargetActionSupport` is a mixin that can be included in a\n view class to add a `triggerAction` method with semantics similar to\n the Handlebars `{{action}}` helper. It provides intelligent defaults\n for the action's target: the view's controller; and the context that is\n sent with the action: the view's context.\n\n Note: In normal Ember usage, the `{{action}}` helper is usually the best\n choice. This mixin is most often useful when you are doing more complex\n event handling in custom View subclasses.\n\n For example:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n action: 'save',\n click: function() {\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `action` can be provided as properties of an optional object argument\n to `triggerAction` as well.\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n click: function() {\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n @class ViewTargetActionSupport\n @namespace Ember\n @extends Ember.TargetActionSupport\n */\n var ViewTargetActionSupport = Mixin.create(TargetActionSupport, {\n /**\n @property target\n */\n target: alias('controller'),\n /**\n @property actionContext\n */\n actionContext: alias('context')\n });\n\n __exports__[\"default\"] = ViewTargetActionSupport;\n });\ndefine(\"ember-views/system/event_dispatcher\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/is_none\",\"ember-metal/run_loop\",\"ember-metal/utils\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-views/system/jquery\",\"ember-views/views/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-views\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var isNone = __dependency4__.isNone;\n var run = __dependency5__[\"default\"];\n var typeOf = __dependency6__.typeOf;\n var fmt = __dependency7__.fmt;\n var EmberObject = __dependency8__[\"default\"];\n var jQuery = __dependency9__[\"default\"];\n var View = __dependency10__.View;\n\n var ActionHelper;\n\n //ES6TODO:\n // find a better way to do Ember.View.views without global state\n\n /**\n `Ember.EventDispatcher` handles delegating browser events to their\n corresponding `Ember.Views.` For example, when you click on a view,\n `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets\n called.\n\n @class EventDispatcher\n @namespace Ember\n @private\n @extends Ember.Object\n */\n var EventDispatcher = EmberObject.extend({\n\n /**\n The set of events names (and associated handler function names) to be setup\n and dispatched by the `EventDispatcher`. Custom events can added to this list at setup\n time, generally via the `Ember.Application.customEvents` hash. Only override this\n default set to prevent the EventDispatcher from listening on some events all together.\n\n This set will be modified by `setup` to also include any events added at that time.\n\n @property events\n @type Object\n */\n events: {\n touchstart : 'touchStart',\n touchmove : 'touchMove',\n touchend : 'touchEnd',\n touchcancel : 'touchCancel',\n keydown : 'keyDown',\n keyup : 'keyUp',\n keypress : 'keyPress',\n mousedown : 'mouseDown',\n mouseup : 'mouseUp',\n contextmenu : 'contextMenu',\n click : 'click',\n dblclick : 'doubleClick',\n mousemove : 'mouseMove',\n focusin : 'focusIn',\n focusout : 'focusOut',\n mouseenter : 'mouseEnter',\n mouseleave : 'mouseLeave',\n submit : 'submit',\n input : 'input',\n change : 'change',\n dragstart : 'dragStart',\n drag : 'drag',\n dragenter : 'dragEnter',\n dragleave : 'dragLeave',\n dragover : 'dragOver',\n drop : 'drop',\n dragend : 'dragEnd'\n },\n\n /**\n The root DOM element to which event listeners should be attached. Event\n listeners will be attached to the document unless this is overridden.\n\n Can be specified as a DOMElement or a selector string.\n\n The default body is a string since this may be evaluated before document.body\n exists in the DOM.\n\n @private\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n Sets up event listeners for standard browser events.\n\n This will be called after the browser sends a `DOMContentReady` event. By\n default, it will set up all of the listeners on the document body. If you\n would like to register the listeners on a different element, set the event\n dispatcher's `root` property.\n\n @private\n @method setup\n @param addedEvents {Hash}\n */\n setup: function(addedEvents, rootElement) {\n var event, events = get(this, 'events');\n\n jQuery.extend(events, addedEvents || {});\n\n\n if (!isNone(rootElement)) {\n set(this, 'rootElement', rootElement);\n }\n\n rootElement = jQuery(get(this, 'rootElement'));\n\n Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));\n Ember.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length);\n Ember.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length);\n\n rootElement.addClass('ember-application');\n\n Ember.assert('Unable to add \"ember-application\" class to rootElement. Make sure you set rootElement to the body or an element in the body.', rootElement.is('.ember-application'));\n\n for (event in events) {\n if (events.hasOwnProperty(event)) {\n this.setupHandler(rootElement, event, events[event]);\n }\n }\n },\n\n /**\n Registers an event listener on the document. If the given event is\n triggered, the provided event handler will be triggered on the target view.\n\n If the target view does not implement the event handler, or if the handler\n returns `false`, the parent view will be called. The event will continue to\n bubble to each successive parent view until it reaches the top.\n\n For example, to have the `mouseDown` method called on the target view when\n a `mousedown` event is received from the browser, do the following:\n\n ```javascript\n setupHandler('mousedown', 'mouseDown');\n ```\n\n @private\n @method setupHandler\n @param {Element} rootElement\n @param {String} event the browser-originated event to listen to\n @param {String} eventName the name of the method to call on the view\n */\n setupHandler: function(rootElement, event, eventName) {\n var self = this;\n\n rootElement.on(event + '.ember', '.ember-view', function(evt, triggeringManager) {\n var view = View.views[this.id],\n result = true, manager = null;\n\n manager = self._findNearestEventManager(view, eventName);\n\n if (manager && manager !== triggeringManager) {\n result = self._dispatchEvent(manager, evt, eventName, view);\n } else if (view) {\n result = self._bubbleEvent(view, evt, eventName);\n } else {\n evt.stopPropagation();\n }\n\n return result;\n });\n\n rootElement.on(event + '.ember', '[data-ember-action]', function(evt) {\n //ES6TODO: Needed for ActionHelper (generally not available in ember-views test suite)\n if (!ActionHelper) { ActionHelper = requireModule(\"ember-routing/helpers/action\")[\"ActionHelper\"]; };\n\n var actionId = jQuery(evt.currentTarget).attr('data-ember-action'),\n action = ActionHelper.registeredActions[actionId];\n\n // We have to check for action here since in some cases, jQuery will trigger\n // an event on `removeChild` (i.e. focusout) after we've already torn down the\n // action handlers for the view.\n if (action && action.eventName === eventName) {\n return action.handler(evt);\n }\n });\n },\n\n _findNearestEventManager: function(view, eventName) {\n var manager = null;\n\n while (view) {\n manager = get(view, 'eventManager');\n if (manager && manager[eventName]) { break; }\n\n view = get(view, 'parentView');\n }\n\n return manager;\n },\n\n _dispatchEvent: function(object, evt, eventName, view) {\n var result = true;\n\n var handler = object[eventName];\n if (typeOf(handler) === 'function') {\n result = run(object, handler, evt, view);\n // Do not preventDefault in eventManagers.\n evt.stopPropagation();\n }\n else {\n result = this._bubbleEvent(view, evt, eventName);\n }\n\n return result;\n },\n\n _bubbleEvent: function(view, evt, eventName) {\n return run(view, view.handleEvent, eventName, evt);\n },\n\n destroy: function() {\n var rootElement = get(this, 'rootElement');\n jQuery(rootElement).off('.ember', '**').removeClass('ember-application');\n return this._super();\n }\n });\n\n __exports__[\"default\"] = EventDispatcher;\n });\ndefine(\"ember-views/system/ext\",\n [\"ember-metal/run_loop\"],\n function(__dependency1__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-views\n */\n\n var run = __dependency1__[\"default\"];\n\n // Add a new named queue for rendering views that happens\n // after bindings have synced, and a queue for scheduling actions\n // that that should occur after view rendering.\n var queues = run.queues;\n run._addQueue('render', 'actions');\n run._addQueue('afterRender', 'render');\n });\ndefine(\"ember-views/system/jquery\",\n [\"ember-metal/core\",\"ember-runtime/system/string\",\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var w = __dependency2__.w;\n\n // ES6TODO: the functions on EnumerableUtils need their own exports\n var EnumerableUtils = __dependency3__[\"default\"];\n var forEach = EnumerableUtils.forEach;\n\n /**\n Ember Views\n\n @module ember\n @submodule ember-views\n @requires ember-runtime\n @main ember-views\n */\n\n var jQuery = (Ember.imports && Ember.imports.jQuery) || (this && this.jQuery);\n if (!jQuery && typeof require === 'function') {\n jQuery = require('jquery');\n }\n\n Ember.assert(\"Ember Views require jQuery between 1.7 and 2.1\", jQuery && (jQuery().jquery.match(/^((1\\.(7|8|9|10|11))|(2\\.(0|1)))(\\.\\d+)?(pre|rc\\d?)?/) || Ember.ENV.FORCE_JQUERY));\n\n /**\n @module ember\n @submodule ember-views\n */\n if (jQuery) {\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents\n var dragEvents = w('dragstart drag dragenter dragleave dragover drop dragend');\n\n // Copies the `dataTransfer` property from a browser event object onto the\n // jQuery event object for the specified events\n forEach(dragEvents, function(eventName) {\n jQuery.event.fixHooks[eventName] = { props: ['dataTransfer'] };\n });\n }\n\n __exports__[\"default\"] = jQuery;\n });\ndefine(\"ember-views/system/render_buffer\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/system/utils\",\"ember-views/system/jquery\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-views\n */\n\n var Ember = __dependency1__[\"default\"];\n // jQuery\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var setInnerHTML = __dependency4__.setInnerHTML;\n var jQuery = __dependency5__[\"default\"];\n\n function ClassSet() {\n this.seen = {};\n this.list = [];\n };\n\n\n ClassSet.prototype = {\n add: function(string) {\n if (string in this.seen) { return; }\n this.seen[string] = true;\n\n this.list.push(string);\n },\n\n toDOM: function() {\n return this.list.join(\" \");\n }\n };\n\n var BAD_TAG_NAME_TEST_REGEXP = /[^a-zA-Z0-9\\-]/;\n var BAD_TAG_NAME_REPLACE_REGEXP = /[^a-zA-Z0-9\\-]/g;\n\n function stripTagName(tagName) {\n if (!tagName) {\n return tagName;\n }\n\n if (!BAD_TAG_NAME_TEST_REGEXP.test(tagName)) {\n return tagName;\n }\n\n return tagName.replace(BAD_TAG_NAME_REPLACE_REGEXP, '');\n }\n\n var BAD_CHARS_REGEXP = /&(?!\\w+;)|[<>\"'`]/g;\n var POSSIBLE_CHARS_REGEXP = /[&<>\"'`]/;\n\n function escapeAttribute(value) {\n // Stolen shamelessly from Handlebars\n\n var escape = {\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n \"`\": \"`\"\n };\n\n var escapeChar = function(chr) {\n return escape[chr] || \"&\";\n };\n\n var string = value.toString();\n\n if(!POSSIBLE_CHARS_REGEXP.test(string)) { return string; }\n return string.replace(BAD_CHARS_REGEXP, escapeChar);\n }\n\n // IE 6/7 have bugs around setting names on inputs during creation.\n // From http://msdn.microsoft.com/en-us/library/ie/ms536389(v=vs.85).aspx:\n // \"To include the NAME attribute at run time on objects created with the createElement method, use the eTag.\"\n var canSetNameOnInputs = (function() {\n var div = document.createElement('div'),\n el = document.createElement('input');\n\n el.setAttribute('name', 'foo');\n div.appendChild(el);\n\n return !!div.innerHTML.match('foo');\n })();\n\n /**\n `Ember.RenderBuffer` gathers information regarding the view and generates the\n final representation. `Ember.RenderBuffer` will generate HTML which can be pushed\n to the DOM.\n\n ```javascript\n var buffer = Ember.RenderBuffer('div');\n ```\n\n @class RenderBuffer\n @namespace Ember\n @constructor\n @param {String} tagName tag name (such as 'div' or 'p') used for the buffer\n */\n var RenderBuffer = function(tagName) {\n return new _RenderBuffer(tagName);\n };\n\n var _RenderBuffer = function(tagName) {\n this.tagNames = [tagName || null];\n this.buffer = \"\";\n };\n\n _RenderBuffer.prototype = {\n\n // The root view's element\n _element: null,\n\n _hasElement: true,\n\n /**\n An internal set used to de-dupe class names when `addClass()` is\n used. After each call to `addClass()`, the `classes` property\n will be updated.\n\n @private\n @property elementClasses\n @type Array\n @default null\n */\n elementClasses: null,\n\n /**\n Array of class names which will be applied in the class attribute.\n\n You can use `setClasses()` to set this property directly. If you\n use `addClass()`, it will be maintained for you.\n\n @property classes\n @type Array\n @default null\n */\n classes: null,\n\n /**\n The id in of the element, to be applied in the id attribute.\n\n You should not set this property yourself, rather, you should use\n the `id()` method of `Ember.RenderBuffer`.\n\n @property elementId\n @type String\n @default null\n */\n elementId: null,\n\n /**\n A hash keyed on the name of the attribute and whose value will be\n applied to that attribute. For example, if you wanted to apply a\n `data-view=\"Foo.bar\"` property to an element, you would set the\n elementAttributes hash to `{'data-view':'Foo.bar'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `attr()` method of `Ember.RenderBuffer`.\n\n @property elementAttributes\n @type Hash\n @default {}\n */\n elementAttributes: null,\n\n /**\n A hash keyed on the name of the properties and whose value will be\n applied to that property. For example, if you wanted to apply a\n `checked=true` property to an element, you would set the\n elementProperties hash to `{'checked':true}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `prop()` method of `Ember.RenderBuffer`.\n\n @property elementProperties\n @type Hash\n @default {}\n */\n elementProperties: null,\n\n /**\n The tagname of the element an instance of `Ember.RenderBuffer` represents.\n\n Usually, this gets set as the first parameter to `Ember.RenderBuffer`. For\n example, if you wanted to create a `p` tag, then you would call\n\n ```javascript\n Ember.RenderBuffer('p')\n ```\n\n @property elementTag\n @type String\n @default null\n */\n elementTag: null,\n\n /**\n A hash keyed on the name of the style attribute and whose value will\n be applied to that attribute. For example, if you wanted to apply a\n `background-color:black;` style to an element, you would set the\n elementStyle hash to `{'background-color':'black'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `style()` method of `Ember.RenderBuffer`.\n\n @property elementStyle\n @type Hash\n @default {}\n */\n elementStyle: null,\n\n /**\n Nested `RenderBuffers` will set this to their parent `RenderBuffer`\n instance.\n\n @property parentBuffer\n @type Ember._RenderBuffer\n */\n parentBuffer: null,\n\n /**\n Adds a string of HTML to the `RenderBuffer`.\n\n @method push\n @param {String} string HTML to push into the buffer\n @chainable\n */\n push: function(string) {\n this.buffer += string;\n return this;\n },\n\n /**\n Adds a class to the buffer, which will be rendered to the class attribute.\n\n @method addClass\n @param {String} className Class name to add to the buffer\n @chainable\n */\n addClass: function(className) {\n // lazily create elementClasses\n this.elementClasses = (this.elementClasses || new ClassSet());\n this.elementClasses.add(className);\n this.classes = this.elementClasses.list;\n\n return this;\n },\n\n setClasses: function(classNames) {\n this.elementClasses = null;\n var len = classNames.length, i;\n for (i = 0; i < len; i++) {\n this.addClass(classNames[i]);\n }\n },\n\n /**\n Sets the elementID to be used for the element.\n\n @method id\n @param {String} id\n @chainable\n */\n id: function(id) {\n this.elementId = id;\n return this;\n },\n\n // duck type attribute functionality like jQuery so a render buffer\n // can be used like a jQuery object in attribute binding scenarios.\n\n /**\n Adds an attribute which will be rendered to the element.\n\n @method attr\n @param {String} name The name of the attribute\n @param {String} value The value to add to the attribute\n @chainable\n @return {Ember.RenderBuffer|String} this or the current attribute value\n */\n attr: function(name, value) {\n var attributes = this.elementAttributes = (this.elementAttributes || {});\n\n if (arguments.length === 1) {\n return attributes[name];\n } else {\n attributes[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an attribute from the list of attributes to render.\n\n @method removeAttr\n @param {String} name The name of the attribute\n @chainable\n */\n removeAttr: function(name) {\n var attributes = this.elementAttributes;\n if (attributes) { delete attributes[name]; }\n\n return this;\n },\n\n /**\n Adds a property which will be rendered to the element.\n\n @method prop\n @param {String} name The name of the property\n @param {String} value The value to add to the property\n @chainable\n @return {Ember.RenderBuffer|String} this or the current property value\n */\n prop: function(name, value) {\n var properties = this.elementProperties = (this.elementProperties || {});\n\n if (arguments.length === 1) {\n return properties[name];\n } else {\n properties[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an property from the list of properties to render.\n\n @method removeProp\n @param {String} name The name of the property\n @chainable\n */\n removeProp: function(name) {\n var properties = this.elementProperties;\n if (properties) { delete properties[name]; }\n\n return this;\n },\n\n /**\n Adds a style to the style attribute which will be rendered to the element.\n\n @method style\n @param {String} name Name of the style\n @param {String} value\n @chainable\n */\n style: function(name, value) {\n this.elementStyle = (this.elementStyle || {});\n\n this.elementStyle[name] = value;\n return this;\n },\n\n begin: function(tagName) {\n this.tagNames.push(tagName || null);\n return this;\n },\n\n pushOpeningTag: function() {\n var tagName = this.currentTagName();\n if (!tagName) { return; }\n\n if (this._hasElement && !this._element && this.buffer.length === 0) {\n this._element = this.generateElement();\n return;\n }\n\n var buffer = this.buffer,\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n attr, prop;\n\n buffer += '<' + stripTagName(tagName);\n\n if (id) {\n buffer += ' id=\"' + escapeAttribute(id) + '\"';\n this.elementId = null;\n }\n if (classes) {\n buffer += ' class=\"' + escapeAttribute(classes.join(' ')) + '\"';\n this.classes = null;\n this.elementClasses = null;\n }\n\n if (style) {\n buffer += ' style=\"';\n\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n buffer += prop + ':' + escapeAttribute(style[prop]) + ';';\n }\n }\n\n buffer += '\"';\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n buffer += ' ' + attr + '=\"' + escapeAttribute(attrs[attr]) + '\"';\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n var value = props[prop];\n if (value || typeof(value) === 'number') {\n if (value === true) {\n buffer += ' ' + prop + '=\"' + prop + '\"';\n } else {\n buffer += ' ' + prop + '=\"' + escapeAttribute(props[prop]) + '\"';\n }\n }\n }\n }\n\n this.elementProperties = null;\n }\n\n buffer += '>';\n this.buffer = buffer;\n },\n\n pushClosingTag: function() {\n var tagName = this.tagNames.pop();\n if (tagName) { this.buffer += '</' + stripTagName(tagName) + '>'; }\n },\n\n currentTagName: function() {\n return this.tagNames[this.tagNames.length-1];\n },\n\n generateElement: function() {\n var tagName = this.tagNames.pop(), // pop since we don't need to close\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n styleBuffer = '', attr, prop, tagString;\n\n if (attrs && attrs.name && !canSetNameOnInputs) {\n // IE allows passing a tag to createElement. See note on `canSetNameOnInputs` above as well.\n tagString = '<'+stripTagName(tagName)+' name=\"'+escapeAttribute(attrs.name)+'\">';\n } else {\n tagString = tagName;\n }\n\n var element = document.createElement(tagString),\n $element = jQuery(element);\n\n if (id) {\n $element.attr('id', id);\n this.elementId = null;\n }\n if (classes) {\n $element.attr('class', classes.join(' '));\n this.classes = null;\n this.elementClasses = null;\n }\n\n if (style) {\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n styleBuffer += (prop + ':' + style[prop] + ';');\n }\n }\n\n $element.attr('style', styleBuffer);\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n $element.attr(attr, attrs[attr]);\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n $element.prop(prop, props[prop]);\n }\n }\n\n this.elementProperties = null;\n }\n\n return element;\n },\n\n /**\n @method element\n @return {DOMElement} The element corresponding to the generated HTML\n of this buffer\n */\n element: function() {\n var html = this.innerString();\n\n if (html) {\n this._element = setInnerHTML(this._element, html);\n }\n\n return this._element;\n },\n\n /**\n Generates the HTML content for this buffer.\n\n @method string\n @return {String} The generated HTML\n */\n string: function() {\n if (this._hasElement && this._element) {\n // Firefox versions < 11 do not have support for element.outerHTML.\n var thisElement = this.element(), outerHTML = thisElement.outerHTML;\n if (typeof outerHTML === 'undefined') {\n return jQuery('<div/>').append(thisElement).html();\n }\n return outerHTML;\n } else {\n return this.innerString();\n }\n },\n\n innerString: function() {\n return this.buffer;\n }\n };\n\n __exports__[\"default\"] = RenderBuffer;\n });\ndefine(\"ember-views/system/utils\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n\n /**\n @module ember\n @submodule ember-views\n */\n\n /* BEGIN METAMORPH HELPERS */\n\n // Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n // is a \"zero-scope\" element. This problem can be worked around by making\n // the first node an invisible text node. We, like Modernizr, use ­\n\n var needsShy = typeof document !== 'undefined' && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n })();\n\n // IE 8 (and likely earlier) likes to move whitespace preceeding\n // a script tag to appear after it. This means that we can\n // accidentally remove whitespace when updating a morph.\n var movesWhitespace = typeof document !== 'undefined' && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n })();\n\n // Use this to find children by ID instead of using jQuery\n var findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n };\n\n var setInnerHTMLWithoutFix = function(element, html) {\n if (needsShy) {\n html = '­' + html;\n }\n\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n\n if (needsShy) {\n var shyElement = element.firstChild;\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n };\n\n /* END METAMORPH HELPERS */\n\n\n var innerHTMLTags = {};\n var canSetInnerHTML = function(tagName) {\n if (innerHTMLTags[tagName] !== undefined) {\n return innerHTMLTags[tagName];\n }\n\n var canSet = true;\n\n // IE 8 and earlier don't allow us to do innerHTML on select\n if (tagName.toLowerCase() === 'select') {\n var el = document.createElement('select');\n setInnerHTMLWithoutFix(el, '<option value=\"test\">Test</option>');\n canSet = el.options.length === 1;\n }\n\n innerHTMLTags[tagName] = canSet;\n\n return canSet;\n };\n\n var setInnerHTML = function(element, html) {\n var tagName = element.tagName;\n\n if (canSetInnerHTML(tagName)) {\n setInnerHTMLWithoutFix(element, html);\n } else {\n // Firefox versions < 11 do not have support for element.outerHTML.\n var outerHTML = element.outerHTML || new XMLSerializer().serializeToString(element);\n Ember.assert(\"Can't set innerHTML on \"+element.tagName+\" in this browser\", outerHTML);\n\n var startTag = outerHTML.match(new RegExp(\"<\"+tagName+\"([^>]*)>\", 'i'))[0],\n endTag = '</'+tagName+'>';\n\n var wrapper = document.createElement('div');\n setInnerHTMLWithoutFix(wrapper, startTag + html + endTag);\n element = wrapper.firstChild;\n while (element.tagName !== tagName) {\n element = element.nextSibling;\n }\n }\n\n return element;\n };\n\n function isSimpleClick(event) {\n var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,\n secondaryClick = event.which > 1; // IE9 may return undefined\n\n return !modifier && !secondaryClick;\n }\n\n __exports__.setInnerHTML = setInnerHTML;\n __exports__.isSimpleClick = isSimpleClick;\n });\ndefine(\"ember-views/views/collection_view\",\n [\"ember-metal/core\",\"ember-metal/platform\",\"ember-metal/binding\",\"ember-metal/merge\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/string\",\"ember-views/views/container_view\",\"ember-views/views/view\",\"ember-metal/mixin\",\"ember-runtime/mixins/array\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var create = __dependency2__.create;\n var isGlobalPath = __dependency3__.isGlobalPath;\n var merge = __dependency4__[\"default\"];\n var get = __dependency5__.get;\n var set = __dependency6__.set;\n var fmt = __dependency7__.fmt;\n var ContainerView = __dependency8__[\"default\"];\n var CoreView = __dependency9__.CoreView;\n var View = __dependency9__.View;\n var observer = __dependency10__.observer;\n var beforeObserver = __dependency10__.beforeObserver;\n var EmberArray = __dependency11__[\"default\"];\n\n /**\n `Ember.CollectionView` is an `Ember.View` descendent responsible for managing\n a collection (an array or array-like object) by maintaining a child view object\n and associated DOM representation for each item in the array and ensuring\n that child views and their associated rendered HTML are updated when items in\n the array are added, removed, or replaced.\n\n ## Setting content\n\n The managed collection of objects is referenced as the `Ember.CollectionView`\n instance's `content` property.\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n content: ['A', 'B','C']\n })\n ```\n\n The view for each item in the collection will have its `content` property set\n to the item.\n\n ## Specifying itemViewClass\n\n By default the view class for each item in the managed collection will be an\n instance of `Ember.View`. You can supply a different class by setting the\n `CollectionView`'s `itemViewClass` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n classNames: ['a-collection'],\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n someItemsView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view a-collection\">\n <div class=\"ember-view\">the letter: A</div>\n <div class=\"ember-view\">the letter: B</div>\n <div class=\"ember-view\">the letter: C</div>\n </div>\n ```\n\n ## Automatic matching of parent/child tagNames\n\n Setting the `tagName` property of a `CollectionView` to any of\n \"ul\", \"ol\", \"table\", \"thead\", \"tbody\", \"tfoot\", \"tr\", or \"select\" will result\n in the item views receiving an appropriately matched `tagName` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n anUnorderedListView = Ember.CollectionView.create({\n tagName: 'ul',\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n anUnorderedListView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <ul class=\"ember-view a-collection\">\n <li class=\"ember-view\">the letter: A</li>\n <li class=\"ember-view\">the letter: B</li>\n <li class=\"ember-view\">the letter: C</li>\n </ul>\n ```\n\n Additional `tagName` pairs can be provided by adding to\n `Ember.CollectionView.CONTAINER_MAP `\n\n ```javascript\n Ember.CollectionView.CONTAINER_MAP['article'] = 'section'\n ```\n\n ## Programmatic creation of child views\n\n For cases where additional customization beyond the use of a single\n `itemViewClass` or `tagName` matching is required CollectionView's\n `createChildView` method can be overidden:\n\n ```javascript\n CustomCollectionView = Ember.CollectionView.extend({\n createChildView: function(viewClass, attrs) {\n if (attrs.content.kind == 'album') {\n viewClass = App.AlbumView;\n } else {\n viewClass = App.SongView;\n }\n return this._super(viewClass, attrs);\n }\n });\n ```\n\n ## Empty View\n\n You can provide an `Ember.View` subclass to the `Ember.CollectionView`\n instance as its `emptyView` property. If the `content` property of a\n `CollectionView` is set to `null` or an empty array, an instance of this view\n will be the `CollectionView`s only child.\n\n ```javascript\n aListWithNothing = Ember.CollectionView.create({\n classNames: ['nothing']\n content: null,\n emptyView: Ember.View.extend({\n template: Ember.Handlebars.compile(\"The collection is empty\")\n })\n });\n\n aListWithNothing.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view nothing\">\n <div class=\"ember-view\">\n The collection is empty\n </div>\n </div>\n ```\n\n ## Adding and Removing items\n\n The `childViews` property of a `CollectionView` should not be directly\n manipulated. Instead, add, remove, replace items from its `content` property.\n This will trigger appropriate changes to its rendered HTML.\n\n\n @class CollectionView\n @namespace Ember\n @extends Ember.ContainerView\n @since Ember 0.9\n */\n var CollectionView = ContainerView.extend({\n\n /**\n A list of items to be displayed by the `Ember.CollectionView`.\n\n @property content\n @type Ember.Array\n @default null\n */\n content: null,\n\n /**\n This provides metadata about what kind of empty view class this\n collection would like if it is being instantiated from another\n system (like Handlebars)\n\n @private\n @property emptyViewClass\n */\n emptyViewClass: View,\n\n /**\n An optional view to display if content is set to an empty array.\n\n @property emptyView\n @type Ember.View\n @default null\n */\n emptyView: null,\n\n /**\n @property itemViewClass\n @type Ember.View\n @default Ember.View\n */\n itemViewClass: View,\n\n /**\n Setup a CollectionView\n\n @method init\n */\n init: function() {\n var ret = this._super();\n this._contentDidChange();\n return ret;\n },\n\n /**\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @private\n @method _contentWillChange\n */\n _contentWillChange: beforeObserver('content', function() {\n var content = this.get('content');\n\n if (content) { content.removeArrayObserver(this); }\n var len = content ? get(content, 'length') : 0;\n this.arrayWillChange(content, 0, len);\n }),\n\n /**\n Check to make sure that the content has changed, and if so,\n update the children directly. This is always scheduled\n asynchronously, to allow the element to be created before\n bindings have synchronized and vice versa.\n\n @private\n @method _contentDidChange\n */\n _contentDidChange: observer('content', function() {\n var content = get(this, 'content');\n\n if (content) {\n this._assertArrayLike(content);\n content.addArrayObserver(this);\n }\n\n var len = content ? get(content, 'length') : 0;\n this.arrayDidChange(content, 0, null, len);\n }),\n\n /**\n Ensure that the content implements Ember.Array\n\n @private\n @method _assertArrayLike\n */\n _assertArrayLike: function(content) {\n Ember.assert(fmt(\"an Ember.CollectionView's content must implement Ember.Array. You passed %@\", [content]), EmberArray.detect(content));\n },\n\n /**\n Removes the content and content observers.\n\n @method destroy\n */\n destroy: function() {\n if (!this._super()) { return; }\n\n var content = get(this, 'content');\n if (content) { content.removeArrayObserver(this); }\n\n if (this._createdEmptyView) {\n this._createdEmptyView.destroy();\n }\n\n return this;\n },\n\n /**\n Called when a mutation to the underlying content array will occur.\n\n This method will remove any views that are no longer in the underlying\n content array.\n\n Invokes whenever the content array itself will change.\n\n @method arrayWillChange\n @param {Array} content the managed collection of objects\n @param {Number} start the index at which the changes will occurr\n @param {Number} removed number of object to be removed from content\n */\n arrayWillChange: function(content, start, removedCount) {\n // If the contents were empty before and this template collection has an\n // empty view remove it now.\n var emptyView = get(this, 'emptyView');\n if (emptyView && emptyView instanceof View) {\n emptyView.removeFromParent();\n }\n\n // Loop through child views that correspond with the removed items.\n // Note that we loop from the end of the array to the beginning because\n // we are mutating it as we go.\n var childViews = this._childViews, childView, idx, len;\n\n len = this._childViews.length;\n\n var removingAll = removedCount === len;\n\n if (removingAll) {\n this.currentState.empty(this);\n this.invokeRecursively(function(view) {\n view.removedFromDOM = true;\n }, false);\n }\n\n for (idx = start + removedCount - 1; idx >= start; idx--) {\n childView = childViews[idx];\n childView.destroy();\n }\n },\n\n /**\n Called when a mutation to the underlying content array occurs.\n\n This method will replay that mutation against the views that compose the\n `Ember.CollectionView`, ensuring that the view reflects the model.\n\n This array observer is added in `contentDidChange`.\n\n @method arrayDidChange\n @param {Array} content the managed collection of objects\n @param {Number} start the index at which the changes occurred\n @param {Number} removed number of object removed from content\n @param {Number} added number of object added to content\n */\n arrayDidChange: function(content, start, removed, added) {\n var addedViews = [], view, item, idx, len, itemViewClass,\n emptyView;\n\n len = content ? get(content, 'length') : 0;\n\n if (len) {\n itemViewClass = get(this, 'itemViewClass');\n\n if ('string' === typeof itemViewClass && isGlobalPath(itemViewClass)) {\n itemViewClass = get(itemViewClass) || itemViewClass;\n }\n\n Ember.assert(fmt(\"itemViewClass must be a subclass of Ember.View, not %@\",\n [itemViewClass]),\n 'string' === typeof itemViewClass || View.detect(itemViewClass));\n\n for (idx = start; idx < start+added; idx++) {\n item = content.objectAt(idx);\n\n view = this.createChildView(itemViewClass, {\n content: item,\n contentIndex: idx\n });\n\n addedViews.push(view);\n }\n } else {\n emptyView = get(this, 'emptyView');\n\n if (!emptyView) { return; }\n\n if ('string' === typeof emptyView && isGlobalPath(emptyView)) {\n emptyView = get(emptyView) || emptyView;\n }\n\n emptyView = this.createChildView(emptyView);\n addedViews.push(emptyView);\n set(this, 'emptyView', emptyView);\n\n if (CoreView.detect(emptyView)) {\n this._createdEmptyView = emptyView;\n }\n }\n\n this.replace(start, 0, addedViews);\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n The tag name for the view will be set to the tagName of the viewClass\n passed in.\n\n @method createChildView\n @param {Class} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n var itemTagName = get(view, 'tagName');\n\n if (itemTagName === null || itemTagName === undefined) {\n itemTagName = CollectionView.CONTAINER_MAP[get(this, 'tagName')];\n set(view, 'tagName', itemTagName);\n }\n\n return view;\n }\n });\n\n /**\n A map of parent tags to their default child tags. You can add\n additional parent tags if you want collection views that use\n a particular parent tag to default to a child tag.\n\n @property CONTAINER_MAP\n @type Hash\n @static\n @final\n */\n CollectionView.CONTAINER_MAP = {\n ul: 'li',\n ol: 'li',\n table: 'tr',\n thead: 'tr',\n tbody: 'tr',\n tfoot: 'tr',\n tr: 'td',\n select: 'option'\n };\n\n __exports__[\"default\"] = CollectionView;\n });\ndefine(\"ember-views/views/component\",\n [\"ember-metal/core\",\"ember-views/mixins/component_template_deprecation\",\"ember-runtime/mixins/target_action_support\",\"ember-views/views/view\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/is_none\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.Handlebars\n\n var ComponentTemplateDeprecation = __dependency2__[\"default\"];\n var TargetActionSupport = __dependency3__[\"default\"];\n var View = __dependency4__.View;var get = __dependency5__.get;\n var set = __dependency6__.set;\n var isNone = __dependency7__.isNone;\n\n var computed = __dependency8__.computed;\n\n var a_slice = Array.prototype.slice;\n\n /**\n @module ember\n @submodule ember-views\n */\n\n /**\n An `Ember.Component` is a view that is completely\n isolated. Property access in its templates go\n to the view object and actions are targeted at\n the view object. There is no access to the\n surrounding context or outer controller; all\n contextual information must be passed in.\n\n The easiest way to create an `Ember.Component` is via\n a template. If you name a template\n `components/my-foo`, you will be able to use\n `{{my-foo}}` in other templates, which will make\n an instance of the isolated component.\n\n ```handlebars\n {{app-profile person=currentUser}}\n ```\n\n ```handlebars\n <!-- app-profile template -->\n <h1>{{person.title}}</h1>\n <img {{bind-attr src=person.avatar}}>\n <p class='signature'>{{person.signature}}</p>\n ```\n\n You can use `yield` inside a template to\n include the **contents** of any block attached to\n the component. The block will be executed in the\n context of the surrounding context or outer controller:\n\n ```handlebars\n {{#app-profile person=currentUser}}\n <p>Admin mode</p>\n {{! Executed in the controller's context. }}\n {{/app-profile}}\n ```\n\n ```handlebars\n <!-- app-profile template -->\n <h1>{{person.title}}</h1>\n {{! Executed in the components context. }}\n {{yield}} {{! block contents }}\n ```\n\n If you want to customize the component, in order to\n handle events or actions, you implement a subclass\n of `Ember.Component` named after the name of the\n component. Note that `Component` needs to be appended to the name of\n your subclass like `AppProfileComponent`.\n\n For example, you could implement the action\n `hello` for the `app-profile` component:\n\n ```javascript\n App.AppProfileComponent = Ember.Component.extend({\n actions: {\n hello: function(name) {\n console.log(\"Hello\", name);\n }\n }\n });\n ```\n\n And then use it in the component's template:\n\n ```handlebars\n <!-- app-profile template -->\n\n <h1>{{person.title}}</h1>\n {{yield}} <!-- block contents -->\n\n <button {{action 'hello' person.name}}>\n Say Hello to {{person.name}}\n </button>\n ```\n\n Components must have a `-` in their name to avoid\n conflicts with built-in controls that wrap HTML\n elements. This is consistent with the same\n requirement in web components.\n\n @class Component\n @namespace Ember\n @extends Ember.View\n */\n var Component = View.extend(TargetActionSupport, ComponentTemplateDeprecation, {\n instrumentName: 'component',\n instrumentDisplay: computed(function() {\n if (this._debugContainerKey) {\n return '{{' + this._debugContainerKey.split(':')[1] + '}}';\n }\n }),\n\n init: function() {\n this._super();\n set(this, 'context', this);\n set(this, 'controller', this);\n },\n\n defaultLayout: function(context, options){\n Ember.Handlebars.helpers['yield'].call(context, options);\n },\n\n /**\n A components template property is set by passing a block\n during its invocation. It is executed within the parent context.\n\n Example:\n\n ```handlebars\n {{#my-component}}\n // something that is run in the context\n // of the parent context\n {{/my-component}}\n ```\n\n Specifying a template directly to a component is deprecated without\n also specifying the layout property.\n\n @deprecated\n @property template\n */\n template: computed(function(key, value) {\n if (value !== undefined) { return value; }\n\n var templateName = get(this, 'templateName'),\n template = this.templateForName(templateName, 'template');\n\n Ember.assert(\"You specified the templateName \" + templateName + \" for \" + this + \", but it did not exist.\", !templateName || template);\n\n return template || get(this, 'defaultTemplate');\n }).property('templateName'),\n\n /**\n Specifying a components `templateName` is deprecated without also\n providing the `layout` or `layoutName` properties.\n\n @deprecated\n @property templateName\n */\n templateName: null,\n\n // during render, isolate keywords\n cloneKeywords: function() {\n return {\n view: this,\n controller: this\n };\n },\n\n _yield: function(context, options) {\n var view = options.data.view,\n parentView = this._parentView,\n template = get(this, 'template');\n\n if (template) {\n Ember.assert(\"A Component must have a parent view in order to yield.\", parentView);\n\n view.appendChild(View, {\n isVirtual: true,\n tagName: '',\n _contextView: parentView,\n template: template,\n context: get(parentView, 'context'),\n controller: get(parentView, 'controller'),\n templateData: { keywords: parentView.cloneKeywords() }\n });\n }\n },\n\n /**\n If the component is currently inserted into the DOM of a parent view, this\n property will point to the controller of the parent view.\n\n @property targetObject\n @type Ember.Controller\n @default null\n */\n targetObject: computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n Triggers a named action on the controller context where the component is used if\n this controller has registered for notifications of the action.\n\n For example a component for playing or pausing music may translate click events\n into action notifications of \"play\" or \"stop\" depending on some internal state\n of the component:\n\n\n ```javascript\n App.PlayButtonComponent = Ember.Component.extend({\n click: function(){\n if (this.get('isPlaying')) {\n this.sendAction('play');\n } else {\n this.sendAction('stop');\n }\n }\n });\n ```\n\n When used inside a template these component actions are configured to\n trigger actions in the outer application context:\n\n ```handlebars\n {{! application.hbs }}\n {{play-button play=\"musicStarted\" stop=\"musicStopped\"}}\n ```\n\n When the component receives a browser `click` event it translate this\n interaction into application-specific semantics (\"play\" or \"stop\") and\n triggers the specified action name on the controller for the template\n where the component is used:\n\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n musicStarted: function(){\n // called when the play button is clicked\n // and the music started playing\n },\n musicStopped: function(){\n // called when the play button is clicked\n // and the music stopped playing\n }\n }\n });\n ```\n\n If no action name is passed to `sendAction` a default name of \"action\"\n is assumed.\n\n ```javascript\n App.NextButtonComponent = Ember.Component.extend({\n click: function(){\n this.sendAction();\n }\n });\n ```\n\n ```handlebars\n {{! application.hbs }}\n {{next-button action=\"playNextSongInAlbum\"}}\n ```\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n playNextSongInAlbum: function(){\n ...\n }\n }\n });\n ```\n\n @method sendAction\n @param [action] {String} the action to trigger\n @param [context] {*} a context to send with the action\n */\n sendAction: function(action) {\n var actionName,\n contexts = a_slice.call(arguments, 1);\n\n // Send the default action\n if (action === undefined) {\n actionName = get(this, 'action');\n Ember.assert(\"The default action was triggered on the component \" + this.toString() +\n \", but the action name (\" + actionName + \") was not a string.\",\n isNone(actionName) || typeof actionName === 'string');\n } else {\n actionName = get(this, action);\n Ember.assert(\"The \" + action + \" action was triggered on the component \" +\n this.toString() + \", but the action name (\" + actionName +\n \") was not a string.\",\n isNone(actionName) || typeof actionName === 'string');\n }\n\n // If no action name for that action could be found, just abort.\n if (actionName === undefined) { return; }\n\n this.triggerAction({\n action: actionName,\n actionContext: contexts\n });\n }\n });\n\n __exports__[\"default\"] = Component;\n });\ndefine(\"ember-views/views/container_view\",\n [\"ember-metal/core\",\"ember-metal/merge\",\"ember-runtime/mixins/mutable_array\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/view\",\"ember-views/views/states\",\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"ember-metal/computed\",\"ember-metal/run_loop\",\"ember-metal/properties\",\"ember-views/system/render_buffer\",\"ember-metal/mixin\",\"ember-runtime/system/native_array\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.K\n\n var merge = __dependency2__[\"default\"];\n var MutableArray = __dependency3__[\"default\"];\n var get = __dependency4__.get;\n var set = __dependency5__.set;\n\n var View = __dependency6__.View;\n var ViewCollection = __dependency6__.ViewCollection;\n var cloneStates = __dependency7__.cloneStates;\n var EmberViewStates = __dependency7__.states;\n\n var EmberError = __dependency8__[\"default\"];\n\n // ES6TODO: functions on EnumerableUtils should get their own export\n var EnumerableUtils = __dependency9__[\"default\"];\n var forEach = EnumerableUtils.forEach;\n\n var computed = __dependency10__.computed;\n var run = __dependency11__[\"default\"];\n var defineProperty = __dependency12__.defineProperty;\n var RenderBuffer = __dependency13__[\"default\"];\n var observer = __dependency14__.observer;\n var beforeObserver = __dependency14__.beforeObserver;\n var A = __dependency15__.A;\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var states = cloneStates(EmberViewStates);\n\n /**\n A `ContainerView` is an `Ember.View` subclass that implements `Ember.MutableArray`\n allowing programmatic management of its child views.\n\n ## Setting Initial Child Views\n\n The initial array of child views can be set in one of two ways. You can\n provide a `childViews` property at creation time that contains instance of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: [Ember.View.create(), Ember.View.create()]\n });\n ```\n\n You can also provide a list of property names whose values are instances of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', 'bView', 'cView'],\n aView: Ember.View.create(),\n bView: Ember.View.create(),\n cView: Ember.View.create()\n });\n ```\n\n The two strategies can be combined:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', Ember.View.create()],\n aView: Ember.View.create()\n });\n ```\n\n Each child view's rendering will be inserted into the container's rendered\n HTML in the same order as its position in the `childViews` property.\n\n ## Adding and Removing Child Views\n\n The container view implements `Ember.MutableArray` allowing programmatic management of its child views.\n\n To remove a view, pass that view into a `removeObject` call on the container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Removing a view\n\n ```javascript\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.removeObject(aContainer.get('bView'));\n aContainer.toArray(); // [aContainer.aView]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n </div>\n ```\n\n Similarly, adding a child view is accomplished by adding `Ember.View` instances to the\n container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Adding a view\n\n ```javascript\n AnotherViewClass = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Another view\")\n });\n\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.pushObject(AnotherViewClass.create());\n aContainer.toArray(); // [aContainer.aView, aContainer.bView, <AnotherViewClass instance>]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n <div class=\"ember-view\">Another view</div>\n </div>\n ```\n\n ## Templates and Layout\n\n A `template`, `templateName`, `defaultTemplate`, `layout`, `layoutName` or\n `defaultLayout` property on a container view will not result in the template\n or layout being rendered. The HTML contents of a `Ember.ContainerView`'s DOM\n representation will only be the rendered HTML of its child views.\n\n @class ContainerView\n @namespace Ember\n @extends Ember.View\n */\n var ContainerView = View.extend(MutableArray, {\n states: states,\n\n init: function() {\n this._super();\n\n var childViews = get(this, 'childViews');\n\n // redefine view's childViews property that was obliterated\n defineProperty(this, 'childViews', View.childViewsProperty);\n\n var _childViews = this._childViews;\n\n forEach(childViews, function(viewName, idx) {\n var view;\n\n if ('string' === typeof viewName) {\n view = get(this, viewName);\n view = this.createChildView(view);\n set(this, viewName, view);\n } else {\n view = this.createChildView(viewName);\n }\n\n _childViews[idx] = view;\n }, this);\n\n var currentView = get(this, 'currentView');\n if (currentView) {\n if (!_childViews.length) { _childViews = this._childViews = this._childViews.slice(); }\n _childViews.push(this.createChildView(currentView));\n }\n },\n\n replace: function(idx, removedCount, addedViews) {\n var addedCount = addedViews ? get(addedViews, 'length') : 0;\n var self = this;\n Ember.assert(\"You can't add a child to a container - the child is already a child of another view\", A(addedViews).every(function(item) { return !get(item, '_parentView') || get(item, '_parentView') === self; }));\n\n this.arrayContentWillChange(idx, removedCount, addedCount);\n this.childViewsWillChange(this._childViews, idx, removedCount);\n\n if (addedCount === 0) {\n this._childViews.splice(idx, removedCount) ;\n } else {\n var args = [idx, removedCount].concat(addedViews);\n if (addedViews.length && !this._childViews.length) { this._childViews = this._childViews.slice(); }\n this._childViews.splice.apply(this._childViews, args);\n }\n\n this.arrayContentDidChange(idx, removedCount, addedCount);\n this.childViewsDidChange(this._childViews, idx, removedCount, addedCount);\n\n return this;\n },\n\n objectAt: function(idx) {\n return this._childViews[idx];\n },\n\n length: computed(function () {\n return this._childViews.length;\n }).volatile(),\n\n /**\n Instructs each child view to render to the passed render buffer.\n\n @private\n @method render\n @param {Ember.RenderBuffer} buffer the buffer to render to\n */\n render: function(buffer) {\n this.forEachChildView(function(view) {\n view.renderToBuffer(buffer);\n });\n },\n\n instrumentName: 'container',\n\n /**\n When a child view is removed, destroy its element so that\n it is removed from the DOM.\n\n The array observer that triggers this action is set up in the\n `renderToBuffer` method.\n\n @private\n @method childViewsWillChange\n @param {Ember.Array} views the child views array before mutation\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n **/\n childViewsWillChange: function(views, start, removed) {\n this.propertyWillChange('childViews');\n\n if (removed > 0) {\n var changedViews = views.slice(start, start+removed);\n // transition to preRender before clearing parentView\n this.currentState.childViewsWillChange(this, views, start, removed);\n this.initializeViews(changedViews, null, null);\n }\n },\n\n removeChild: function(child) {\n this.removeObject(child);\n return this;\n },\n\n /**\n When a child view is added, make sure the DOM gets updated appropriately.\n\n If the view has already rendered an element, we tell the child view to\n create an element and insert it into the DOM. If the enclosing container\n view has already written to a buffer, but not yet converted that buffer\n into an element, we insert the string representation of the child into the\n appropriate place in the buffer.\n\n @private\n @method childViewsDidChange\n @param {Ember.Array} views the array of child views after the mutation has occurred\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n @param {Number} added the number of child views added\n */\n childViewsDidChange: function(views, start, removed, added) {\n if (added > 0) {\n var changedViews = views.slice(start, start+added);\n this.initializeViews(changedViews, this, get(this, 'templateData'));\n this.currentState.childViewsDidChange(this, views, start, added);\n }\n this.propertyDidChange('childViews');\n },\n\n initializeViews: function(views, parentView, templateData) {\n forEach(views, function(view) {\n set(view, '_parentView', parentView);\n\n if (!view.container && parentView) {\n set(view, 'container', parentView.container);\n }\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', templateData);\n }\n });\n },\n\n currentView: null,\n\n _currentViewWillChange: beforeObserver('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n currentView.destroy();\n }\n }),\n\n _currentViewDidChange: observer('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n Ember.assert(\"You tried to set a current view that already has a parent. Make sure you don't have multiple outlets in the same view.\", !get(currentView, '_parentView'));\n this.pushObject(currentView);\n }\n }),\n\n _ensureChildrenAreInDOM: function () {\n this.currentState.ensureChildrenAreInDOM(this);\n }\n });\n\n merge(states._default, {\n childViewsWillChange: Ember.K,\n childViewsDidChange: Ember.K,\n ensureChildrenAreInDOM: Ember.K\n });\n\n merge(states.inBuffer, {\n childViewsDidChange: function(parentView, views, start, added) {\n throw new EmberError('You cannot modify child views while in the inBuffer state');\n }\n });\n\n merge(states.hasElement, {\n childViewsWillChange: function(view, views, start, removed) {\n for (var i=start; i<start+removed; i++) {\n views[i].remove();\n }\n },\n\n childViewsDidChange: function(view, views, start, added) {\n run.scheduleOnce('render', view, '_ensureChildrenAreInDOM');\n },\n\n ensureChildrenAreInDOM: function(view) {\n var childViews = view._childViews, i, len, childView, previous, buffer, viewCollection = new ViewCollection();\n\n for (i = 0, len = childViews.length; i < len; i++) {\n childView = childViews[i];\n\n if (!buffer) { buffer = RenderBuffer(); buffer._hasElement = false; }\n\n if (childView.renderToBufferIfNeeded(buffer)) {\n viewCollection.push(childView);\n } else if (viewCollection.length) {\n insertViewCollection(view, viewCollection, previous, buffer);\n buffer = null;\n previous = childView;\n viewCollection.clear();\n } else {\n previous = childView;\n }\n }\n\n if (viewCollection.length) {\n insertViewCollection(view, viewCollection, previous, buffer);\n }\n }\n });\n\n function insertViewCollection(view, viewCollection, previous, buffer) {\n viewCollection.triggerRecursively('willInsertElement');\n\n if (previous) {\n previous.domManager.after(previous, buffer.string());\n } else {\n view.domManager.prepend(view, buffer.string());\n }\n\n viewCollection.forEach(function(v) {\n v.transitionTo('inDOM');\n v.propertyDidChange('element');\n v.triggerRecursively('didInsertElement');\n });\n }\n\n\n __exports__[\"default\"] = ContainerView;\n });\ndefine(\"ember-views/views/states\",\n [\"ember-metal/platform\",\"ember-metal/merge\",\"ember-views/views/states/default\",\"ember-views/views/states/pre_render\",\"ember-views/views/states/in_buffer\",\"ember-views/views/states/has_element\",\"ember-views/views/states/in_dom\",\"ember-views/views/states/destroying\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var create = __dependency1__.create;\n var merge = __dependency2__[\"default\"];\n var _default = __dependency3__[\"default\"];\n var preRender = __dependency4__[\"default\"];\n var inBuffer = __dependency5__[\"default\"];\n var hasElement = __dependency6__[\"default\"];\n var inDOM = __dependency7__[\"default\"];\n var destroying = __dependency8__[\"default\"];\n\n function cloneStates(from) {\n var into = {};\n\n into._default = {};\n into.preRender = create(into._default);\n into.destroying = create(into._default);\n into.inBuffer = create(into._default);\n into.hasElement = create(into._default);\n into.inDOM = create(into.hasElement);\n\n for (var stateName in from) {\n if (!from.hasOwnProperty(stateName)) { continue; }\n merge(into[stateName], from[stateName]);\n }\n\n return into;\n };\n\n var states = {\n _default: _default,\n preRender: preRender,\n inDOM: inDOM,\n inBuffer: inBuffer,\n hasElement: hasElement,\n destroying: destroying\n };\n\n __exports__.cloneStates = cloneStates;\n __exports__.states = states;\n });\ndefine(\"ember-views/views/states/default\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/run_loop\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.K\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var run = __dependency4__[\"default\"];\n var EmberError = __dependency5__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n var _default = {\n // appendChild is only legal while rendering the buffer.\n appendChild: function() {\n throw new EmberError(\"You can't use appendChild outside of the rendering process\");\n },\n\n $: function() {\n return undefined;\n },\n\n getElement: function() {\n return null;\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function() {\n return true; // continue event propagation\n },\n\n destroyElement: function(view) {\n set(view, 'element', null);\n if (view._scheduledInsert) {\n run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n renderToBufferIfNeeded: function () {\n return false;\n },\n\n rerender: Ember.K,\n invokeObserver: Ember.K\n };\n\n __exports__[\"default\"] = _default;\n });\ndefine(\"ember-views/views/states/destroying\",\n [\"ember-metal/merge\",\"ember-metal/platform\",\"ember-runtime/system/string\",\"ember-views/views/states/default\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var merge = __dependency1__[\"default\"];\n var create = __dependency2__.create;\n var fmt = __dependency3__.fmt;\n var _default = __dependency4__[\"default\"];\n var EmberError = __dependency5__[\"default\"];\n /**\n @module ember\n @submodule ember-views\n */\n\n var destroyingError = \"You can't call %@ on a view being destroyed\";\n\n var destroying = create(_default);\n\n merge(destroying, {\n appendChild: function() {\n throw new EmberError(fmt(destroyingError, ['appendChild']));\n },\n rerender: function() {\n throw new EmberError(fmt(destroyingError, ['rerender']));\n },\n destroyElement: function() {\n throw new EmberError(fmt(destroyingError, ['destroyElement']));\n },\n empty: function() {\n throw new EmberError(fmt(destroyingError, ['empty']));\n },\n\n setElement: function() {\n throw new EmberError(fmt(destroyingError, [\"set('element', ...)\"]));\n },\n\n renderToBufferIfNeeded: function() {\n return false;\n },\n\n // Since element insertion is scheduled, don't do anything if\n // the view has been destroyed between scheduling and execution\n insertElement: Ember.K\n });\n\n __exports__[\"default\"] = destroying;\n });\ndefine(\"ember-views/views/states/has_element\",\n [\"ember-views/views/states/default\",\"ember-metal/run_loop\",\"ember-metal/merge\",\"ember-metal/platform\",\"ember-views/system/jquery\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var _default = __dependency1__[\"default\"];\n var run = __dependency2__[\"default\"];\n var merge = __dependency3__[\"default\"];\n var create = __dependency4__.create;\n var jQuery = __dependency5__[\"default\"];\n var EmberError = __dependency6__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var get = __dependency7__.get;\n var set = __dependency8__.set;\n\n var hasElement = create(_default);\n\n merge(hasElement, {\n $: function(view, sel) {\n var elem = get(view, 'element');\n return sel ? jQuery(sel, elem) : jQuery(elem);\n },\n\n getElement: function(view) {\n var parent = get(view, 'parentView');\n if (parent) { parent = get(parent, 'element'); }\n if (parent) { return view.findElementInParentElement(parent); }\n return jQuery(\"#\" + get(view, 'elementId'))[0];\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n throw new EmberError(\"You cannot set an element to a non-null value when the element is already in the DOM.\");\n }\n\n return value;\n },\n\n // once the view has been inserted into the DOM, rerendering is\n // deferred to allow bindings to synchronize.\n rerender: function(view) {\n view.triggerRecursively('willClearRender');\n\n view.clearRenderedChildren();\n\n view.domManager.replace(view);\n return view;\n },\n\n // once the view is already in the DOM, destroying it removes it\n // from the DOM, nukes its element, and puts it back into the\n // preRender state if inDOM.\n\n destroyElement: function(view) {\n view._notifyWillDestroyElement();\n view.domManager.remove(view);\n set(view, 'element', null);\n if (view._scheduledInsert) {\n run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n empty: function(view) {\n var _childViews = view._childViews, len, idx;\n if (_childViews) {\n len = _childViews.length;\n for (idx = 0; idx < len; idx++) {\n _childViews[idx]._notifyWillDestroyElement();\n }\n }\n view.domManager.empty(view);\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function(view, eventName, evt) {\n if (view.has(eventName)) {\n // Handler should be able to re-dispatch events, so we don't\n // preventDefault or stopPropagation.\n return view.trigger(eventName, evt);\n } else {\n return true; // continue event propagation\n }\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n });\n\n __exports__[\"default\"] = hasElement;\n });\ndefine(\"ember-views/views/states/in_buffer\",\n [\"ember-views/views/states/default\",\"ember-metal/error\",\"ember-metal/core\",\"ember-metal/platform\",\"ember-metal/merge\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var _default = __dependency1__[\"default\"];\n var EmberError = __dependency2__[\"default\"];\n\n var Ember = __dependency3__[\"default\"];\n // Ember.assert\n var create = __dependency4__.create;\n var merge = __dependency5__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var inBuffer = create(_default);\n\n merge(inBuffer, {\n $: function(view, sel) {\n // if we don't have an element yet, someone calling this.$() is\n // trying to update an element that isn't in the DOM. Instead,\n // rerender the view to allow the render method to reflect the\n // changes.\n view.rerender();\n return Ember.$();\n },\n\n // when a view is rendered in a buffer, rerendering it simply\n // replaces the existing buffer with a new one\n rerender: function(view) {\n throw new EmberError(\"Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.\");\n },\n\n // when a view is rendered in a buffer, appending a child\n // view will render that view and append the resulting\n // buffer into its buffer.\n appendChild: function(view, childView, options) {\n var buffer = view.buffer, _childViews = view._childViews;\n\n childView = view.createChildView(childView, options);\n if (!_childViews.length) { _childViews = view._childViews = _childViews.slice(); }\n _childViews.push(childView);\n\n childView.renderToBuffer(buffer);\n\n view.propertyDidChange('childViews');\n\n return childView;\n },\n\n // when a view is rendered in a buffer, destroying the\n // element will simply destroy the buffer and put the\n // state back into the preRender state.\n destroyElement: function(view) {\n view.clearBuffer();\n var viewCollection = view._notifyWillDestroyElement();\n viewCollection.transitionTo('preRender', false);\n\n return view;\n },\n\n empty: function() {\n Ember.assert(\"Emptying a view in the inBuffer state is not allowed and \" +\n \"should not happen under normal circumstances. Most likely \" +\n \"there is a bug in your application. This may be due to \" +\n \"excessive property change notifications.\");\n },\n\n renderToBufferIfNeeded: function (view, buffer) {\n return false;\n },\n\n // It should be impossible for a rendered view to be scheduled for\n // insertion.\n insertElement: function() {\n throw new EmberError(\"You can't insert an element that has already been rendered\");\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n view.clearBuffer();\n view.transitionTo('hasElement');\n }\n\n return value;\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n });\n\n __exports__[\"default\"] = inBuffer;\n });\ndefine(\"ember-views/views/states/in_dom\",\n [\"ember-metal/core\",\"ember-metal/platform\",\"ember-metal/merge\",\"ember-metal/error\",\"ember-views/views/states/has_element\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var create = __dependency2__.create;\n var merge = __dependency3__[\"default\"];\n var EmberError = __dependency4__[\"default\"];\n\n var hasElement = __dependency5__[\"default\"];\n /**\n @module ember\n @submodule ember-views\n */\n\n var inDOM = create(hasElement);\n\n var View;\n\n merge(inDOM, {\n enter: function(view) {\n if (!View) { View = requireModule('ember-views/views/view')[\"View\"]; } // ES6TODO: this sucks. Have to avoid cycles...\n\n // Register the view for event handling. This hash is used by\n // Ember.EventDispatcher to dispatch incoming events.\n if (!view.isVirtual) {\n Ember.assert(\"Attempted to register a view with an id already in use: \"+view.elementId, !View.views[view.elementId]);\n View.views[view.elementId] = view;\n }\n\n view.addBeforeObserver('elementId', function() {\n throw new EmberError(\"Changing a view's elementId after creation is not allowed\");\n });\n },\n\n exit: function(view) {\n if (!View) { View = requireModule('ember-views/views/view')[\"View\"]; } // ES6TODO: this sucks. Have to avoid cycles...\n\n if (!this.isVirtual) delete View.views[view.elementId];\n },\n\n insertElement: function(view, fn) {\n throw new EmberError(\"You can't insert an element into the DOM that has already been inserted\");\n }\n });\n\n __exports__[\"default\"] = inDOM;\n });\ndefine(\"ember-views/views/states/pre_render\",\n [\"ember-views/views/states/default\",\"ember-metal/platform\",\"ember-metal/merge\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var _default = __dependency1__[\"default\"];\n var create = __dependency2__.create;\n var merge = __dependency3__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n var preRender = create(_default);\n\n merge(preRender, {\n // a view leaves the preRender state once its element has been\n // created (createElement).\n insertElement: function(view, fn) {\n view.createElement();\n var viewCollection = view.viewHierarchyCollection();\n\n viewCollection.trigger('willInsertElement');\n\n fn.call(view);\n\n // We transition to `inDOM` if the element exists in the DOM\n var element = view.get('element');\n if (document.body.contains(element)) {\n viewCollection.transitionTo('inDOM', false);\n viewCollection.trigger('didInsertElement');\n }\n },\n\n renderToBufferIfNeeded: function(view, buffer) {\n view.renderToBuffer(buffer);\n return true;\n },\n\n empty: Ember.K,\n\n setElement: function(view, value) {\n if (value !== null) {\n view.transitionTo('hasElement');\n }\n return value;\n }\n });\n\n __exports__[\"default\"] = preRender;\n });\ndefine(\"ember-views/views/view\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-runtime/system/object\",\"ember-runtime/mixins/evented\",\"ember-runtime/mixins/action_handler\",\"ember-views/system/render_buffer\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/set_properties\",\"ember-metal/run_loop\",\"ember-metal/observer\",\"ember-metal/properties\",\"ember-metal/utils\",\"ember-metal/computed\",\"ember-metal/mixin\",\"ember-metal/is_none\",\"container/container\",\"ember-runtime/system/native_array\",\"ember-metal/instrumentation\",\"ember-runtime/system/string\",\"ember-metal/enumerable_utils\",\"ember-runtime/copy\",\"ember-metal/binding\",\"ember-metal/property_events\",\"ember-views/views/states\",\"ember-views/system/jquery\",\"ember-views/system/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __dependency27__, __exports__) {\n \"use strict\";\n // Ember.assert, Ember.deprecate, Ember.warn, Ember.TEMPLATES,\n // Ember.K, jQuery, Ember.lookup,\n // Ember.ContainerView circular dependency\n // Ember.ENV\n var Ember = __dependency1__[\"default\"];\n\n var EmberError = __dependency2__[\"default\"];\n var EmberObject = __dependency3__[\"default\"];\n var Evented = __dependency4__[\"default\"];\n var ActionHandler = __dependency5__[\"default\"];\n var RenderBuffer = __dependency6__[\"default\"];\n var get = __dependency7__.get;\n var set = __dependency8__.set;\n var setProperties = __dependency9__[\"default\"];\n var run = __dependency10__[\"default\"];\n var addObserver = __dependency11__.addObserver;\n var removeObserver = __dependency11__.removeObserver;\n\n var defineProperty = __dependency12__.defineProperty;\n var guidFor = __dependency13__.guidFor;\n var meta = __dependency13__.meta;\n var computed = __dependency14__.computed;\n var observer = __dependency15__.observer;\n\n var typeOf = __dependency13__.typeOf;\n var isArray = __dependency13__.isArray;\n var isNone = __dependency16__.isNone;\n var Mixin = __dependency15__.Mixin;\n var Container = __dependency17__[\"default\"];\n var A = __dependency18__.A;\n\n var instrument = __dependency19__.instrument;\n\n var dasherize = __dependency20__.dasherize;\n\n // ES6TODO: functions on EnumerableUtils should get their own export\n var EnumerableUtils = __dependency21__[\"default\"];\n var a_forEach = EnumerableUtils.forEach,\n a_addObject = EnumerableUtils.addObject,\n a_removeObject = EnumerableUtils.removeObject;\n\n var beforeObserver = __dependency15__.beforeObserver;\n var copy = __dependency22__[\"default\"];\n var isGlobalPath = __dependency23__.isGlobalPath;\n\n var propertyWillChange = __dependency24__.propertyWillChange;\n var propertyDidChange = __dependency24__.propertyDidChange;\n\n var cloneStates = __dependency25__.cloneStates;\n var states = __dependency25__.states;\n var jQuery = __dependency26__[\"default\"];\n // for the side effect of extending Ember.run.queues\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var ContainerView;\n\n function nullViewsBuffer(view) {\n view.buffer = null;\n\n }\n\n function clearCachedElement(view) {\n meta(view).cache.element = undefined;\n }\n\n var childViewsProperty = computed(function() {\n var childViews = this._childViews, ret = A(), view = this;\n\n a_forEach(childViews, function(view) {\n var currentChildViews;\n if (view.isVirtual) {\n if (currentChildViews = get(view, 'childViews')) {\n ret.pushObjects(currentChildViews);\n }\n } else {\n ret.push(view);\n }\n });\n\n ret.replace = function (idx, removedCount, addedViews) {\n if (!ContainerView) { ContainerView = requireModule('ember-views/views/container_view')['default']; } // ES6TODO: stupid circular dep\n\n if (view instanceof ContainerView) {\n Ember.deprecate(\"Manipulating an Ember.ContainerView through its childViews property is deprecated. Please use the ContainerView instance itself as an Ember.MutableArray.\");\n return view.replace(idx, removedCount, addedViews);\n }\n throw new EmberError(\"childViews is immutable\");\n };\n\n return ret;\n });\n\n Ember.warn(\"The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.\", Ember.ENV.VIEW_PRESERVES_CONTEXT !== false);\n\n /**\n Global hash of shared templates. This will automatically be populated\n by the build tools so that you can store your Handlebars templates in\n separate files that get loaded into JavaScript at buildtime.\n\n @property TEMPLATES\n @for Ember\n @type Hash\n */\n Ember.TEMPLATES = {};\n\n /**\n `Ember.CoreView` is an abstract class that exists to give view-like behavior\n to both Ember's main view class `Ember.View` and other classes like\n `Ember._SimpleMetamorphView` that don't need the fully functionaltiy of\n `Ember.View`.\n\n Unless you have specific needs for `CoreView`, you will use `Ember.View`\n in your applications.\n\n @class CoreView\n @namespace Ember\n @extends Ember.Object\n @uses Ember.Evented\n @uses Ember.ActionHandler\n */\n\n var CoreView = EmberObject.extend(Evented, ActionHandler, {\n isView: true,\n\n states: cloneStates(states),\n\n init: function() {\n this._super();\n this.transitionTo('preRender');\n this._isVisible = get(this, 'isVisible');\n },\n\n /**\n If the view is currently inserted into the DOM of a parent view, this\n property will point to the parent of the view.\n\n @property parentView\n @type Ember.View\n @default null\n */\n parentView: computed('_parentView', function() {\n var parent = this._parentView;\n\n if (parent && parent.isVirtual) {\n return get(parent, 'parentView');\n } else {\n return parent;\n }\n }),\n\n state: null,\n\n _parentView: null,\n\n // return the current view, not including virtual views\n concreteView: computed('parentView', function() {\n if (!this.isVirtual) { return this; }\n else { return get(this, 'parentView.concreteView'); }\n }),\n\n instrumentName: 'core_view',\n\n instrumentDetails: function(hash) {\n hash.object = this.toString();\n hash.containerKey = this._debugContainerKey;\n hash.view = this;\n },\n\n /**\n Invoked by the view system when this view needs to produce an HTML\n representation. This method will create a new render buffer, if needed,\n then apply any default attributes, such as class names and visibility.\n Finally, the `render()` method is invoked, which is responsible for\n doing the bulk of the rendering.\n\n You should not need to override this method; instead, implement the\n `template` property, or if you need more control, override the `render`\n method.\n\n @method renderToBuffer\n @param {Ember.RenderBuffer} buffer the render buffer. If no buffer is\n passed, a default buffer, using the current view's `tagName`, will\n be used.\n @private\n */\n renderToBuffer: function(parentBuffer, bufferOperation) {\n var name = 'render.' + this.instrumentName,\n details = {};\n\n this.instrumentDetails(details);\n\n return instrument(name, details, function instrumentRenderToBuffer() {\n return this._renderToBuffer(parentBuffer, bufferOperation);\n }, this);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n // If this is the top-most view, start a new buffer. Otherwise,\n // create a new buffer relative to the original using the\n // provided buffer operation (for example, `insertAfter` will\n // insert a new buffer after the \"parent buffer\").\n var tagName = this.tagName;\n\n if (tagName === null || tagName === undefined) {\n tagName = 'div';\n }\n\n var buffer = this.buffer = parentBuffer && parentBuffer.begin(tagName) || RenderBuffer(tagName);\n this.transitionTo('inBuffer', false);\n\n this.beforeRender(buffer);\n this.render(buffer);\n this.afterRender(buffer);\n\n return buffer;\n },\n\n /**\n Override the default event firing from `Ember.Evented` to\n also call methods with the given name.\n\n @method trigger\n @param name {String}\n @private\n */\n trigger: function(name) {\n this._super.apply(this, arguments);\n var method = this[name];\n if (method) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n return method.apply(this, args);\n }\n },\n\n deprecatedSendHandles: function(actionName) {\n return !!this[actionName];\n },\n\n deprecatedSend: function(actionName) {\n var args = [].slice.call(arguments, 1);\n Ember.assert('' + this + \" has the action \" + actionName + \" but it is not a function\", typeof this[actionName] === 'function');\n Ember.deprecate('Action handlers implemented directly on views are deprecated in favor of action handlers on an `actions` object ( action: `' + actionName + '` on ' + this + ')', false);\n this[actionName].apply(this, args);\n return;\n },\n\n has: function(name) {\n return typeOf(this[name]) === 'function' || this._super(name);\n },\n\n destroy: function() {\n var parent = this._parentView;\n\n if (!this._super()) { return; }\n\n // destroy the element -- this will avoid each child view destroying\n // the element over and over again...\n if (!this.removedFromDOM) { this.destroyElement(); }\n\n // remove from parent if found. Don't call removeFromParent,\n // as removeFromParent will try to remove the element from\n // the DOM again.\n if (parent) { parent.removeChild(this); }\n\n this.transitionTo('destroying', false);\n\n return this;\n },\n\n clearRenderedChildren: Ember.K,\n triggerRecursively: Ember.K,\n invokeRecursively: Ember.K,\n transitionTo: Ember.K,\n destroyElement: Ember.K\n });\n\n var ViewCollection = function(initialViews) {\n var views = this.views = initialViews || [];\n this.length = views.length;\n };\n\n ViewCollection.prototype = {\n length: 0,\n\n trigger: function(eventName) {\n var views = this.views, view;\n for (var i = 0, l = views.length; i < l; i++) {\n view = views[i];\n if (view.trigger) { view.trigger(eventName); }\n }\n },\n\n triggerRecursively: function(eventName) {\n var views = this.views;\n for (var i = 0, l = views.length; i < l; i++) {\n views[i].triggerRecursively(eventName);\n }\n },\n\n invokeRecursively: function(fn) {\n var views = this.views, view;\n\n for (var i = 0, l = views.length; i < l; i++) {\n view = views[i];\n fn(view);\n }\n },\n\n transitionTo: function(state, children) {\n var views = this.views;\n for (var i = 0, l = views.length; i < l; i++) {\n views[i].transitionTo(state, children);\n }\n },\n\n push: function() {\n this.length += arguments.length;\n var views = this.views;\n return views.push.apply(views, arguments);\n },\n\n objectAt: function(idx) {\n return this.views[idx];\n },\n\n forEach: function(callback) {\n var views = this.views;\n return a_forEach(views, callback);\n },\n\n clear: function() {\n this.length = 0;\n this.views.length = 0;\n }\n };\n\n var EMPTY_ARRAY = [];\n\n /**\n `Ember.View` is the class in Ember responsible for encapsulating templates of\n HTML content, combining templates with data to render as sections of a page's\n DOM, and registering and responding to user-initiated events.\n\n ## HTML Tag\n\n The default HTML tag name used for a view's DOM representation is `div`. This\n can be customized by setting the `tagName` property. The following view\n class:\n\n ```javascript\n ParagraphView = Ember.View.extend({\n tagName: 'em'\n });\n ```\n\n Would result in instances with the following HTML:\n\n ```html\n <em id=\"ember1\" class=\"ember-view\"></em>\n ```\n\n ## HTML `class` Attribute\n\n The HTML `class` attribute of a view's tag can be set by providing a\n `classNames` property that is set to an array of strings:\n\n ```javascript\n MyView = Ember.View.extend({\n classNames: ['my-class', 'my-other-class']\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view my-class my-other-class\"></div>\n ```\n\n `class` attribute values can also be set by providing a `classNameBindings`\n property set to an array of properties names for the view. The return value\n of these properties will be added as part of the value for the view's `class`\n attribute. These properties can be computed properties:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['propertyA', 'propertyB'],\n propertyA: 'from-a',\n propertyB: function() {\n if (someLogic) { return 'from-b'; }\n }.property()\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view from-a from-b\"></div>\n ```\n\n If the value of a class name binding returns a boolean the property name\n itself will be used as the class name if the property is true. The class name\n will not be added if the value is `false` or `undefined`.\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['hovered'],\n hovered: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view hovered\"></div>\n ```\n\n When using boolean class name bindings you can supply a string value other\n than the property name for use as the `class` HTML attribute by appending the\n preferred value after a \":\" character when defining the binding:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['awesome:so-very-cool'],\n awesome: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view so-very-cool\"></div>\n ```\n\n Boolean value class name bindings whose property names are in a\n camelCase-style format will be converted to a dasherized format:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['isUrgent'],\n isUrgent: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view is-urgent\"></div>\n ```\n\n Class name bindings can also refer to object values that are found by\n traversing a path relative to the view itself:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['messages.empty']\n messages: Ember.Object.create({\n empty: true\n })\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view empty\"></div>\n ```\n\n If you want to add a class name for a property which evaluates to true and\n and a different class name if it evaluates to false, you can pass a binding\n like this:\n\n ```javascript\n // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false\n Ember.View.extend({\n classNameBindings: ['isEnabled:enabled:disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view enabled\"></div>\n ```\n\n When isEnabled is `false`, the resulting HTML reprensentation looks like\n this:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n This syntax offers the convenience to add a class if a property is `false`:\n\n ```javascript\n // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\n Ember.View.extend({\n classNameBindings: ['isEnabled::disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\"></div>\n ```\n\n When the `isEnabled` property on the view is set to `false`, it will result\n in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n Updates to the the value of a class name binding will result in automatic\n update of the HTML `class` attribute in the view's rendered HTML\n representation. If the value becomes `false` or `undefined` the class name\n will be removed.\n\n Both `classNames` and `classNameBindings` are concatenated properties. See\n [Ember.Object](/api/classes/Ember.Object.html) documentation for more\n information about concatenated properties.\n\n ## HTML Attributes\n\n The HTML attribute section of a view's tag can be set by providing an\n `attributeBindings` property set to an array of property names on the view.\n The return value of these properties will be used as the value of the view's\n HTML associated attribute:\n\n ```javascript\n AnchorView = Ember.View.extend({\n tagName: 'a',\n attributeBindings: ['href'],\n href: 'http://google.com'\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n ```\n \n One property can be mapped on to another by placing a \":\" between \n the source property and the destination property:\n \n ```javascript\n AnchorView = Ember.View.extend({\n tagName: 'a',\n attributeBindings: ['url:href'],\n url: 'http://google.com'\n });\n ```\n \n Will result in view instances with an HTML representation of:\n\n ```html\n <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n ```\n \n If the return value of an `attributeBindings` monitored property is a boolean\n the property will follow HTML's pattern of repeating the attribute's name as\n its value:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <input id=\"ember1\" class=\"ember-view\" disabled=\"disabled\" />\n ```\n\n `attributeBindings` can refer to computed properties:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: function() {\n if (someLogic) {\n return true;\n } else {\n return false;\n }\n }.property()\n });\n ```\n\n Updates to the the property of an attribute binding will result in automatic\n update of the HTML attribute in the view's rendered HTML representation.\n\n `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html)\n documentation for more information about concatenated properties.\n\n ## Templates\n\n The HTML contents of a view's rendered representation are determined by its\n template. Templates can be any function that accepts an optional context\n parameter and returns a string of HTML that will be inserted within the\n view's tag. Most typically in Ember this function will be a compiled\n `Ember.Handlebars` template.\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('I am the template')\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I am the template</div>\n ```\n\n Within an Ember application is more common to define a Handlebars templates as\n part of a page:\n\n ```html\n <script type='text/x-handlebars' data-template-name='some-template'>\n Hello\n </script>\n ```\n\n And associate it by name using a view's `templateName` property:\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'some-template'\n });\n ```\n\n If you have nested resources, your Handlebars template will look like this:\n\n ```html\n <script type='text/x-handlebars' data-template-name='posts/new'>\n <h1>New Post</h1>\n </script>\n ```\n\n And `templateName` property:\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'posts/new'\n });\n ```\n\n Using a value for `templateName` that does not have a Handlebars template\n with a matching `data-template-name` attribute will throw an error.\n\n For views classes that may have a template later defined (e.g. as the block\n portion of a `{{view}}` Handlebars helper call in another template or in\n a subclass), you can provide a `defaultTemplate` property set to compiled\n template function. If a template is not later provided for the view instance\n the `defaultTemplate` value will be used:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default'),\n template: null,\n templateName: null\n });\n ```\n\n Will result in instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the default</div>\n ```\n\n If a `template` or `templateName` is provided it will take precedence over\n `defaultTemplate`:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default')\n });\n\n aView = AView.create({\n template: Ember.Handlebars.compile('I was the template, not default')\n });\n ```\n\n Will result in the following HTML representation when rendered:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the template, not default</div>\n ```\n\n ## View Context\n\n The default context of the compiled template is the view's controller:\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('Hello {{excitedGreeting}}')\n });\n\n aController = Ember.Object.create({\n firstName: 'Barry',\n excitedGreeting: function() {\n return this.get(\"content.firstName\") + \"!!!\"\n }.property()\n });\n\n aView = AView.create({\n controller: aController,\n });\n ```\n\n Will result in an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">Hello Barry!!!</div>\n ```\n\n A context can also be explicitly supplied through the view's `context`\n property. If the view has neither `context` nor `controller` properties, the\n `parentView`'s context will be used.\n\n ## Layouts\n\n Views can have a secondary template that wraps their main template. Like\n primary templates, layouts can be any function that accepts an optional\n context parameter and returns a string of HTML that will be inserted inside\n view's tag. Views whose HTML element is self closing (e.g. `<input />`)\n cannot have a layout and this property will be ignored.\n\n Most typically in Ember a layout will be a compiled `Ember.Handlebars`\n template.\n\n A view's layout can be set directly with the `layout` property or reference\n an existing Handlebars template by name with the `layoutName` property.\n\n A template used as a layout must contain a single use of the Handlebars\n `{{yield}}` helper. The HTML contents of a view's rendered `template` will be\n inserted at this location:\n\n ```javascript\n AViewWithLayout = Ember.View.extend({\n layout: Ember.Handlebars.compile(\"<div class='my-decorative-class'>{{yield}}</div>\")\n template: Ember.Handlebars.compile(\"I got wrapped\"),\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div class=\"my-decorative-class\">\n I got wrapped\n </div>\n </div>\n ```\n\n See [Ember.Handlebars.helpers.yield](/api/classes/Ember.Handlebars.helpers.html#method_yield)\n for more information.\n\n ## Responding to Browser Events\n\n Views can respond to user-initiated events in one of three ways: method\n implementation, through an event manager, and through `{{action}}` helper use\n in their template or layout.\n\n ### Method Implementation\n\n Views can respond to user-initiated events by implementing a method that\n matches the event name. A `jQuery.Event` object will be passed as the\n argument to this method.\n\n ```javascript\n AView = Ember.View.extend({\n click: function(event) {\n // will be called when when an instance's\n // rendered element is clicked\n }\n });\n ```\n\n ### Event Managers\n\n Views can define an object as their `eventManager` property. This object can\n then implement methods that match the desired event names. Matching events\n that occur on the view's rendered HTML or the rendered HTML of any of its DOM\n descendants will trigger this method. A `jQuery.Event` object will be passed\n as the first argument to the method and an `Ember.View` object as the\n second. The `Ember.View` will be the view whose rendered HTML was interacted\n with. This may be the view with the `eventManager` property or one of its\n descendent views.\n\n ```javascript\n AView = Ember.View.extend({\n eventManager: Ember.Object.create({\n doubleClick: function(event, view) {\n // will be called when when an instance's\n // rendered element or any rendering\n // of this views's descendent\n // elements is clicked\n }\n })\n });\n ```\n\n An event defined for an event manager takes precedence over events of the\n same name handled through methods on the view.\n\n ```javascript\n AView = Ember.View.extend({\n mouseEnter: function(event) {\n // will never trigger.\n },\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // takes precedence over AView#mouseEnter\n }\n })\n });\n ```\n\n Similarly a view's event manager will take precedence for events of any views\n rendered as a descendent. A method name that matches an event name will not\n be called if the view instance was rendered inside the HTML representation of\n a view that has an `eventManager` property defined that handles events of the\n name. Events not handled by the event manager will still trigger method calls\n on the descendent.\n\n ```javascript\n OuterView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"outer {{#view InnerView}}inner{{/view}} outer\"),\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // view might be instance of either\n // OuterView or InnerView depending on\n // where on the page the user interaction occured\n }\n })\n });\n\n InnerView = Ember.View.extend({\n click: function(event) {\n // will be called if rendered inside\n // an OuterView because OuterView's\n // eventManager doesn't handle click events\n },\n mouseEnter: function(event) {\n // will never be called if rendered inside\n // an OuterView.\n }\n });\n ```\n\n ### Handlebars `{{action}}` Helper\n\n See [Handlebars.helpers.action](/api/classes/Ember.Handlebars.helpers.html#method_action).\n\n ### Event Names\n\n All of the event handling approaches described above respond to the same set\n of events. The names of the built-in events are listed below. (The hash of\n built-in events exists in `Ember.EventDispatcher`.) Additional, custom events\n can be registered by using `Ember.Application.customEvents`.\n\n Touch events:\n\n * `touchStart`\n * `touchMove`\n * `touchEnd`\n * `touchCancel`\n\n Keyboard events\n\n * `keyDown`\n * `keyUp`\n * `keyPress`\n\n Mouse events\n\n * `mouseDown`\n * `mouseUp`\n * `contextMenu`\n * `click`\n * `doubleClick`\n * `mouseMove`\n * `focusIn`\n * `focusOut`\n * `mouseEnter`\n * `mouseLeave`\n\n Form events:\n\n * `submit`\n * `change`\n * `focusIn`\n * `focusOut`\n * `input`\n\n HTML5 drag and drop events:\n\n * `dragStart`\n * `drag`\n * `dragEnter`\n * `dragLeave`\n * `dragOver`\n * `dragEnd`\n * `drop`\n\n ## Handlebars `{{view}}` Helper\n\n Other `Ember.View` instances can be included as part of a view's template by\n using the `{{view}}` Handlebars helper. See [Ember.Handlebars.helpers.view](/api/classes/Ember.Handlebars.helpers.html#method_view)\n for additional information.\n\n @class View\n @namespace Ember\n @extends Ember.CoreView\n */\n var View = CoreView.extend({\n\n concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'],\n\n /**\n @property isView\n @type Boolean\n @default true\n @static\n */\n isView: true,\n\n // ..........................................................\n // TEMPLATE SUPPORT\n //\n\n /**\n The name of the template to lookup if no template is provided.\n\n By default `Ember.View` will lookup a template with this name in\n `Ember.TEMPLATES` (a shared global object).\n\n @property templateName\n @type String\n @default null\n */\n templateName: null,\n\n /**\n The name of the layout to lookup if no layout is provided.\n\n By default `Ember.View` will lookup a template with this name in\n `Ember.TEMPLATES` (a shared global object).\n\n @property layoutName\n @type String\n @default null\n */\n layoutName: null,\n\n /**\n Used to identify this view during debugging\n\n @property instrumentDisplay\n @type String\n */\n instrumentDisplay: computed(function() {\n if (this.helperName) {\n return '{{' + this.helperName + '}}';\n }\n }),\n\n /**\n The template used to render the view. This should be a function that\n accepts an optional context parameter and returns a string of HTML that\n will be inserted into the DOM relative to its parent view.\n\n In general, you should set the `templateName` property instead of setting\n the template yourself.\n\n @property template\n @type Function\n */\n template: computed('templateName', function(key, value) {\n if (value !== undefined) { return value; }\n\n var templateName = get(this, 'templateName'),\n template = this.templateForName(templateName, 'template');\n\n Ember.assert(\"You specified the templateName \" + templateName + \" for \" + this + \", but it did not exist.\", !templateName || template);\n\n return template || get(this, 'defaultTemplate');\n }),\n\n /**\n The controller managing this view. If this property is set, it will be\n made available for use by the template.\n\n @property controller\n @type Object\n */\n controller: computed('_parentView', function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }),\n\n /**\n A view may contain a layout. A layout is a regular template but\n supersedes the `template` property during rendering. It is the\n responsibility of the layout template to retrieve the `template`\n property from the view (or alternatively, call `Handlebars.helpers.yield`,\n `{{yield}}`) to render it in the correct location.\n\n This is useful for a view that has a shared wrapper, but which delegates\n the rendering of the contents of the wrapper to the `template` property\n on a subclass.\n\n @property layout\n @type Function\n */\n layout: computed(function(key) {\n var layoutName = get(this, 'layoutName'),\n layout = this.templateForName(layoutName, 'layout');\n\n Ember.assert(\"You specified the layoutName \" + layoutName + \" for \" + this + \", but it did not exist.\", !layoutName || layout);\n\n return layout || get(this, 'defaultLayout');\n }).property('layoutName'),\n\n _yield: function(context, options) {\n var template = get(this, 'template');\n if (template) { template(context, options); }\n },\n\n templateForName: function(name, type) {\n if (!name) { return; }\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n // the defaultContainer is deprecated\n var container = this.container || (Container && Container.defaultContainer);\n return container && container.lookup('template:' + name);\n },\n\n /**\n The object from which templates should access properties.\n\n This object will be passed to the template function each time the render\n method is called, but it is up to the individual function to decide what\n to do with it.\n\n By default, this will be the view's controller.\n\n @property context\n @type Object\n */\n context: computed(function(key, value) {\n if (arguments.length === 2) {\n set(this, '_context', value);\n return value;\n } else {\n return get(this, '_context');\n }\n }).volatile(),\n\n /**\n Private copy of the view's template context. This can be set directly\n by Handlebars without triggering the observer that causes the view\n to be re-rendered.\n\n The context of a view is looked up as follows:\n\n 1. Supplied context (usually by Handlebars)\n 2. Specified controller\n 3. `parentView`'s context (for a child of a ContainerView)\n\n The code in Handlebars that overrides the `_context` property first\n checks to see whether the view has a specified controller. This is\n something of a hack and should be revisited.\n\n @property _context\n @private\n */\n _context: computed(function(key) {\n var parentView, controller;\n\n if (controller = get(this, 'controller')) {\n return controller;\n }\n\n parentView = this._parentView;\n if (parentView) {\n return get(parentView, '_context');\n }\n\n return null;\n }),\n\n /**\n If a value that affects template rendering changes, the view should be\n re-rendered to reflect the new value.\n\n @method _contextDidChange\n @private\n */\n _contextDidChange: observer('context', function() {\n this.rerender();\n }),\n\n /**\n If `false`, the view will appear hidden in DOM.\n\n @property isVisible\n @type Boolean\n @default null\n */\n isVisible: true,\n\n /**\n Array of child views. You should never edit this array directly.\n Instead, use `appendChild` and `removeFromParent`.\n\n @property childViews\n @type Array\n @default []\n @private\n */\n childViews: childViewsProperty,\n\n _childViews: EMPTY_ARRAY,\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews will change.\n _childViewsWillChange: beforeObserver('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { propertyWillChange(parentView, 'childViews'); }\n }\n }),\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews did change.\n _childViewsDidChange: observer('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { propertyDidChange(parentView, 'childViews'); }\n }\n }),\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class.\n\n @method nearestInstanceOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n @deprecated\n */\n nearestInstanceOf: function(klass) {\n Ember.deprecate(\"nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.\");\n var view = get(this, 'parentView');\n\n while (view) {\n if (view instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class or mixin.\n\n @method nearestOfType\n @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself),\n or an instance of Ember.Mixin.\n @return Ember.View\n */\n nearestOfType: function(klass) {\n var view = get(this, 'parentView'),\n isOfType = klass instanceof Mixin ?\n function(view) { return klass.detect(view); } :\n function(view) { return klass.detect(view.constructor); };\n\n while (view) {\n if (isOfType(view)) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that has a given property.\n\n @method nearestWithProperty\n @param {String} property A property name\n @return Ember.View\n */\n nearestWithProperty: function(property) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (property in view) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor whose parent is an instance of\n `klass`.\n\n @method nearestChildOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n */\n nearestChildOf: function(klass) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (get(view, 'parentView') instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n When the parent view changes, recursively invalidate `controller`\n\n @method _parentViewDidChange\n @private\n */\n _parentViewDidChange: observer('_parentView', function() {\n if (this.isDestroying) { return; }\n\n this.trigger('parentViewDidChange');\n\n if (get(this, 'parentView.controller') && !get(this, 'controller')) {\n this.notifyPropertyChange('controller');\n }\n }),\n\n _controllerDidChange: observer('controller', function() {\n if (this.isDestroying) { return; }\n\n this.rerender();\n\n this.forEachChildView(function(view) {\n view.propertyDidChange('controller');\n });\n }),\n\n cloneKeywords: function() {\n var templateData = get(this, 'templateData');\n\n var keywords = templateData ? copy(templateData.keywords) : {};\n set(keywords, 'view', get(this, 'concreteView'));\n set(keywords, '_view', this);\n set(keywords, 'controller', get(this, 'controller'));\n\n return keywords;\n },\n\n /**\n Called on your view when it should push strings of HTML into a\n `Ember.RenderBuffer`. Most users will want to override the `template`\n or `templateName` properties instead of this method.\n\n By default, `Ember.View` will look for a function in the `template`\n property and invoke it with the value of `context`. The value of\n `context` will be the view's controller unless you override it.\n\n @method render\n @param {Ember.RenderBuffer} buffer The render buffer\n */\n render: function(buffer) {\n // If this view has a layout, it is the responsibility of the\n // the layout to render the view's template. Otherwise, render the template\n // directly.\n var template = get(this, 'layout') || get(this, 'template');\n\n if (template) {\n var context = get(this, 'context');\n var keywords = this.cloneKeywords();\n var output;\n\n var data = {\n view: this,\n buffer: buffer,\n isRenderData: true,\n keywords: keywords,\n insideGroup: get(this, 'templateData.insideGroup')\n };\n\n // Invoke the template with the provided template context, which\n // is the view's controller by default. A hash of data is also passed that provides\n // the template with access to the view and render buffer.\n\n Ember.assert('template must be a function. Did you mean to call Ember.Handlebars.compile(\"...\") or specify templateName instead?', typeof template === 'function');\n // The template should write directly to the render buffer instead\n // of returning a string.\n output = template(context, { data: data });\n\n // If the template returned a string instead of writing to the buffer,\n // push the string onto the buffer.\n if (output !== undefined) { buffer.push(output); }\n }\n },\n\n /**\n Renders the view again. This will work regardless of whether the\n view is already in the DOM or not. If the view is in the DOM, the\n rendering process will be deferred to give bindings a chance\n to synchronize.\n\n If children were added during the rendering process using `appendChild`,\n `rerender` will remove them, because they will be added again\n if needed by the next `render`.\n\n In general, if the display of your view changes, you should modify\n the DOM element directly instead of manually calling `rerender`, which can\n be slow.\n\n @method rerender\n */\n rerender: function() {\n return this.currentState.rerender(this);\n },\n\n clearRenderedChildren: function() {\n var lengthBefore = this.lengthBeforeRender,\n lengthAfter = this.lengthAfterRender;\n\n // If there were child views created during the last call to render(),\n // remove them under the assumption that they will be re-created when\n // we re-render.\n\n // VIEW-TODO: Unit test this path.\n var childViews = this._childViews;\n for (var i=lengthAfter-1; i>=lengthBefore; i--) {\n if (childViews[i]) { childViews[i].destroy(); }\n }\n },\n\n /**\n Iterates over the view's `classNameBindings` array, inserts the value\n of the specified property into the `classNames` array, then creates an\n observer to update the view's element if the bound property ever changes\n in the future.\n\n @method _applyClassNameBindings\n @private\n */\n _applyClassNameBindings: function(classBindings) {\n var classNames = this.classNames,\n elem, newClass, dasherizedClass;\n\n // Loop through all of the configured bindings. These will be either\n // property names ('isUrgent') or property paths relative to the view\n // ('content.isUrgent')\n a_forEach(classBindings, function(binding) {\n\n Ember.assert(\"classNameBindings must not have spaces in them. Multiple class name bindings can be provided as elements of an array, e.g. ['foo', ':bar']\", binding.indexOf(' ') === -1);\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n // Extract just the property name from bindings like 'foo:bar'\n var parsedPath = View._parsePropertyPath(binding);\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n var observer = function() {\n // Get the current value of the property\n newClass = this._classStringForProperty(binding);\n elem = this.$();\n\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n // Also remove from classNames so that if the view gets rerendered,\n // the class doesn't get added back to the DOM.\n classNames.removeObject(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n };\n\n // Get the class name for the property at its current value\n dasherizedClass = this._classStringForProperty(binding);\n\n if (dasherizedClass) {\n // Ensure that it gets into the classNames array\n // so it is displayed when we render.\n a_addObject(classNames, dasherizedClass);\n\n // Save a reference to the class name so we can remove it\n // if the observer fires. Remember that this variable has\n // been closed over by the observer.\n oldClass = dasherizedClass;\n }\n\n this.registerObserver(this, parsedPath.path, observer);\n // Remove className so when the view is rerendered,\n // the className is added based on binding reevaluation\n this.one('willClearRender', function() {\n if (oldClass) {\n classNames.removeObject(oldClass);\n oldClass = null;\n }\n });\n\n }, this);\n },\n\n _unspecifiedAttributeBindings: null,\n\n /**\n Iterates through the view's attribute bindings, sets up observers for each,\n then applies the current value of the attributes to the passed render buffer.\n\n @method _applyAttributeBindings\n @param {Ember.RenderBuffer} buffer\n @private\n */\n _applyAttributeBindings: function(buffer, attributeBindings) {\n var attributeValue,\n unspecifiedAttributeBindings = this._unspecifiedAttributeBindings = this._unspecifiedAttributeBindings || {};\n\n a_forEach(attributeBindings, function(binding) {\n var split = binding.split(':'),\n property = split[0],\n attributeName = split[1] || property;\n\n if (property in this) {\n this._setupAttributeBindingObservation(property, attributeName);\n\n // Determine the current value and add it to the render buffer\n // if necessary.\n attributeValue = get(this, property);\n View.applyAttributeBindings(buffer, attributeName, attributeValue);\n } else {\n unspecifiedAttributeBindings[property] = attributeName;\n }\n }, this);\n\n // Lazily setup setUnknownProperty after attributeBindings are initially applied\n this.setUnknownProperty = this._setUnknownProperty;\n },\n\n _setupAttributeBindingObservation: function(property, attributeName) {\n var attributeValue, elem;\n\n // Create an observer to add/remove/change the attribute if the\n // JavaScript property changes.\n var observer = function() {\n elem = this.$();\n\n attributeValue = get(this, property);\n\n View.applyAttributeBindings(elem, attributeName, attributeValue);\n };\n\n this.registerObserver(this, property, observer);\n },\n\n /**\n We're using setUnknownProperty as a hook to setup attributeBinding observers for\n properties that aren't defined on a view at initialization time.\n\n Note: setUnknownProperty will only be called once for each property.\n\n @method setUnknownProperty\n @param key\n @param value\n @private\n */\n setUnknownProperty: null, // Gets defined after initialization by _applyAttributeBindings\n\n _setUnknownProperty: function(key, value) {\n var attributeName = this._unspecifiedAttributeBindings && this._unspecifiedAttributeBindings[key];\n if (attributeName) {\n this._setupAttributeBindingObservation(key, attributeName);\n }\n\n defineProperty(this, key);\n return set(this, key, value);\n },\n\n /**\n Given a property name, returns a dasherized version of that\n property name if the property evaluates to a non-falsy value.\n\n For example, if the view has property `isUrgent` that evaluates to true,\n passing `isUrgent` to this method will return `\"is-urgent\"`.\n\n @method _classStringForProperty\n @param property\n @private\n */\n _classStringForProperty: function(property) {\n var parsedPath = View._parsePropertyPath(property);\n var path = parsedPath.path;\n\n var val = get(this, path);\n if (val === undefined && isGlobalPath(path)) {\n val = get(Ember.lookup, path);\n }\n\n return View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n },\n\n // ..........................................................\n // ELEMENT SUPPORT\n //\n\n /**\n Returns the current DOM element for the view.\n\n @property element\n @type DOMElement\n */\n element: computed('_parentView', function(key, value) {\n if (value !== undefined) {\n return this.currentState.setElement(this, value);\n } else {\n return this.currentState.getElement(this);\n }\n }),\n\n /**\n Returns a jQuery object for this view's element. If you pass in a selector\n string, this method will return a jQuery object, using the current element\n as its buffer.\n\n For example, calling `view.$('li')` will return a jQuery object containing\n all of the `li` elements inside the DOM element of this view.\n\n @method $\n @param {String} [selector] a jQuery-compatible selector string\n @return {jQuery} the jQuery object for the DOM node\n */\n $: function(sel) {\n return this.currentState.$(this, sel);\n },\n\n mutateChildViews: function(callback) {\n var childViews = this._childViews,\n idx = childViews.length,\n view;\n\n while(--idx >= 0) {\n view = childViews[idx];\n callback(this, view, idx);\n }\n\n return this;\n },\n\n forEachChildView: function(callback) {\n var childViews = this._childViews;\n\n if (!childViews) { return this; }\n\n var len = childViews.length,\n view, idx;\n\n for (idx = 0; idx < len; idx++) {\n view = childViews[idx];\n callback(view);\n }\n\n return this;\n },\n\n /**\n Appends the view's element to the specified parent element.\n\n If the view does not have an HTML representation yet, `createElement()`\n will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing.\n\n This is not typically a function that you will need to call directly when\n building your application. You might consider using `Ember.ContainerView`\n instead. If you do need to use `appendTo`, be sure that the target element\n you are providing is associated with an `Ember.Application` and does not\n have an ancestor element that is associated with an Ember view.\n\n @method appendTo\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} receiver\n */\n appendTo: function(target) {\n // Schedule the DOM element to be created and appended to the given\n // element after bindings have synchronized.\n this._insertElementLater(function() {\n Ember.assert(\"You tried to append to (\" + target + \") but that isn't in the DOM\", jQuery(target).length > 0);\n Ember.assert(\"You cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.\", !jQuery(target).is('.ember-view') && !jQuery(target).parents().is('.ember-view'));\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n Replaces the content of the specified parent element with this view's\n element. If the view does not have an HTML representation yet,\n `createElement()` will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing\n\n @method replaceIn\n @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object\n @return {Ember.View} received\n */\n replaceIn: function(target) {\n Ember.assert(\"You tried to replace in (\" + target + \") but that isn't in the DOM\", jQuery(target).length > 0);\n Ember.assert(\"You cannot replace an existing Ember.View. Consider using Ember.ContainerView instead.\", !jQuery(target).is('.ember-view') && !jQuery(target).parents().is('.ember-view'));\n\n this._insertElementLater(function() {\n jQuery(target).empty();\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n Schedules a DOM operation to occur during the next render phase. This\n ensures that all bindings have finished synchronizing before the view is\n rendered.\n\n To use, pass a function that performs a DOM operation.\n\n Before your function is called, this view and all child views will receive\n the `willInsertElement` event. After your function is invoked, this view\n and all of its child views will receive the `didInsertElement` event.\n\n ```javascript\n view._insertElementLater(function() {\n this.createElement();\n this.$().appendTo('body');\n });\n ```\n\n @method _insertElementLater\n @param {Function} fn the function that inserts the element into the DOM\n @private\n */\n _insertElementLater: function(fn) {\n this._scheduledInsert = run.scheduleOnce('render', this, '_insertElement', fn);\n },\n\n _insertElement: function (fn) {\n this._scheduledInsert = null;\n this.currentState.insertElement(this, fn);\n },\n\n /**\n Appends the view's element to the document body. If the view does\n not have an HTML representation yet, `createElement()` will be called\n automatically.\n\n If your application uses the `rootElement` property, you must append\n the view within that element. Rendering views outside of the `rootElement`\n is not supported.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the document body until all bindings have\n finished synchronizing.\n\n @method append\n @return {Ember.View} receiver\n */\n append: function() {\n return this.appendTo(document.body);\n },\n\n /**\n Removes the view's element from the element to which it is attached.\n\n @method remove\n @return {Ember.View} receiver\n */\n remove: function() {\n // What we should really do here is wait until the end of the run loop\n // to determine if the element has been re-appended to a different\n // element.\n // In the interim, we will just re-render if that happens. It is more\n // important than elements get garbage collected.\n if (!this.removedFromDOM) { this.destroyElement(); }\n this.invokeRecursively(function(view) {\n if (view.clearRenderedChildren) { view.clearRenderedChildren(); }\n });\n },\n\n elementId: null,\n\n /**\n Attempts to discover the element in the parent element. The default\n implementation looks for an element with an ID of `elementId` (or the\n view's guid if `elementId` is null). You can override this method to\n provide your own form of lookup. For example, if you want to discover your\n element using a CSS class name instead of an ID.\n\n @method findElementInParentElement\n @param {DOMElement} parentElement The parent's DOM element\n @return {DOMElement} The discovered element\n */\n findElementInParentElement: function(parentElem) {\n var id = \"#\" + this.elementId;\n return jQuery(id)[0] || jQuery(id, parentElem)[0];\n },\n\n /**\n Creates a DOM representation of the view and all of its\n child views by recursively calling the `render()` method.\n\n After the element has been created, `didInsertElement` will\n be called on this view and all of its child views.\n\n @method createElement\n @return {Ember.View} receiver\n */\n createElement: function() {\n if (get(this, 'element')) { return this; }\n\n var buffer = this.renderToBuffer();\n set(this, 'element', buffer.element());\n\n return this;\n },\n\n /**\n Called when a view is going to insert an element into the DOM.\n\n @event willInsertElement\n */\n willInsertElement: Ember.K,\n\n /**\n Called when the element of the view has been inserted into the DOM\n or after the view was re-rendered. Override this function to do any\n set up that requires an element in the document body.\n\n @event didInsertElement\n */\n didInsertElement: Ember.K,\n\n /**\n Called when the view is about to rerender, but before anything has\n been torn down. This is a good opportunity to tear down any manual\n observers you have installed based on the DOM state\n\n @event willClearRender\n */\n willClearRender: Ember.K,\n\n /**\n Run this callback on the current view (unless includeSelf is false) and recursively on child views.\n\n @method invokeRecursively\n @param fn {Function}\n @param includeSelf {Boolean} Includes itself if true.\n @private\n */\n invokeRecursively: function(fn, includeSelf) {\n var childViews = (includeSelf === false) ? this._childViews : [this];\n var currentViews, view, currentChildViews;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n currentChildViews = view._childViews ? view._childViews.slice(0) : null;\n fn(view);\n if (currentChildViews) {\n childViews.push.apply(childViews, currentChildViews);\n }\n }\n }\n },\n\n triggerRecursively: function(eventName) {\n var childViews = [this], currentViews, view, currentChildViews;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n currentChildViews = view._childViews ? view._childViews.slice(0) : null;\n if (view.trigger) { view.trigger(eventName); }\n if (currentChildViews) {\n childViews.push.apply(childViews, currentChildViews);\n }\n\n }\n }\n },\n\n viewHierarchyCollection: function() {\n var currentView, viewCollection = new ViewCollection([this]);\n\n for (var i = 0; i < viewCollection.length; i++) {\n currentView = viewCollection.objectAt(i);\n if (currentView._childViews) {\n viewCollection.push.apply(viewCollection, currentView._childViews);\n }\n }\n\n return viewCollection;\n },\n\n /**\n Destroys any existing element along with the element for any child views\n as well. If the view does not currently have a element, then this method\n will do nothing.\n\n If you implement `willDestroyElement()` on your view, then this method will\n be invoked on your view before your element is destroyed to give you a\n chance to clean up any event handlers, etc.\n\n If you write a `willDestroyElement()` handler, you can assume that your\n `didInsertElement()` handler was called earlier for the same element.\n\n You should not call or override this method yourself, but you may\n want to implement the above callbacks.\n\n @method destroyElement\n @return {Ember.View} receiver\n */\n destroyElement: function() {\n return this.currentState.destroyElement(this);\n },\n\n /**\n Called when the element of the view is going to be destroyed. Override\n this function to do any teardown that requires an element, like removing\n event listeners.\n\n @event willDestroyElement\n */\n willDestroyElement: Ember.K,\n\n /**\n Triggers the `willDestroyElement` event (which invokes the\n `willDestroyElement()` method if it exists) on this view and all child\n views.\n\n Before triggering `willDestroyElement`, it first triggers the\n `willClearRender` event recursively.\n\n @method _notifyWillDestroyElement\n @private\n */\n _notifyWillDestroyElement: function() {\n var viewCollection = this.viewHierarchyCollection();\n viewCollection.trigger('willClearRender');\n viewCollection.trigger('willDestroyElement');\n return viewCollection;\n },\n\n /**\n If this view's element changes, we need to invalidate the caches of our\n child views so that we do not retain references to DOM elements that are\n no longer needed.\n\n @method _elementDidChange\n @private\n */\n _elementDidChange: observer('element', function() {\n this.forEachChildView(clearCachedElement);\n }),\n\n /**\n Called when the parentView property has changed.\n\n @event parentViewDidChange\n */\n parentViewDidChange: Ember.K,\n\n instrumentName: 'view',\n\n instrumentDetails: function(hash) {\n hash.template = get(this, 'templateName');\n this._super(hash);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n this.lengthBeforeRender = this._childViews.length;\n var buffer = this._super(parentBuffer, bufferOperation);\n this.lengthAfterRender = this._childViews.length;\n\n return buffer;\n },\n\n renderToBufferIfNeeded: function (buffer) {\n return this.currentState.renderToBufferIfNeeded(this, buffer);\n },\n\n beforeRender: function(buffer) {\n this.applyAttributesToBuffer(buffer);\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n },\n\n applyAttributesToBuffer: function(buffer) {\n // Creates observers for all registered class name and attribute bindings,\n // then adds them to the element.\n var classNameBindings = get(this, 'classNameBindings');\n if (classNameBindings.length) {\n this._applyClassNameBindings(classNameBindings);\n }\n\n // Pass the render buffer so the method can apply attributes directly.\n // This isn't needed for class name bindings because they use the\n // existing classNames infrastructure.\n var attributeBindings = get(this, 'attributeBindings');\n if (attributeBindings.length) {\n this._applyAttributeBindings(buffer, attributeBindings);\n }\n\n buffer.setClasses(this.classNames);\n buffer.id(this.elementId);\n\n var role = get(this, 'ariaRole');\n if (role) {\n buffer.attr('role', role);\n }\n\n if (get(this, 'isVisible') === false) {\n buffer.style('display', 'none');\n }\n },\n\n // ..........................................................\n // STANDARD RENDER PROPERTIES\n //\n\n /**\n Tag name for the view's outer element. The tag name is only used when an\n element is first created. If you change the `tagName` for an element, you\n must destroy and recreate the view element.\n\n By default, the render buffer will use a `<div>` tag for views.\n\n @property tagName\n @type String\n @default null\n */\n\n // We leave this null by default so we can tell the difference between\n // the default case and a user-specified tag.\n tagName: null,\n\n /**\n The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.\n\n The full list of valid WAI-ARIA roles is available at:\n [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization)\n\n @property ariaRole\n @type String\n @default null\n */\n ariaRole: null,\n\n /**\n Standard CSS class names to apply to the view's outer element. This\n property automatically inherits any class names defined by the view's\n superclasses as well.\n\n @property classNames\n @type Array\n @default ['ember-view']\n */\n classNames: ['ember-view'],\n\n /**\n A list of properties of the view to apply as class names. If the property\n is a string value, the value of that string will be applied as a class\n name.\n\n ```javascript\n // Applies the 'high' class to the view element\n Ember.View.extend({\n classNameBindings: ['priority']\n priority: 'high'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as a dasherized class name.\n\n ```javascript\n // Applies the 'is-urgent' class to the view element\n Ember.View.extend({\n classNameBindings: ['isUrgent']\n isUrgent: true\n });\n ```\n\n If you would prefer to use a custom value instead of the dasherized\n property name, you can pass a binding like this:\n\n ```javascript\n // Applies the 'urgent' class to the view element\n Ember.View.extend({\n classNameBindings: ['isUrgent:urgent']\n isUrgent: true\n });\n ```\n\n This list of properties is inherited from the view's superclasses as well.\n\n @property classNameBindings\n @type Array\n @default []\n */\n classNameBindings: EMPTY_ARRAY,\n\n /**\n A list of properties of the view to apply as attributes. If the property is\n a string value, the value of that string will be applied as the attribute.\n\n ```javascript\n // Applies the type attribute to the element\n // with the value \"button\", like <div type=\"button\">\n Ember.View.extend({\n attributeBindings: ['type'],\n type: 'button'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as an attribute.\n\n ```javascript\n // Renders something like <div enabled=\"enabled\">\n Ember.View.extend({\n attributeBindings: ['enabled'],\n enabled: true\n });\n ```\n\n @property attributeBindings\n */\n attributeBindings: EMPTY_ARRAY,\n\n // .......................................................\n // CORE DISPLAY METHODS\n //\n\n /**\n Setup a view, but do not finish waking it up.\n\n * configure `childViews`\n * register the view with the global views hash, which is used for event\n dispatch\n\n @method init\n @private\n */\n init: function() {\n this.elementId = this.elementId || guidFor(this);\n\n this._super();\n\n // setup child views. be sure to clone the child views array first\n this._childViews = this._childViews.slice();\n\n Ember.assert(\"Only arrays are allowed for 'classNameBindings'\", typeOf(this.classNameBindings) === 'array');\n this.classNameBindings = A(this.classNameBindings.slice());\n\n Ember.assert(\"Only arrays are allowed for 'classNames'\", typeOf(this.classNames) === 'array');\n this.classNames = A(this.classNames.slice());\n },\n\n appendChild: function(view, options) {\n return this.currentState.appendChild(this, view, options);\n },\n\n /**\n Removes the child view from the parent view.\n\n @method removeChild\n @param {Ember.View} view\n @return {Ember.View} receiver\n */\n removeChild: function(view) {\n // If we're destroying, the entire subtree will be\n // freed, and the DOM will be handled separately,\n // so no need to mess with childViews.\n if (this.isDestroying) { return; }\n\n // update parent node\n set(view, '_parentView', null);\n\n // remove view from childViews array.\n var childViews = this._childViews;\n\n a_removeObject(childViews, view);\n\n this.propertyDidChange('childViews'); // HUH?! what happened to will change?\n\n return this;\n },\n\n /**\n Removes all children from the `parentView`.\n\n @method removeAllChildren\n @return {Ember.View} receiver\n */\n removeAllChildren: function() {\n return this.mutateChildViews(function(parentView, view) {\n parentView.removeChild(view);\n });\n },\n\n destroyAllChildren: function() {\n return this.mutateChildViews(function(parentView, view) {\n view.destroy();\n });\n },\n\n /**\n Removes the view from its `parentView`, if one is found. Otherwise\n does nothing.\n\n @method removeFromParent\n @return {Ember.View} receiver\n */\n removeFromParent: function() {\n var parent = this._parentView;\n\n // Remove DOM element from parent\n this.remove();\n\n if (parent) { parent.removeChild(this); }\n return this;\n },\n\n /**\n You must call `destroy` on a view to destroy the view (and all of its\n child views). This will remove the view from any parent node, then make\n sure that the DOM element managed by the view can be released by the\n memory manager.\n\n @method destroy\n */\n destroy: function() {\n var childViews = this._childViews,\n // get parentView before calling super because it'll be destroyed\n nonVirtualParentView = get(this, 'parentView'),\n viewName = this.viewName,\n childLen, i;\n\n if (!this._super()) { return; }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].removedFromDOM = true;\n }\n\n // remove from non-virtual parent view if viewName was specified\n if (viewName && nonVirtualParentView) {\n nonVirtualParentView.set(viewName, null);\n }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].destroy();\n }\n\n return this;\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n @method createChildView\n @param {Class|String} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n if (!view) {\n throw new TypeError(\"createChildViews first argument must exist\");\n }\n\n if (view.isView && view._parentView === this && view.container === this.container) {\n return view;\n }\n\n attrs = attrs || {};\n attrs._parentView = this;\n\n if (CoreView.detect(view)) {\n attrs.templateData = attrs.templateData || get(this, 'templateData');\n\n attrs.container = this.container;\n view = view.create(attrs);\n\n // don't set the property on a virtual view, as they are invisible to\n // consumers of the view API\n if (view.viewName) {\n set(get(this, 'concreteView'), view.viewName, view);\n }\n } else if ('string' === typeof view) {\n var fullName = 'view:' + view;\n var ViewKlass = this.container.lookupFactory(fullName);\n\n Ember.assert(\"Could not find view: '\" + fullName + \"'\", !!ViewKlass);\n\n attrs.templateData = get(this, 'templateData');\n view = ViewKlass.create(attrs);\n } else {\n Ember.assert('You must pass instance or subclass of View', view.isView);\n attrs.container = this.container;\n\n if (!get(view, 'templateData')) {\n attrs.templateData = get(this, 'templateData');\n }\n\n setProperties(view, attrs);\n\n }\n\n return view;\n },\n\n becameVisible: Ember.K,\n becameHidden: Ember.K,\n\n /**\n When the view's `isVisible` property changes, toggle the visibility\n element of the actual DOM element.\n\n @method _isVisibleDidChange\n @private\n */\n _isVisibleDidChange: observer('isVisible', function() {\n if (this._isVisible === get(this, 'isVisible')) { return ; }\n run.scheduleOnce('render', this, this._toggleVisibility);\n }),\n\n _toggleVisibility: function() {\n var $el = this.$();\n if (!$el) { return; }\n\n var isVisible = get(this, 'isVisible');\n\n if (this._isVisible === isVisible) { return ; }\n\n $el.toggle(isVisible);\n\n this._isVisible = isVisible;\n\n if (this._isAncestorHidden()) { return; }\n\n if (isVisible) {\n this._notifyBecameVisible();\n } else {\n this._notifyBecameHidden();\n }\n },\n\n _notifyBecameVisible: function() {\n this.trigger('becameVisible');\n\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameVisible();\n }\n });\n },\n\n _notifyBecameHidden: function() {\n this.trigger('becameHidden');\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameHidden();\n }\n });\n },\n\n _isAncestorHidden: function() {\n var parent = get(this, 'parentView');\n\n while (parent) {\n if (get(parent, 'isVisible') === false) { return true; }\n\n parent = get(parent, 'parentView');\n }\n\n return false;\n },\n\n clearBuffer: function() {\n this.invokeRecursively(nullViewsBuffer);\n },\n\n transitionTo: function(state, children) {\n var priorState = this.currentState,\n currentState = this.currentState = this.states[state];\n this.state = state;\n\n if (priorState && priorState.exit) { priorState.exit(this); }\n if (currentState.enter) { currentState.enter(this); }\n if (state === 'inDOM') { meta(this).cache.element = undefined; }\n\n if (children !== false) {\n this.forEachChildView(function(view) {\n view.transitionTo(state);\n });\n }\n },\n\n // .......................................................\n // EVENT HANDLING\n //\n\n /**\n Handle events from `Ember.EventDispatcher`\n\n @method handleEvent\n @param eventName {String}\n @param evt {Event}\n @private\n */\n handleEvent: function(eventName, evt) {\n return this.currentState.handleEvent(this, eventName, evt);\n },\n\n registerObserver: function(root, path, target, observer) {\n if (!observer && 'function' === typeof target) {\n observer = target;\n target = null;\n }\n\n if (!root || typeof root !== 'object') {\n return;\n }\n\n var view = this,\n stateCheckedObserver = function() {\n view.currentState.invokeObserver(this, observer);\n },\n scheduledObserver = function() {\n run.scheduleOnce('render', this, stateCheckedObserver);\n };\n\n addObserver(root, path, target, scheduledObserver);\n\n this.one('willClearRender', function() {\n removeObserver(root, path, target, scheduledObserver);\n });\n }\n\n });\n\n /*\n Describe how the specified actions should behave in the various\n states that a view can exist in. Possible states:\n\n * preRender: when a view is first instantiated, and after its\n element was destroyed, it is in the preRender state\n * inBuffer: once a view has been rendered, but before it has\n been inserted into the DOM, it is in the inBuffer state\n * hasElement: the DOM representation of the view is created,\n and is ready to be inserted\n * inDOM: once a view has been inserted into the DOM it is in\n the inDOM state. A view spends the vast majority of its\n existence in this state.\n * destroyed: once a view has been destroyed (using the destroy\n method), it is in this state. No further actions can be invoked\n on a destroyed view.\n */\n\n // in the destroyed state, everything is illegal\n\n // before rendering has begun, all legal manipulations are noops.\n\n // inside the buffer, legal manipulations are done on the buffer\n\n // once the view has been inserted into the DOM, legal manipulations\n // are done on the DOM element.\n\n function notifyMutationListeners() {\n run.once(View, 'notifyMutationListeners');\n }\n\n var DOMManager = {\n prepend: function(view, html) {\n view.$().prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.$().after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.$().html(html);\n notifyMutationListeners();\n },\n\n replace: function(view) {\n var element = get(view, 'element');\n\n set(view, 'element', null);\n\n view._insertElementLater(function() {\n jQuery(element).replaceWith(get(view, 'element'));\n notifyMutationListeners();\n });\n },\n\n remove: function(view) {\n view.$().remove();\n notifyMutationListeners();\n },\n\n empty: function(view) {\n view.$().empty();\n notifyMutationListeners();\n }\n };\n\n View.reopen({\n domManager: DOMManager\n });\n\n View.reopenClass({\n\n /**\n Parse a path and return an object which holds the parsed properties.\n\n For example a path like \"content.isEnabled:enabled:disabled\" will return the\n following object:\n\n ```javascript\n {\n path: \"content.isEnabled\",\n className: \"enabled\",\n falsyClassName: \"disabled\",\n classNames: \":enabled:disabled\"\n }\n ```\n\n @method _parsePropertyPath\n @static\n @private\n */\n _parsePropertyPath: function(path) {\n var split = path.split(':'),\n propertyPath = split[0],\n classNames = \"\",\n className,\n falsyClassName;\n\n // check if the property is defined as prop:class or prop:trueClass:falseClass\n if (split.length > 1) {\n className = split[1];\n if (split.length === 3) { falsyClassName = split[2]; }\n\n classNames = ':' + className;\n if (falsyClassName) { classNames += \":\" + falsyClassName; }\n }\n\n return {\n path: propertyPath,\n classNames: classNames,\n className: (className === '') ? undefined : className,\n falsyClassName: falsyClassName\n };\n },\n\n /**\n Get the class name for a given value, based on the path, optional\n `className` and optional `falsyClassName`.\n\n - if a `className` or `falsyClassName` has been specified:\n - if the value is truthy and `className` has been specified,\n `className` is returned\n - if the value is falsy and `falsyClassName` has been specified,\n `falsyClassName` is returned\n - otherwise `null` is returned\n - if the value is `true`, the dasherized last part of the supplied path\n is returned\n - if the value is not `false`, `undefined` or `null`, the `value`\n is returned\n - if none of the above rules apply, `null` is returned\n\n @method _classStringForValue\n @param path\n @param val\n @param className\n @param falsyClassName\n @static\n @private\n */\n _classStringForValue: function(path, val, className, falsyClassName) {\n if(isArray(val)) {\n val = get(val, 'length') !== 0; \n }\n \n // When using the colon syntax, evaluate the truthiness or falsiness\n // of the value to determine which className to return\n if (className || falsyClassName) {\n if (className && !!val) {\n return className;\n\n } else if (falsyClassName && !val) {\n return falsyClassName;\n\n } else {\n return null;\n }\n\n // If value is a Boolean and true, return the dasherized property\n // name.\n } else if (val === true) {\n // Normalize property path to be suitable for use\n // as a class name. For exaple, content.foo.barBaz\n // becomes bar-baz.\n var parts = path.split('.');\n return dasherize(parts[parts.length-1]);\n\n // If the value is not false, undefined, or null, return the current\n // value of the property.\n } else if (val !== false && val != null) {\n return val;\n\n // Nothing to display. Return null so that the old class is removed\n // but no new class is added.\n } else {\n return null;\n }\n }\n });\n\n var mutation = EmberObject.extend(Evented).create();\n\n View.addMutationListener = function(callback) {\n mutation.on('change', callback);\n };\n\n View.removeMutationListener = function(callback) {\n mutation.off('change', callback);\n };\n\n View.notifyMutationListeners = function() {\n mutation.trigger('change');\n };\n\n /**\n Global views hash\n\n @property views\n @static\n @type Hash\n */\n View.views = {};\n\n // If someone overrides the child views computed property when\n // defining their class, we want to be able to process the user's\n // supplied childViews and then restore the original computed property\n // at view initialization time. This happens in Ember.ContainerView's init\n // method.\n View.childViewsProperty = childViewsProperty;\n\n View.applyAttributeBindings = function(elem, name, value) {\n var type = typeOf(value);\n\n // if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js\n if (name !== 'value' && (type === 'string' || (type === 'number' && !isNaN(value)))) {\n if (value !== elem.attr(name)) {\n elem.attr(name, value);\n }\n } else if (name === 'value' || type === 'boolean') {\n if (isNone(value) || value === false) {\n // `null`, `undefined` or `false` should remove attribute\n elem.removeAttr(name);\n elem.prop(name, '');\n } else if (value !== elem.prop(name)) {\n // value should always be properties\n elem.prop(name, value);\n }\n } else if (!value) {\n elem.removeAttr(name);\n }\n };\n\n __exports__.CoreView = CoreView;\n __exports__.View = View;\n __exports__.ViewCollection = ViewCollection;\n });\n})();\n//@ sourceURL=ember-views");minispade.register('ember', "(function() {// ensure that minispade loads the following modules first\nminispade.require('ember-metal');\nminispade.require('ember-runtime');\nminispade.require('ember-handlebars-compiler');\nminispade.require('ember-handlebars');\nminispade.require('ember-views');\nminispade.require('ember-routing');\nminispade.require('ember-application');\nminispade.require('ember-extension-support');\n\n\n// ensure that the global exports have occurred for above\n// required packages\nrequireModule('ember-metal');\nrequireModule('ember-runtime');\nrequireModule('ember-handlebars');\nrequireModule('ember-views');\nrequireModule('ember-routing');\nrequireModule('ember-application');\nrequireModule('ember-extension-support');\n\n// do this to ensure that Ember.Test is defined properly on the global\n// if it is present.\nif (Ember.__loader.registry['ember-testing']) {\n requireModule('ember-testing');\n}\n\n/**\nEmber\n\n@module ember\n*/\n\nfunction throwWithMessage(msg) {\n return function() {\n throw new Ember.Error(msg);\n };\n}\n\nfunction generateRemovedClass(className) {\n var msg = \" has been moved into a plugin: https://github.com/emberjs/ember-states\";\n\n return {\n extend: throwWithMessage(className + msg),\n create: throwWithMessage(className + msg)\n };\n}\n\nEmber.StateManager = generateRemovedClass(\"Ember.StateManager\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n\n @class StateManager\n @namespace Ember\n*/\n\nEmber.State = generateRemovedClass(\"Ember.State\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n\n @class State\n @namespace Ember\n*/\n\n})();\n//@ sourceURL=ember");minispade.register('loader', "(function() {var define, requireModule, require, requirejs, Ember;\n\n(function() {\n Ember = this.Ember = this.Ember || {};\n if (typeof Ember === 'undefined') { Ember = {} };\n\n if (typeof Ember.__loader === 'undefined') {\n var registry = {}, seen = {};\n\n define = function(name, deps, callback) {\n registry[name] = { deps: deps, callback: callback };\n };\n\n requirejs = require = requireModule = function(name) {\n if (seen.hasOwnProperty(name)) { return seen[name]; }\n seen[name] = {};\n\n if (!registry[name]) {\n throw new Error(\"Could not find module \" + name);\n }\n\n var mod = registry[name],\n deps = mod.deps,\n callback = mod.callback,\n reified = [],\n exports;\n\n for (var i=0, l=deps.length; i<l; i++) {\n if (deps[i] === 'exports') {\n reified.push(exports = {});\n } else {\n reified.push(requireModule(resolve(deps[i])));\n }\n }\n\n var value = callback.apply(this, reified);\n return seen[name] = exports || value;\n\n function resolve(child) {\n if (child.charAt(0) !== '.') { return child; }\n var parts = child.split(\"/\");\n var parentBase = name.split(\"/\").slice(0, -1);\n\n for (var i=0, l=parts.length; i<l; i++) {\n var part = parts[i];\n\n if (part === '..') { parentBase.pop(); }\n else if (part === '.') { continue; }\n else { parentBase.push(part); }\n }\n\n return parentBase.join(\"/\");\n }\n };\n requirejs._eak_seen = registry;\n\n Ember.__loader = {define: define, require: require, registry: registry};\n } else {\n define = Ember.__loader.define;\n requirejs = require = requireModule = Ember.__loader.require;\n }\n})();\n\n})();\n//@ sourceURL=loader");minispade.register('metamorph', "(function() {define(\"metamorph\",\n [],\n function() {\n \"use strict\";\n // ==========================================================================\n // Project: metamorph\n // Copyright: ©2014 Tilde, Inc. All rights reserved.\n // ==========================================================================\n\n var K = function() {},\n guid = 0,\n disableRange = (function(){\n if ('undefined' !== typeof MetamorphENV) {\n return MetamorphENV.DISABLE_RANGE_API;\n } else if ('undefined' !== ENV) {\n return ENV.DISABLE_RANGE_API;\n } else {\n return false;\n }\n })(),\n\n // Feature-detect the W3C range API, the extended check is for IE9 which only partially supports ranges\n supportsRange = (!disableRange) && typeof document !== 'undefined' && ('createRange' in document) && (typeof Range !== 'undefined') && Range.prototype.createContextualFragment,\n\n // Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n // is a \"zero-scope\" element. This problem can be worked around by making\n // the first node an invisible text node. We, like Modernizr, use ­\n needsShy = typeof document !== 'undefined' && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n })(),\n\n\n // IE 8 (and likely earlier) likes to move whitespace preceeding\n // a script tag to appear after it. This means that we can\n // accidentally remove whitespace when updating a morph.\n movesWhitespace = document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n })();\n\n // Constructor that supports either Metamorph('foo') or new\n // Metamorph('foo');\n //\n // Takes a string of HTML as the argument.\n\n var Metamorph = function(html) {\n var self;\n\n if (this instanceof Metamorph) {\n self = this;\n } else {\n self = new K();\n }\n\n self.innerHTML = html;\n var myGuid = 'metamorph-'+(guid++);\n self.start = myGuid + '-start';\n self.end = myGuid + '-end';\n\n return self;\n };\n\n K.prototype = Metamorph.prototype;\n\n var rangeFor, htmlFunc, removeFunc, outerHTMLFunc, appendToFunc, afterFunc, prependFunc, startTagFunc, endTagFunc;\n\n outerHTMLFunc = function() {\n return this.startTag() + this.innerHTML + this.endTag();\n };\n\n startTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.start + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n endTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.end + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n // If we have the W3C range API, this process is relatively straight forward.\n if (supportsRange) {\n\n // Get a range for the current morph. Optionally include the starting and\n // ending placeholders.\n rangeFor = function(morph, outerToo) {\n var range = document.createRange();\n var before = document.getElementById(morph.start);\n var after = document.getElementById(morph.end);\n\n if (outerToo) {\n range.setStartBefore(before);\n range.setEndAfter(after);\n } else {\n range.setStartAfter(before);\n range.setEndBefore(after);\n }\n\n return range;\n };\n\n htmlFunc = function(html, outerToo) {\n // get a range for the current metamorph object\n var range = rangeFor(this, outerToo);\n\n // delete the contents of the range, which will be the\n // nodes between the starting and ending placeholder.\n range.deleteContents();\n\n // create a new document fragment for the HTML\n var fragment = range.createContextualFragment(html);\n\n // insert the fragment into the range\n range.insertNode(fragment);\n };\n\n /**\n * @public\n *\n * Remove this object (including starting and ending\n * placeholders).\n *\n * @method remove\n */\n removeFunc = function() {\n // get a range for the current metamorph object including\n // the starting and ending placeholders.\n var range = rangeFor(this, true);\n\n // delete the entire range.\n range.deleteContents();\n };\n\n appendToFunc = function(node) {\n var range = document.createRange();\n range.setStart(node);\n range.collapse(false);\n var frag = range.createContextualFragment(this.outerHTML());\n node.appendChild(frag);\n };\n\n afterFunc = function(html) {\n var range = document.createRange();\n var after = document.getElementById(this.end);\n\n range.setStartAfter(after);\n range.setEndAfter(after);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n prependFunc = function(html) {\n var range = document.createRange();\n var start = document.getElementById(this.start);\n\n range.setStartAfter(start);\n range.setEndAfter(start);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n } else {\n /*\n * This code is mostly taken from jQuery, with one exception. In jQuery's case, we\n * have some HTML and we need to figure out how to convert it into some nodes.\n *\n * In this case, jQuery needs to scan the HTML looking for an opening tag and use\n * that as the key for the wrap map. In our case, we know the parent node, and\n * can use its type as the key for the wrap map.\n **/\n var wrapMap = {\n select: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n fieldset: [ 1, \"<fieldset>\", \"</fieldset>\" ],\n table: [ 1, \"<table>\", \"</table>\" ],\n tbody: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n tr: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n colgroup: [ 2, \"<table><tbody></tbody><colgroup>\", \"</colgroup></table>\" ],\n map: [ 1, \"<map>\", \"</map>\" ],\n _default: [ 0, \"\", \"\" ]\n };\n\n var findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n };\n\n var setInnerHTML = function(element, html) {\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n };\n\n /*\n * Given a parent node and some HTML, generate a set of nodes. Return the first\n * node, which will allow us to traverse the rest using nextSibling.\n *\n * We need to do this because innerHTML in IE does not really parse the nodes.\n */\n var firstNodeFor = function(parentNode, html) {\n var arr = wrapMap[parentNode.tagName.toLowerCase()] || wrapMap._default;\n var depth = arr[0], start = arr[1], end = arr[2];\n\n if (needsShy) { html = '­'+html; }\n\n var element = document.createElement('div');\n\n setInnerHTML(element, start + html + end);\n\n for (var i=0; i<=depth; i++) {\n element = element.firstChild;\n }\n\n // Look for ­ to remove it.\n if (needsShy) {\n var shyElement = element;\n\n // Sometimes we get nameless elements with the shy inside\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n\n // At this point it's the actual unicode character.\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n\n return element;\n };\n\n /*\n * In some cases, Internet Explorer can create an anonymous node in\n * the hierarchy with no tagName. You can create this scenario via:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table>­<script></script><tr><td>hi</td></tr></table>\";\n * div.firstChild.firstChild.tagName //=> \"\"\n *\n * If our script markers are inside such a node, we need to find that\n * node and use *it* as the marker.\n */\n var realNode = function(start) {\n while (start.parentNode.tagName === \"\") {\n start = start.parentNode;\n }\n\n return start;\n };\n\n /*\n * When automatically adding a tbody, Internet Explorer inserts the\n * tbody immediately before the first <tr>. Other browsers create it\n * before the first node, no matter what.\n *\n * This means the the following code:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table><script id='first'></script><tr><td>hi</td></tr><script id='last'></script></table>\n *\n * Generates the following DOM in IE:\n *\n * + div\n * + table\n * - script id='first'\n * + tbody\n * + tr\n * + td\n * - \"hi\"\n * - script id='last'\n *\n * Which means that the two script tags, even though they were\n * inserted at the same point in the hierarchy in the original\n * HTML, now have different parents.\n *\n * This code reparents the first script tag by making it the tbody's\n * first child.\n *\n */\n var fixParentage = function(start, end) {\n if (start.parentNode !== end.parentNode) {\n end.parentNode.insertBefore(start, end.parentNode.firstChild);\n }\n };\n\n htmlFunc = function(html, outerToo) {\n // get the real starting node. see realNode for details.\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n var parentNode = end.parentNode;\n var node, nextSibling, last;\n\n // make sure that the start and end nodes share the same\n // parent. If not, fix it.\n fixParentage(start, end);\n\n // remove all of the nodes after the starting placeholder and\n // before the ending placeholder.\n node = start.nextSibling;\n while (node) {\n nextSibling = node.nextSibling;\n last = node === end;\n\n // if this is the last node, and we want to remove it as well,\n // set the `end` node to the next sibling. This is because\n // for the rest of the function, we insert the new nodes\n // before the end (note that insertBefore(node, null) is\n // the same as appendChild(node)).\n //\n // if we do not want to remove it, just break.\n if (last) {\n if (outerToo) { end = node.nextSibling; } else { break; }\n }\n\n node.parentNode.removeChild(node);\n\n // if this is the last node and we didn't break before\n // (because we wanted to remove the outer nodes), break\n // now.\n if (last) { break; }\n\n node = nextSibling;\n }\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(start.parentNode, html);\n\n if (outerToo) {\n start.parentNode.removeChild(start);\n }\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, end);\n node = nextSibling;\n }\n };\n\n // remove the nodes in the DOM representing this metamorph.\n //\n // this includes the starting and ending placeholders.\n removeFunc = function() {\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n\n this.html('');\n start.parentNode.removeChild(start);\n end.parentNode.removeChild(end);\n };\n\n appendToFunc = function(parentNode) {\n var node = firstNodeFor(parentNode, this.outerHTML());\n var nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.appendChild(node);\n node = nextSibling;\n }\n };\n\n afterFunc = function(html) {\n // get the real starting node. see realNode for details.\n var end = document.getElementById(this.end);\n var insertBefore = end.nextSibling;\n var parentNode = end.parentNode;\n var nextSibling;\n var node;\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n\n prependFunc = function(html) {\n var start = document.getElementById(this.start);\n var parentNode = start.parentNode;\n var nextSibling;\n var node;\n\n node = firstNodeFor(parentNode, html);\n var insertBefore = start.nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n }\n\n Metamorph.prototype.html = function(html) {\n this.checkRemoved();\n if (html === undefined) { return this.innerHTML; }\n\n htmlFunc.call(this, html);\n\n this.innerHTML = html;\n };\n\n Metamorph.prototype.replaceWith = function(html) {\n this.checkRemoved();\n htmlFunc.call(this, html, true);\n };\n\n Metamorph.prototype.remove = removeFunc;\n Metamorph.prototype.outerHTML = outerHTMLFunc;\n Metamorph.prototype.appendTo = appendToFunc;\n Metamorph.prototype.after = afterFunc;\n Metamorph.prototype.prepend = prependFunc;\n Metamorph.prototype.startTag = startTagFunc;\n Metamorph.prototype.endTag = endTagFunc;\n\n Metamorph.prototype.isRemoved = function() {\n var before = document.getElementById(this.start);\n var after = document.getElementById(this.end);\n\n return !before || !after;\n };\n\n Metamorph.prototype.checkRemoved = function() {\n if (this.isRemoved()) {\n throw new Error(\"Cannot perform operations on a Metamorph that is not in the DOM.\");\n }\n };\n\n return Metamorph;\n });\n\n})();\n//@ sourceURL=metamorph");minispade.register('rsvp', "(function() {/**\n @class RSVP\n @module RSVP\n */\ndefine(\"rsvp/all\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n This is a convenient alias for `RSVP.Promise.all`.\n\n @method all\n @for RSVP\n @param {Array} array Array of promises.\n @param {String} label An optional label. This is useful\n for tooling.\n @static\n */\n __exports__[\"default\"] = function all(array, label) {\n return Promise.all(array, label);\n };\n });\ndefine(\"rsvp/all_settled\",\n [\"./promise\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var isArray = __dependency2__.isArray;\n var isNonThenable = __dependency2__.isNonThenable;\n\n /**\n `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing\n a fail-fast method, it waits until all the promises have returned and\n shows you all the results. This is useful if you want to handle multiple\n promises' failure states together as a set.\n\n Returns a promise that is fulfilled when all the given promises have been\n settled. The return promise is fulfilled with an array of the states of\n the promises passed into the `promises` array argument.\n\n Each state object will either indicate fulfillment or rejection, and\n provide the corresponding value or reason. The states will take one of\n the following formats:\n\n ```javascript\n { state: 'fulfilled', value: value }\n or\n { state: 'rejected', reason: reason }\n ```\n\n Example:\n\n ```javascript\n var promise1 = RSVP.Promise.resolve(1);\n var promise2 = RSVP.Promise.reject(new Error('2'));\n var promise3 = RSVP.Promise.reject(new Error('3'));\n var promises = [ promise1, promise2, promise3 ];\n\n RSVP.allSettled(promises).then(function(array){\n // array == [\n // { state: 'fulfilled', value: 1 },\n // { state: 'rejected', reason: Error },\n // { state: 'rejected', reason: Error }\n // ]\n // Note that for the second item, reason.message will be \"2\", and for the\n // third item, reason.message will be \"3\".\n }, function(error) {\n // Not run. (This block would only be called if allSettled had failed,\n // for instance if passed an incorrect argument type.)\n });\n ```\n\n @method allSettled\n @for RSVP\n @param {Array} promises\n @param {String} label - optional string that describes the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled with an array of the settled\n states of the constituent promises.\n @static\n */\n\n __exports__[\"default\"] = function allSettled(entries, label) {\n return new Promise(function(resolve, reject) {\n if (!isArray(entries)) {\n throw new TypeError('You must pass an array to allSettled.');\n }\n\n var remaining = entries.length;\n var entry;\n\n if (remaining === 0) {\n resolve([]);\n return;\n }\n\n var results = new Array(remaining);\n\n function fulfilledResolver(index) {\n return function(value) {\n resolveAll(index, fulfilled(value));\n };\n }\n\n function rejectedResolver(index) {\n return function(reason) {\n resolveAll(index, rejected(reason));\n };\n }\n\n function resolveAll(index, value) {\n results[index] = value;\n if (--remaining === 0) {\n resolve(results);\n }\n }\n\n for (var index = 0; index < entries.length; index++) {\n entry = entries[index];\n\n if (isNonThenable(entry)) {\n resolveAll(index, fulfilled(entry));\n } else {\n Promise.cast(entry).then(fulfilledResolver(index), rejectedResolver(index));\n }\n }\n }, label);\n };\n\n function fulfilled(value) {\n return { state: 'fulfilled', value: value };\n }\n\n function rejected(reason) {\n return { state: 'rejected', reason: reason };\n }\n });\ndefine(\"rsvp/config\",\n [\"./events\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var EventTarget = __dependency1__[\"default\"];\n\n var config = {\n instrument: false\n };\n\n EventTarget.mixin(config);\n\n function configure(name, value) {\n if (name === 'onerror') {\n // handle for legacy users that expect the actual\n // error to be passed to their function added via\n // `RSVP.configure('onerror', someFunctionHere);`\n config.on('error', value);\n return;\n }\n\n if (arguments.length === 2) {\n config[name] = value;\n } else {\n return config[name];\n }\n }\n\n __exports__.config = config;\n __exports__.configure = configure;\n });\ndefine(\"rsvp/defer\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n `RSVP.defer` returns an object similar to jQuery's `$.Deferred`.\n `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s\n interface. New code should use the `RSVP.Promise` constructor instead.\n\n The object returned from `RSVP.defer` is a plain object with three properties:\n\n * promise - an `RSVP.Promise`.\n * reject - a function that causes the `promise` property on this object to\n become rejected\n * resolve - a function that causes the `promise` property on this object to\n become fulfilled.\n\n Example:\n\n ```javascript\n var deferred = RSVP.defer();\n\n deferred.resolve(\"Success!\");\n\n deferred.promise.then(function(value){\n // value here is \"Success!\"\n });\n ```\n\n @method defer\n @for RSVP\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Object}\n */\n\n __exports__[\"default\"] = function defer(label) {\n var deferred = { };\n\n deferred.promise = new Promise(function(resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n }, label);\n\n return deferred;\n };\n });\ndefine(\"rsvp/events\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var indexOf = function(callbacks, callback) {\n for (var i=0, l=callbacks.length; i<l; i++) {\n if (callbacks[i] === callback) { return i; }\n }\n\n return -1;\n };\n\n var callbacksFor = function(object) {\n var callbacks = object._promiseCallbacks;\n\n if (!callbacks) {\n callbacks = object._promiseCallbacks = {};\n }\n\n return callbacks;\n };\n\n /**\n @class RSVP.EventTarget\n */\n __exports__[\"default\"] = {\n\n /**\n `RSVP.EventTarget.mixin` extends an object with EventTarget methods. For\n Example:\n\n ```javascript\n var object = {};\n\n RSVP.EventTarget.mixin(object);\n\n object.on(\"finished\", function(event) {\n // handle event\n });\n\n object.trigger(\"finished\", { detail: value });\n ```\n\n `EventTarget.mixin` also works with prototypes:\n\n ```javascript\n var Person = function() {};\n RSVP.EventTarget.mixin(Person.prototype);\n\n var yehuda = new Person();\n var tom = new Person();\n\n yehuda.on(\"poke\", function(event) {\n console.log(\"Yehuda says OW\");\n });\n\n tom.on(\"poke\", function(event) {\n console.log(\"Tom says OW\");\n });\n\n yehuda.trigger(\"poke\");\n tom.trigger(\"poke\");\n ```\n\n @method mixin\n @param {Object} object object to extend with EventTarget methods\n @private\n */\n mixin: function(object) {\n object.on = this.on;\n object.off = this.off;\n object.trigger = this.trigger;\n object._promiseCallbacks = undefined;\n return object;\n },\n\n /**\n Registers a callback to be executed when `eventName` is triggered\n\n ```javascript\n object.on('event', function(eventInfo){\n // handle the event\n });\n\n object.trigger('event');\n ```\n\n @method on\n @param {String} eventName name of the event to listen for\n @param {Function} callback function to be called when the event is triggered.\n @private\n */\n on: function(eventName, callback) {\n var allCallbacks = callbacksFor(this), callbacks;\n\n callbacks = allCallbacks[eventName];\n\n if (!callbacks) {\n callbacks = allCallbacks[eventName] = [];\n }\n\n if (indexOf(callbacks, callback) === -1) {\n callbacks.push(callback);\n }\n },\n\n /**\n You can use `off` to stop firing a particular callback for an event:\n\n ```javascript\n function doStuff() { // do stuff! }\n object.on('stuff', doStuff);\n\n object.trigger('stuff'); // doStuff will be called\n\n // Unregister ONLY the doStuff callback\n object.off('stuff', doStuff);\n object.trigger('stuff'); // doStuff will NOT be called\n ```\n\n If you don't pass a `callback` argument to `off`, ALL callbacks for the\n event will not be executed when the event fires. For example:\n\n ```javascript\n var callback1 = function(){};\n var callback2 = function(){};\n\n object.on('stuff', callback1);\n object.on('stuff', callback2);\n\n object.trigger('stuff'); // callback1 and callback2 will be executed.\n\n object.off('stuff');\n object.trigger('stuff'); // callback1 and callback2 will not be executed!\n ```\n\n @method off\n @param {String} eventName event to stop listening to\n @param {Function} callback optional argument. If given, only the function\n given will be removed from the event's callback queue. If no `callback`\n argument is given, all callbacks will be removed from the event's callback\n queue.\n @private\n\n */\n off: function(eventName, callback) {\n var allCallbacks = callbacksFor(this), callbacks, index;\n\n if (!callback) {\n allCallbacks[eventName] = [];\n return;\n }\n\n callbacks = allCallbacks[eventName];\n\n index = indexOf(callbacks, callback);\n\n if (index !== -1) { callbacks.splice(index, 1); }\n },\n\n /**\n Use `trigger` to fire custom events. For example:\n\n ```javascript\n object.on('foo', function(){\n console.log('foo event happened!');\n });\n object.trigger('foo');\n // 'foo event happened!' logged to the console\n ```\n\n You can also pass a value as a second argument to `trigger` that will be\n passed as an argument to all event listeners for the event:\n\n ```javascript\n object.on('foo', function(value){\n console.log(value.name);\n });\n\n object.trigger('foo', { name: 'bar' });\n // 'bar' logged to the console\n ```\n\n @method trigger\n @param {String} eventName name of the event to be triggered\n @param {Any} options optional value to be passed to any event handlers for\n the given `eventName`\n @private\n */\n trigger: function(eventName, options) {\n var allCallbacks = callbacksFor(this),\n callbacks, callbackTuple, callback, binding;\n\n if (callbacks = allCallbacks[eventName]) {\n // Don't cache the callbacks.length since it may grow\n for (var i=0; i<callbacks.length; i++) {\n callback = callbacks[i];\n\n callback(options);\n }\n }\n }\n };\n });\ndefine(\"rsvp/filter\",\n [\"./all\",\"./map\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var all = __dependency1__[\"default\"];\n var map = __dependency2__[\"default\"];\n var isFunction = __dependency3__.isFunction;\n var isArray = __dependency3__.isArray;\n\n /**\n `RSVP.filter` is similar to JavaScript's native `filter` method, except that it\n waits for all promises to become fulfilled before running the `filterFn` on\n each item in given to `promises`. `RSVP.filter` returns a promise that will\n become fulfilled with the result of running `filterFn` on the values the\n promises become fulfilled with.\n\n For example:\n\n ```javascript\n\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.resolve(2);\n var promise3 = RSVP.resolve(3);\n\n var filterFn = function(item){\n return item > 1;\n };\n\n RSVP.filter(promises, filterFn).then(function(result){\n // result is [ 2, 3 ]\n });\n ```\n\n If any of the `promises` given to `RSVP.filter` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.reject(new Error(\"2\"));\n var promise3 = RSVP.reject(new Error(\"3\"));\n var promises = [ promise1, promise2, promise3 ];\n\n var filterFn = function(item){\n return item > 1;\n };\n\n RSVP.filter(promises, filterFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === \"2\"\n });\n ```\n\n `RSVP.filter` will also wait for any promises returned from `filterFn`.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:\n\n ```javascript\n\n var alice = { name: 'alice' };\n var bob = { name: 'bob' };\n var users = [ alice, bob ];\n\n var promises = users.map(function(user){\n return RSVP.resolve(user);\n });\n\n var filterFn = function(user){\n // Here, Alice has permissions to create a blog post, but Bob does not.\n return getPrivilegesForUser(user).then(function(privs){\n return privs.can_create_blog_post === true;\n });\n };\n RSVP.filter(promises, filterFn).then(function(users){\n // true, because the server told us only Alice can create a blog post.\n users.length === 1;\n // false, because Alice is the only user present in `users`\n users[0] === bob;\n });\n ```\n\n @method filter\n @for RSVP\n @param {Array} promises\n @param {Function} filterFn - function to be called on each resolved value to\n filter the final results.\n @param {String} label optional string describing the promise. Useful for\n tooling.\n @return {Promise}\n */\n function filter(promises, filterFn, label) {\n return all(promises, label).then(function(values){\n if (!isArray(promises)) {\n throw new TypeError('You must pass an array to filter.');\n }\n\n if (!isFunction(filterFn)){\n throw new TypeError(\"You must pass a function to filter's second argument.\");\n }\n\n return map(promises, filterFn, label).then(function(filterResults){\n var i,\n valuesLen = values.length,\n filtered = [];\n\n for (i = 0; i < valuesLen; i++){\n if(filterResults[i]) filtered.push(values[i]);\n }\n return filtered;\n });\n });\n }\n\n __exports__[\"default\"] = filter;\n });\ndefine(\"rsvp/hash\",\n [\"./promise\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var isNonThenable = __dependency2__.isNonThenable;\n var keysOf = __dependency2__.keysOf;\n\n /**\n `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array\n for its `promises` argument.\n\n Returns a promise that is fulfilled when all the given promises have been\n fulfilled, or rejected if any of them become rejected. The returned promise\n is fulfilled with a hash that has the same key names as the `promises` object\n argument. If any of the values in the object are not promises, they will\n simply be copied over to the fulfilled object.\n\n Example:\n\n ```javascript\n var promises = {\n myPromise: RSVP.resolve(1),\n yourPromise: RSVP.resolve(2),\n theirPromise: RSVP.resolve(3),\n notAPromise: 4\n };\n\n RSVP.hash(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: 1,\n // yourPromise: 2,\n // theirPromise: 3,\n // notAPromise: 4\n // }\n });\n ````\n\n If any of the `promises` given to `RSVP.hash` are rejected, the first promise\n that is rejected will be given as the reason to the rejection handler.\n\n Example:\n\n ```javascript\n var promises = {\n myPromise: RSVP.resolve(1),\n rejectedPromise: RSVP.reject(new Error(\"rejectedPromise\")),\n anotherRejectedPromise: RSVP.reject(new Error(\"anotherRejectedPromise\")),\n };\n\n RSVP.hash(promises).then(function(hash){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === \"rejectedPromise\"\n });\n ```\n\n An important note: `RSVP.hash` is intended for plain JavaScript objects that\n are just a set of keys and values. `RSVP.hash` will NOT preserve prototype\n chains.\n\n Example:\n\n ```javascript\n function MyConstructor(){\n this.example = RSVP.resolve(\"Example\");\n }\n\n MyConstructor.prototype = {\n protoProperty: RSVP.resolve(\"Proto Property\")\n };\n\n var myObject = new MyConstructor();\n\n RSVP.hash(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: \"Example\"\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n });\n ```\n\n @method hash\n @for RSVP\n @param {Object} promises\n @param {String} label optional string that describes the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all properties of `promises`\n have been fulfilled, or rejected if any of them become rejected.\n @static\n */\n __exports__[\"default\"] = function hash(object, label) {\n return new Promise(function(resolve, reject){\n var results = {};\n var keys = keysOf(object);\n var remaining = keys.length;\n var entry, property;\n\n if (remaining === 0) {\n resolve(results);\n return;\n }\n\n function fulfilledTo(property) {\n return function(value) {\n results[property] = value;\n if (--remaining === 0) {\n resolve(results);\n }\n };\n }\n\n function onRejection(reason) {\n remaining = 0;\n reject(reason);\n }\n\n for (var i = 0; i < keys.length; i++) {\n property = keys[i];\n entry = object[property];\n\n if (isNonThenable(entry)) {\n results[property] = entry;\n if (--remaining === 0) {\n resolve(results);\n }\n } else {\n Promise.cast(entry).then(fulfilledTo(property), onRejection);\n }\n }\n });\n };\n });\ndefine(\"rsvp/instrument\",\n [\"./config\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var config = __dependency1__.config;\n var now = __dependency2__.now;\n\n __exports__[\"default\"] = function instrument(eventName, promise, child) {\n // instrumentation should not disrupt normal usage.\n try {\n config.trigger(eventName, {\n guid: promise._guidKey + promise._id,\n eventName: eventName,\n detail: promise._detail,\n childGuid: child && promise._guidKey + child._id,\n label: promise._label,\n timeStamp: now(),\n stack: new Error(promise._label).stack\n });\n } catch(error) {\n setTimeout(function(){\n throw error;\n }, 0);\n }\n };\n });\ndefine(\"rsvp/map\",\n [\"./promise\",\"./all\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var all = __dependency2__[\"default\"];\n var isArray = __dependency3__.isArray;\n var isFunction = __dependency3__.isFunction;\n\n /**\n `RSVP.map` is similar to JavaScript's native `map` method, except that it\n waits for all promises to become fulfilled before running the `mapFn` on\n each item in given to `promises`. `RSVP.map` returns a promise that will\n become fulfilled with the result of running `mapFn` on the values the promises\n become fulfilled with.\n\n For example:\n\n ```javascript\n\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.resolve(2);\n var promise3 = RSVP.resolve(3);\n var promises = [ promise1, promise2, promise3 ];\n\n var mapFn = function(item){\n return item + 1;\n };\n\n RSVP.map(promises, mapFn).then(function(result){\n // result is [ 2, 3, 4 ]\n });\n ```\n\n If any of the `promises` given to `RSVP.map` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.reject(new Error(\"2\"));\n var promise3 = RSVP.reject(new Error(\"3\"));\n var promises = [ promise1, promise2, promise3 ];\n\n var mapFn = function(item){\n return item + 1;\n };\n\n RSVP.map(promises, mapFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === \"2\"\n });\n ```\n\n `RSVP.map` will also wait if a promise is returned from `mapFn`. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first becuase they contain a url to those comments.\n\n ```javscript\n\n var mapFn = function(blogPost){\n // getComments does some ajax and returns an RSVP.Promise that is fulfilled\n // with some comments data\n return getComments(blogPost.comments_url);\n };\n\n // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled\n // with some blog post data\n RSVP.map(getBlogPosts(), mapFn).then(function(comments){\n // comments is the result of asking the server for the comments\n // of all blog posts returned from getBlogPosts()\n });\n ```\n\n @method map\n @for RSVP\n @param {Array} promises\n @param {Function} mapFn function to be called on each fulfilled promise.\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.\n @static\n */\n __exports__[\"default\"] = function map(promises, mapFn, label) {\n return all(promises, label).then(function(results){\n if (!isArray(promises)) {\n throw new TypeError('You must pass an array to map.');\n }\n\n if (!isFunction(mapFn)){\n throw new TypeError(\"You must pass a function to map's second argument.\");\n }\n\n\n var resultLen = results.length,\n mappedResults = [],\n i;\n\n for (i = 0; i < resultLen; i++){\n mappedResults.push(mapFn(results[i]));\n }\n\n return all(mappedResults, label);\n });\n };\n });\ndefine(\"rsvp/node\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n var slice = Array.prototype.slice;\n\n function makeNodeCallbackFor(resolve, reject) {\n return function (error, value) {\n if (error) {\n reject(error);\n } else if (arguments.length > 2) {\n resolve(slice.call(arguments, 1));\n } else {\n resolve(value);\n }\n };\n }\n\n /**\n `RSVP.denodeify` takes a \"node-style\" function and returns a function that\n will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the\n browser when you'd prefer to use promises over using callbacks. For example,\n `denodeify` transforms the following:\n\n ```javascript\n var fs = require('fs');\n\n fs.readFile('myfile.txt', function(err, data){\n if (err) return handleError(err);\n handleData(data);\n });\n ```\n\n into:\n\n ```javascript\n var fs = require('fs');\n\n var readFile = RSVP.denodeify(fs.readFile);\n\n readFile('myfile.txt').then(handleData, handleError);\n ```\n\n Using `denodeify` makes it easier to compose asynchronous operations instead\n of using callbacks. For example, instead of:\n\n ```javascript\n var fs = require('fs');\n var log = require('some-async-logger');\n\n fs.readFile('myfile.txt', function(err, data){\n if (err) return handleError(err);\n fs.writeFile('myfile2.txt', data, function(err){\n if (err) throw err;\n log('success', function(err) {\n if (err) throw err;\n });\n });\n });\n ```\n\n You can chain the operations together using `then` from the returned promise:\n\n ```javascript\n var fs = require('fs');\n var denodeify = RSVP.denodeify;\n var readFile = denodeify(fs.readFile);\n var writeFile = denodeify(fs.writeFile);\n var log = denodeify(require('some-async-logger'));\n\n readFile('myfile.txt').then(function(data){\n return writeFile('myfile2.txt', data);\n }).then(function(){\n return log('SUCCESS');\n }).then(function(){\n // success handler\n }, function(reason){\n // rejection handler\n });\n ```\n\n @method denodeify\n @for RSVP\n @param {Function} nodeFunc a \"node-style\" function that takes a callback as\n its last argument. The callback expects an error to be passed as its first\n argument (if an error occurred, otherwise null), and the value from the\n operation as its second argument (\"function(err, value){ }\").\n @param {Any} binding optional argument for binding the \"this\" value when\n calling the `nodeFunc` function.\n @return {Function} a function that wraps `nodeFunc` to return an\n `RSVP.Promise`\n @static\n */\n __exports__[\"default\"] = function denodeify(nodeFunc, binding) {\n return function() {\n var nodeArgs = slice.call(arguments), resolve, reject;\n var thisArg = this || binding;\n\n return new Promise(function(resolve, reject) {\n Promise.all(nodeArgs).then(function(nodeArgs) {\n try {\n nodeArgs.push(makeNodeCallbackFor(resolve, reject));\n nodeFunc.apply(thisArg, nodeArgs);\n } catch(e) {\n reject(e);\n }\n });\n });\n };\n };\n });\ndefine(\"rsvp/promise\",\n [\"./config\",\"./events\",\"./instrument\",\"./utils\",\"./promise/cast\",\"./promise/all\",\"./promise/race\",\"./promise/resolve\",\"./promise/reject\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {\n \"use strict\";\n var config = __dependency1__.config;\n var EventTarget = __dependency2__[\"default\"];\n var instrument = __dependency3__[\"default\"];\n var objectOrFunction = __dependency4__.objectOrFunction;\n var isFunction = __dependency4__.isFunction;\n var now = __dependency4__.now;\n var cast = __dependency5__[\"default\"];\n var all = __dependency6__[\"default\"];\n var race = __dependency7__[\"default\"];\n var Resolve = __dependency8__[\"default\"];\n var Reject = __dependency9__[\"default\"];\n\n var guidKey = 'rsvp_' + now() + '-';\n var counter = 0;\n\n function noop() {}\n\n __exports__[\"default\"] = Promise;\n\n\n /**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise’s eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable. Similarly, a\n rejection reason is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n var promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n var xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error(\"getJSON: `\" + url + \"` failed with status: [\" + this.status + \"]\");\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class RSVP.Promise\n @param {function}\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @constructor\n */\n function Promise(resolver, label) {\n if (!isFunction(resolver)) {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n }\n\n if (!(this instanceof Promise)) {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n }\n\n this._id = counter++;\n this._label = label;\n this._subscribers = [];\n\n if (config.instrument) {\n instrument('created', this);\n }\n\n if (noop !== resolver) {\n invokeResolver(resolver, this);\n }\n }\n\n function invokeResolver(resolver, promise) {\n function resolvePromise(value) {\n resolve(promise, value);\n }\n\n function rejectPromise(reason) {\n reject(promise, reason);\n }\n\n try {\n resolver(resolvePromise, rejectPromise);\n } catch(e) {\n rejectPromise(e);\n }\n }\n\n Promise.cast = cast;\n Promise.all = all;\n Promise.race = race;\n Promise.resolve = Resolve;\n Promise.reject = Reject;\n\n var PENDING = void 0;\n var SEALED = 0;\n var FULFILLED = 1;\n var REJECTED = 2;\n\n function subscribe(parent, child, onFulfillment, onRejection) {\n var subscribers = parent._subscribers;\n var length = subscribers.length;\n\n subscribers[length] = child;\n subscribers[length + FULFILLED] = onFulfillment;\n subscribers[length + REJECTED] = onRejection;\n }\n\n function publish(promise, settled) {\n var child, callback, subscribers = promise._subscribers, detail = promise._detail;\n\n if (config.instrument) {\n instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise);\n }\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n invokeCallback(settled, child, callback, detail);\n }\n\n promise._subscribers = null;\n }\n\n Promise.prototype = {\n constructor: Promise,\n\n _id: undefined,\n _guidKey: guidKey,\n _label: undefined,\n\n _state: undefined,\n _detail: undefined,\n _subscribers: undefined,\n\n _onerror: function (reason) {\n config.trigger('error', reason);\n },\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n\n Chaining\n --------\n\n The return value of `then` is itself a promise. This second, \"downstream\"\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return \"default name\";\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `\"default name\"`\n });\n\n findUser().then(function (user) {\n throw new Error(\"Found user, but still unhappy\");\n }, function (reason) {\n throw new Error(\"`findUser` rejected and we're unhappy\");\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be \"Found user, but still unhappy\".\n // If `findUser` rejected, `reason` will be \"`findUser` rejected and we're unhappy\".\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException(\"Upstream error\");\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n\n Assimilation\n ------------\n\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n\n If the assimliated promise rejects, then the downstream promise will also reject.\n\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n\n Simple Example\n --------------\n\n Synchronous Example\n\n ```javascript\n var result;\n\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n\n Errback Example\n\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n\n Promise Example;\n\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n\n Advanced Example\n --------------\n\n Synchronous Example\n\n ```javascript\n var author, books;\n\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n\n Errback Example\n\n ```js\n\n function foundBooks(books) {\n\n }\n\n function failure(reason) {\n\n }\n\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n\n Promise Example;\n\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n then: function(onFulfillment, onRejection, label) {\n var promise = this;\n this._onerror = null;\n\n var thenPromise = new this.constructor(noop, label);\n\n if (this._state) {\n var callbacks = arguments;\n config.async(function invokePromiseCallback() {\n invokeCallback(promise._state, thenPromise, callbacks[promise._state - 1], promise._detail);\n });\n } else {\n subscribe(this, thenPromise, onFulfillment, onRejection);\n }\n\n if (config.instrument) {\n instrument('chained', promise, thenPromise);\n }\n\n return thenPromise;\n },\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n\n ```js\n function findAuthor(){\n throw new Error(\"couldn't find that author\");\n }\n\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n\n @method catch\n @param {Function} onRejection\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function(onRejection, label) {\n return this.then(null, onRejection, label);\n },\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n\n Synchronous example:\n\n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n\n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n\n Asynchronous example:\n\n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n\n @method finally\n @param {Function} callback\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n 'finally': function(callback, label) {\n var constructor = this.constructor;\n\n return this.then(function(value) {\n return constructor.cast(callback()).then(function(){\n return value;\n });\n }, function(reason) {\n return constructor.cast(callback()).then(function(){\n throw reason;\n });\n }, label);\n }\n };\n\n function invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value, error, succeeded, failed;\n\n if (hasCallback) {\n try {\n value = callback(detail);\n succeeded = true;\n } catch(e) {\n failed = true;\n error = e;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (handleThenable(promise, value)) {\n return;\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (failed) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n resolve(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n }\n\n function handleThenable(promise, value) {\n var then = null,\n resolved;\n\n try {\n if (promise === value) {\n throw new TypeError(\"A promises callback cannot return that same promise.\");\n }\n\n if (objectOrFunction(value)) {\n then = value.then;\n\n if (isFunction(then)) {\n then.call(value, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n if (value !== val) {\n resolve(promise, val);\n } else {\n fulfill(promise, val);\n }\n }, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n reject(promise, val);\n }, 'derived from: ' + (promise._label || ' unknown promise'));\n\n return true;\n }\n }\n } catch (error) {\n if (resolved) { return true; }\n reject(promise, error);\n return true;\n }\n\n return false;\n }\n\n function resolve(promise, value) {\n if (promise === value) {\n fulfill(promise, value);\n } else if (!handleThenable(promise, value)) {\n fulfill(promise, value);\n }\n }\n\n function fulfill(promise, value) {\n if (promise._state !== PENDING) { return; }\n promise._state = SEALED;\n promise._detail = value;\n\n config.async(publishFulfillment, promise);\n }\n\n function reject(promise, reason) {\n if (promise._state !== PENDING) { return; }\n promise._state = SEALED;\n promise._detail = reason;\n\n config.async(publishRejection, promise);\n }\n\n function publishFulfillment(promise) {\n publish(promise, promise._state = FULFILLED);\n }\n\n function publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._detail);\n }\n\n publish(promise, promise._state = REJECTED);\n }\n });\ndefine(\"rsvp/promise/all\",\n [\"../utils\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var isArray = __dependency1__.isArray;\n var isNonThenable = __dependency1__.isNonThenable;\n\n /**\n `RSVP.Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.resolve(2);\n var promise3 = RSVP.resolve(3);\n var promises = [ promise1, promise2, promise3 ];\n\n RSVP.Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `RSVP.all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.reject(new Error(\"2\"));\n var promise3 = RSVP.reject(new Error(\"3\"));\n var promises = [ promise1, promise2, promise3 ];\n\n RSVP.Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @for Ember.RSVP.Promise\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n */\n __exports__[\"default\"] = function all(entries, label) {\n\n /*jshint validthis:true */\n var Constructor = this;\n\n return new Constructor(function(resolve, reject) {\n if (!isArray(entries)) {\n throw new TypeError('You must pass an array to all.');\n }\n\n var remaining = entries.length;\n var results = new Array(remaining);\n var entry, pending = true;\n\n if (remaining === 0) {\n resolve(results);\n return;\n }\n\n function fulfillmentAt(index) {\n return function(value) {\n results[index] = value;\n if (--remaining === 0) {\n resolve(results);\n }\n };\n }\n\n function onRejection(reason) {\n remaining = 0;\n reject(reason);\n }\n\n for (var index = 0; index < entries.length; index++) {\n entry = entries[index];\n if (isNonThenable(entry)) {\n results[index] = entry;\n if (--remaining === 0) {\n resolve(results);\n }\n } else {\n Constructor.cast(entry).then(fulfillmentAt(index), onRejection);\n }\n }\n }, label);\n };\n });\ndefine(\"rsvp/promise/cast\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n `RSVP.Promise.cast` coerces its argument to a promise, or returns the\n argument if it is already a promise which shares a constructor with the caster.\n\n Example:\n\n ```javascript\n var promise = RSVP.Promise.resolve(1);\n var casted = RSVP.Promise.cast(promise);\n\n console.log(promise === casted); // true\n ```\n\n In the case of a promise whose constructor does not match, it is assimilated.\n The resulting promise will fulfill or reject based on the outcome of the\n promise being casted.\n\n Example:\n\n ```javascript\n var thennable = $.getJSON('/api/foo');\n var casted = RSVP.Promise.cast(thennable);\n\n console.log(thennable === casted); // false\n console.log(casted instanceof RSVP.Promise) // true\n\n casted.then(function(data) {\n // data is the value getJSON fulfills with\n });\n ```\n\n In the case of a non-promise, a promise which will fulfill with that value is\n returned.\n\n Example:\n\n ```javascript\n var value = 1; // could be a number, boolean, string, undefined...\n var casted = RSVP.Promise.cast(value);\n\n console.log(value === casted); // false\n console.log(casted instanceof RSVP.Promise) // true\n\n casted.then(function(val) {\n val === value // => true\n });\n ```\n\n `RSVP.Promise.cast` is similar to `RSVP.Promise.resolve`, but `RSVP.Promise.cast` differs in the\n following ways:\n\n * `RSVP.Promise.cast` serves as a memory-efficient way of getting a promise, when you\n have something that could either be a promise or a value. RSVP.resolve\n will have the same effect but will create a new promise wrapper if the\n argument is a promise.\n * `RSVP.Promise.cast` is a way of casting incoming thenables or promise subclasses to\n promises of the exact class specified, so that the resulting object's `then` is\n ensured to have the behavior of the constructor you are calling cast on (i.e., RSVP.Promise).\n\n @method cast\n @param {Object} object to be casted\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise\n @static\n */\n\n __exports__[\"default\"] = function cast(object, label) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n return new Constructor(function(resolve) {\n resolve(object);\n }, label);\n };\n });\ndefine(\"rsvp/promise/race\",\n [\"../utils\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n /* global toString */\n\n var isArray = __dependency1__.isArray;\n var isFunction = __dependency1__.isFunction;\n var isNonThenable = __dependency1__.isNonThenable;\n\n /**\n `RSVP.Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n var promise1 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n resolve(\"promise 1\");\n }, 200);\n });\n\n var promise2 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n resolve(\"promise 2\");\n }, 100);\n });\n\n RSVP.Promise.race([promise1, promise2]).then(function(result){\n // result === \"promise 2\" because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `RSVP.Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n var promise1 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n resolve(\"promise 1\");\n }, 200);\n });\n\n var promise2 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error(\"promise 2\"));\n }, 100);\n });\n\n RSVP.Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === \"promise2\" because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n RSVP.Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @param {Array} promises array of promises to observe\n @param {String} label optional string for describing the promise returned.\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n @static\n */\n __exports__[\"default\"] = function race(entries, label) {\n /*jshint validthis:true */\n var Constructor = this, entry;\n\n return new Constructor(function(resolve, reject) {\n if (!isArray(entries)) {\n throw new TypeError('You must pass an array to race.');\n }\n\n var pending = true;\n\n function onFulfillment(value) { if (pending) { pending = false; resolve(value); } }\n function onRejection(reason) { if (pending) { pending = false; reject(reason); } }\n\n for (var i = 0; i < entries.length; i++) {\n entry = entries[i];\n if (isNonThenable(entry)) {\n pending = false;\n resolve(entry);\n return;\n } else {\n Constructor.cast(entry).then(onFulfillment, onRejection);\n }\n }\n }, label);\n };\n });\ndefine(\"rsvp/promise/reject\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n `RSVP.Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n var promise = new RSVP.Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n var promise = RSVP.Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @param {Any} reason value that the returned promise will be rejected with.\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n @static\n */\n __exports__[\"default\"] = function reject(reason, label) {\n /*jshint validthis:true */\n var Constructor = this;\n\n return new Constructor(function (resolve, reject) {\n reject(reason);\n }, label);\n };\n });\ndefine(\"rsvp/promise/resolve\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n `RSVP.Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n var promise = new RSVP.Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n var promise = RSVP.Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @param {Any} value value that the returned promise will be resolved with\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n @static\n */\n __exports__[\"default\"] = function resolve(value, label) {\n /*jshint validthis:true */\n var Constructor = this;\n\n return new Constructor(function(resolve, reject) {\n resolve(value);\n }, label);\n };\n });\ndefine(\"rsvp/race\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n This is a convenient alias for `RSVP.Promise.race`.\n\n @method race\n @param {Array} array Array of promises.\n @param {String} label An optional label. This is useful\n for tooling.\n @static\n */\n __exports__[\"default\"] = function race(array, label) {\n return Promise.race(array, label);\n };\n });\ndefine(\"rsvp/reject\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n This is a convenient alias for `RSVP.Promise.reject`.\n\n @method reject\n @for RSVP\n @param {Any} reason value that the returned promise will be rejected with.\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n @static\n */\n __exports__[\"default\"] = function reject(reason, label) {\n return Promise.reject(reason, label);\n };\n });\ndefine(\"rsvp/resolve\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n This is a convenient alias for `RSVP.Promise.resolve`.\n\n @method resolve\n @for RSVP\n @param {Any} value value that the returned promise will be resolved with\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n @static\n */\n __exports__[\"default\"] = function resolve(value, label) {\n return Promise.resolve(value, label);\n };\n });\ndefine(\"rsvp/rethrow\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event\n loop in order to aid debugging.\n\n Promises A+ specifies that any exceptions that occur with a promise must be\n caught by the promises implementation and bubbled to the last handler. For\n this reason, it is recommended that you always specify a second rejection\n handler function to `then`. However, `RSVP.rethrow` will throw the exception\n outside of the promise, so it bubbles up to your console if in the browser,\n or domain/cause uncaught exception in Node. `rethrow` will also throw the\n error again so the error can be handled by the promise per the spec.\n\n ```javascript\n function throws(){\n throw new Error('Whoops!');\n }\n\n var promise = new RSVP.Promise(function(resolve, reject){\n throws();\n });\n\n promise.catch(RSVP.rethrow).then(function(){\n // Code here doesn't run because the promise became rejected due to an\n // error!\n }, function (err){\n // handle the error here\n });\n ```\n\n The 'Whoops' error will be thrown on the next turn of the event loop\n and you can watch for it in your console. You can also handle it using a\n rejection handler given to `.then` or `.catch` on the returned promise.\n\n @method rethrow\n @for RSVP\n @param {Error} reason reason the promise became rejected.\n @throws Error\n @static\n */\n __exports__[\"default\"] = function rethrow(reason) {\n setTimeout(function() {\n throw reason;\n });\n throw reason;\n };\n });\ndefine(\"rsvp/utils\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n function objectOrFunction(x) {\n return typeof x === \"function\" || (typeof x === \"object\" && x !== null);\n }\n\n __exports__.objectOrFunction = objectOrFunction;function isFunction(x) {\n return typeof x === \"function\";\n }\n\n __exports__.isFunction = isFunction;function isNonThenable(x) {\n return !objectOrFunction(x);\n }\n\n __exports__.isNonThenable = isNonThenable;function isArray(x) {\n return Object.prototype.toString.call(x) === \"[object Array]\";\n }\n\n __exports__.isArray = isArray;// Date.now is not available in browsers < IE9\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility\n var now = Date.now || function() { return new Date().getTime(); };\n __exports__.now = now;\n var keysOf = Object.keys || function(object) {\n var result = [];\n\n for (var prop in object) {\n result.push(prop);\n }\n\n return result;\n };\n __exports__.keysOf = keysOf;\n });\ndefine(\"rsvp\",\n [\"./rsvp/promise\",\"./rsvp/events\",\"./rsvp/node\",\"./rsvp/all\",\"./rsvp/all_settled\",\"./rsvp/race\",\"./rsvp/hash\",\"./rsvp/rethrow\",\"./rsvp/defer\",\"./rsvp/config\",\"./rsvp/map\",\"./rsvp/resolve\",\"./rsvp/reject\",\"./rsvp/filter\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var EventTarget = __dependency2__[\"default\"];\n var denodeify = __dependency3__[\"default\"];\n var all = __dependency4__[\"default\"];\n var allSettled = __dependency5__[\"default\"];\n var race = __dependency6__[\"default\"];\n var hash = __dependency7__[\"default\"];\n var rethrow = __dependency8__[\"default\"];\n var defer = __dependency9__[\"default\"];\n var config = __dependency10__.config;\n var configure = __dependency10__.configure;\n var map = __dependency11__[\"default\"];\n var resolve = __dependency12__[\"default\"];\n var reject = __dependency13__[\"default\"];\n var filter = __dependency14__[\"default\"];\n\n function async(callback, arg) {\n config.async(callback, arg);\n }\n\n function on() {\n config.on.apply(config, arguments);\n }\n\n function off() {\n config.off.apply(config, arguments);\n }\n\n // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__`\n if (typeof window !== 'undefined' && typeof window.__PROMISE_INSTRUMENTATION__ === 'object') {\n var callbacks = window.__PROMISE_INSTRUMENTATION__;\n configure('instrument', true);\n for (var eventName in callbacks) {\n if (callbacks.hasOwnProperty(eventName)) {\n on(eventName, callbacks[eventName]);\n }\n }\n }\n\n __exports__.Promise = Promise;\n __exports__.EventTarget = EventTarget;\n __exports__.all = all;\n __exports__.allSettled = allSettled;\n __exports__.race = race;\n __exports__.hash = hash;\n __exports__.rethrow = rethrow;\n __exports__.defer = defer;\n __exports__.denodeify = denodeify;\n __exports__.configure = configure;\n __exports__.on = on;\n __exports__.off = off;\n __exports__.resolve = resolve;\n __exports__.reject = reject;\n __exports__.async = async;\n __exports__.map = map;\n __exports__.filter = filter;\n });\n\n})();\n//@ sourceURL=rsvp");
+minispade.register('container', "(function() {define(\"container/container\",\n [\"container/inheriting_dict\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var InheritingDict = __dependency1__[\"default\"];\n\n // A lightweight container that helps to assemble and decouple components.\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 function Container(parent) {\n this.parent = parent;\n this.children = [];\n\n this.resolver = parent && parent.resolver || function() {};\n\n this.registry = new InheritingDict(parent && parent.registry);\n this.cache = new InheritingDict(parent && parent.cache);\n this.factoryCache = new InheritingDict(parent && parent.factoryCache);\n this.resolveCache = new InheritingDict(parent && parent.resolveCache);\n this.typeInjections = new InheritingDict(parent && parent.typeInjections);\n this.injections = {};\n\n this.factoryTypeInjections = new InheritingDict(parent && parent.factoryTypeInjections);\n this.factoryInjections = {};\n\n this._options = new InheritingDict(parent && parent._options);\n this._typeOptions = new InheritingDict(parent && parent._typeOptions);\n }\n\n Container.prototype = {\n\n /**\n @property parent\n @type Container\n @default null\n */\n parent: null,\n\n /**\n @property children\n @type Array\n @default []\n */\n children: null,\n\n /**\n @property resolver\n @type function\n */\n resolver: null,\n\n /**\n @property registry\n @type InheritingDict\n */\n registry: null,\n\n /**\n @property cache\n @type InheritingDict\n */\n cache: null,\n\n /**\n @property typeInjections\n @type InheritingDict\n */\n typeInjections: null,\n\n /**\n @property injections\n @type Object\n @default {}\n */\n injections: null,\n\n /**\n @private\n\n @property _options\n @type InheritingDict\n @default null\n */\n _options: null,\n\n /**\n @private\n\n @property _typeOptions\n @type InheritingDict\n */\n _typeOptions: null,\n\n /**\n Returns a new child of the current container. These children are configured\n to correctly inherit from the current container.\n\n @method child\n @return {Container}\n */\n child: function() {\n var container = new Container(this);\n this.children.push(container);\n return container;\n },\n\n /**\n Sets a key-value pair on the current container. If a parent container,\n has the same key, once set on a child, the parent and child will diverge\n as expected.\n\n @method set\n @param {Object} object\n @param {String} key\n @param {any} value\n */\n set: function(object, key, value) {\n object[key] = value;\n },\n\n /**\n Registers a factory for later injection.\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('model:user', Person, {singleton: false });\n container.register('fruit:favorite', Orange);\n container.register('communication:main', Email, {singleton: false});\n ```\n\n @method register\n @param {String} fullName\n @param {Function} factory\n @param {Object} options\n */\n register: function(fullName, factory, options) {\n validateFullName(fullName);\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.cache.has(normalizedName)) {\n throw new Error('Cannot re-register: `' + fullName +'`, as it has already been looked up.');\n }\n\n this.registry.set(normalizedName, factory);\n this._options.set(normalizedName, options || {});\n },\n\n /**\n Unregister a fullName\n\n ```javascript\n var container = new Container();\n container.register('model:user', User);\n\n container.lookup('model:user') instanceof User //=> true\n\n container.unregister('model:user')\n container.lookup('model:user') === undefined //=> true\n ```\n\n @method unregister\n @param {String} fullName\n */\n unregister: function(fullName) {\n validateFullName(fullName);\n\n var normalizedName = this.normalize(fullName);\n\n this.registry.remove(normalizedName);\n this.cache.remove(normalizedName);\n this.factoryCache.remove(normalizedName);\n this.resolveCache.remove(normalizedName);\n this._options.remove(normalizedName);\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n By default `resolve` will retrieve the factory from\n its container's registry.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n container.resolve('api:twitter') // => Twitter\n ```\n\n Optionally the container can be provided with a custom resolver.\n If provided, `resolve` will first provide the custom resolver\n the opportunity to resolve the fullName, otherwise it will fallback\n to the registry.\n\n ```javascript\n var container = new Container();\n container.resolver = function(fullName) {\n // lookup via the module system of choice\n };\n\n // the twitter factory is added to the module system\n container.resolve('api:twitter') // => Twitter\n ```\n\n @method resolve\n @param {String} fullName\n @return {Function} fullName's factory\n */\n resolve: function(fullName) {\n validateFullName(fullName);\n\n var normalizedName = this.normalize(fullName);\n var cached = this.resolveCache.get(normalizedName);\n\n if (cached) { return cached; }\n\n var resolved = this.resolver(normalizedName) || this.registry.get(normalizedName);\n\n this.resolveCache.set(normalizedName, resolved);\n\n return resolved;\n },\n\n /**\n A hook that can be used to describe how the resolver will\n attempt to find the factory.\n\n For example, the default Ember `.describe` returns the full\n class name (including namespace) where Ember's resolver expects\n to find the `fullName`.\n\n @method describe\n @param {String} fullName\n @return {string} described fullName\n */\n describe: function(fullName) {\n return fullName;\n },\n\n /**\n A hook to enable custom fullName normalization behaviour\n\n @method normalize\n @param {String} fullName\n @return {string} normalized fullName\n */\n normalize: function(fullName) {\n return fullName;\n },\n\n /**\n @method makeToString\n\n @param {any} factory\n @param {string} fullName\n @return {function} toString function\n */\n makeToString: function(factory, fullName) {\n return factory.toString();\n },\n\n /**\n Given a fullName return a corresponding instance.\n\n The default behaviour is for lookup to return a singleton instance.\n The singleton is scoped to the container, allowing multiple containers\n to all have their own locally scoped singletons.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter');\n\n twitter instanceof Twitter; // => true\n\n // by default the container will return singletons\n var twitter2 = container.lookup('api:twitter');\n twitter2 instanceof Twitter; // => true\n\n twitter === twitter2; //=> true\n ```\n\n If singletons are not wanted an optional flag can be provided at lookup.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter', { singleton: false });\n var twitter2 = container.lookup('api:twitter', { singleton: false });\n\n twitter === twitter2; //=> false\n ```\n\n @method lookup\n @param {String} fullName\n @param {Object} options\n @return {any}\n */\n lookup: function(fullName, options) {\n validateFullName(fullName);\n return lookup(this, this.normalize(fullName), options);\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n @method lookupFactory\n @param {String} fullName\n @return {any}\n */\n lookupFactory: function(fullName) {\n validateFullName(fullName);\n return factoryFor(this, this.normalize(fullName));\n },\n\n /**\n Given a fullName check if the container is aware of its factory\n or singleton instance.\n\n @method has\n @param {String} fullName\n @return {Boolean}\n */\n has: function(fullName) {\n validateFullName(fullName);\n return has(this, this.normalize(fullName));\n },\n\n /**\n Allow registering options for all factories of a type.\n\n ```javascript\n var container = new Container();\n\n // if all of type `connection` must not be singletons\n container.optionsForType('connection', { singleton: false });\n\n container.register('connection:twitter', TwitterConnection);\n container.register('connection:facebook', FacebookConnection);\n\n var twitter = container.lookup('connection:twitter');\n var twitter2 = container.lookup('connection:twitter');\n\n twitter === twitter2; // => false\n\n var facebook = container.lookup('connection:facebook');\n var facebook2 = container.lookup('connection:facebook');\n\n facebook === facebook2; // => false\n ```\n\n @method optionsForType\n @param {String} type\n @param {Object} options\n */\n optionsForType: function(type, options) {\n if (this.parent) { illegalChildOperation('optionsForType'); }\n\n this._typeOptions.set(type, options);\n },\n\n /**\n @method options\n @param {String} type\n @param {Object} options\n */\n options: function(type, options) {\n this.optionsForType(type, options);\n },\n\n /**\n Used only via `injection`.\n\n Provides a specialized form of injection, specifically enabling\n all objects of one type to be injected with a reference to another\n object.\n\n For example, provided each object of type `controller` needed a `router`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.register('router:main', Router);\n container.register('controller:user', UserController);\n container.register('controller:post', PostController);\n\n container.typeInjection('controller', 'router', 'router:main');\n\n var user = container.lookup('controller:user');\n var post = container.lookup('controller:post');\n\n user.router instanceof Router; //=> true\n post.router instanceof Router; //=> true\n\n // both controllers share the same router\n user.router === post.router; //=> true\n ```\n\n @private\n @method typeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n typeInjection: function(type, property, fullName) {\n validateFullName(fullName);\n if (this.parent) { illegalChildOperation('typeInjection'); }\n\n var fullNameType = fullName.split(':')[0];\n if(fullNameType === type) {\n throw new Error('Cannot inject a `' + fullName + '` on other ' + type + '(s). Register the `' + fullName + '` as a different type and perform the typeInjection.');\n }\n addTypeInjection(this.typeInjections, type, property, fullName);\n },\n\n /**\n Defines injection rules.\n\n These rules are used to inject dependencies onto objects when they\n are instantiated.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('source:main', Source);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another fullName\n // eg. each user model gets a post model\n container.injection('model:user', 'post', 'model:post');\n\n // injecting one fullName on another type\n container.injection('model', 'source', 'source:main');\n\n var user = container.lookup('model:user');\n var post = container.lookup('model:post');\n\n user.source instanceof Source; //=> true\n post.source instanceof Source; //=> true\n\n user.post instanceof Post; //=> true\n\n // and both models share the same source\n user.source === post.source; //=> true\n ```\n\n @method injection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\n */\n injection: function(fullName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n validateFullName(injectionName);\n var normalizedInjectionName = this.normalize(injectionName);\n\n if (fullName.indexOf(':') === -1) {\n return this.typeInjection(fullName, property, normalizedInjectionName);\n }\n\n validateFullName(fullName);\n var normalizedName = this.normalize(fullName);\n\n addInjection(this.injections, normalizedName, property, normalizedInjectionName);\n },\n\n\n /**\n Used only via `factoryInjection`.\n\n Provides a specialized form of injection, specifically enabling\n all factory of one type to be injected with a reference to another\n object.\n\n For example, provided each factory of type `model` needed a `store`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.register('store:main', SomeStore);\n\n container.factoryTypeInjection('model', 'store', 'store:main');\n\n var store = container.lookup('store:main');\n var UserFactory = container.lookupFactory('model:user');\n\n UserFactory.store instanceof SomeStore; //=> true\n ```\n\n @private\n @method factoryTypeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n factoryTypeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('factoryTypeInjection'); }\n\n addTypeInjection(this.factoryTypeInjections, type, property, this.normalize(fullName));\n },\n\n /**\n Defines factory injection rules.\n\n Similar to regular injection rules, but are run against factories, via\n `Container#lookupFactory`.\n\n These rules are used to inject objects onto factories when they\n are looked up.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('store:main', Store);\n container.register('store:secondary', OtherStore);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another type\n container.factoryInjection('model', 'store', 'store:main');\n\n // injecting one fullName on another fullName\n container.factoryInjection('model:post', 'secondaryStore', 'store:secondary');\n\n var UserFactory = container.lookupFactory('model:user');\n var PostFactory = container.lookupFactory('model:post');\n var store = container.lookup('store:main');\n\n UserFactory.store instanceof Store; //=> true\n UserFactory.secondaryStore instanceof OtherStore; //=> false\n\n PostFactory.store instanceof Store; //=> true\n PostFactory.secondaryStore instanceof OtherStore; //=> true\n\n // and both models share the same source instance\n UserFactory.store === PostFactory.store; //=> true\n ```\n\n @method factoryInjection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\n */\n factoryInjection: function(fullName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n var normalizedName = this.normalize(fullName);\n var normalizedInjectionName = this.normalize(injectionName);\n\n validateFullName(injectionName);\n\n if (fullName.indexOf(':') === -1) {\n return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName);\n }\n\n validateFullName(fullName);\n\n addInjection(this.factoryInjections, normalizedName, property, normalizedInjectionName);\n },\n\n /**\n A depth first traversal, destroying the container, its descendant containers and all\n their managed objects.\n\n @method destroy\n */\n destroy: function() {\n for (var i=0, l=this.children.length; i<l; i++) {\n this.children[i].destroy();\n }\n\n this.children = [];\n\n eachDestroyable(this, function(item) {\n item.destroy();\n });\n\n this.parent = undefined;\n this.isDestroyed = true;\n },\n\n /**\n @method reset\n */\n reset: function() {\n for (var i=0, l=this.children.length; i<l; i++) {\n resetCache(this.children[i]);\n }\n resetCache(this);\n }\n };\n\n function has(container, fullName){\n if (container.cache.has(fullName)) {\n return true;\n }\n\n return !!container.resolve(fullName);\n }\n\n function lookup(container, fullName, options) {\n options = options || {};\n\n if (container.cache.has(fullName) && options.singleton !== false) {\n return container.cache.get(fullName);\n }\n\n var value = instantiate(container, fullName);\n\n if (value === undefined) { return; }\n\n if (isSingleton(container, fullName) && options.singleton !== false) {\n container.cache.set(fullName, value);\n }\n\n return value;\n }\n\n function illegalChildOperation(operation) {\n throw new Error(operation + \" is not currently supported on child containers\");\n }\n\n function isSingleton(container, fullName) {\n var singleton = option(container, fullName, 'singleton');\n\n return singleton !== false;\n }\n\n function buildInjections(container, injections) {\n var hash = {};\n\n if (!injections) { return hash; }\n\n var injection, injectable;\n\n for (var i=0, l=injections.length; i<l; i++) {\n injection = injections[i];\n injectable = lookup(container, injection.fullName);\n\n if (injectable !== undefined) {\n hash[injection.property] = injectable;\n } else {\n throw new Error('Attempting to inject an unknown injection: `' + injection.fullName + '`');\n }\n }\n\n return hash;\n }\n\n function option(container, fullName, optionName) {\n var options = container._options.get(fullName);\n\n if (options && options[optionName] !== undefined) {\n return options[optionName];\n }\n\n var type = fullName.split(\":\")[0];\n options = container._typeOptions.get(type);\n\n if (options) {\n return options[optionName];\n }\n }\n\n function factoryFor(container, fullName) {\n var name = fullName;\n var factory = container.resolve(name);\n var injectedFactory;\n var cache = container.factoryCache;\n var type = fullName.split(\":\")[0];\n\n if (factory === undefined) { return; }\n\n if (cache.has(fullName)) {\n return cache.get(fullName);\n }\n\n if (!factory || typeof factory.extend !== 'function' || (!Ember.MODEL_FACTORY_INJECTIONS && type === 'model')) {\n // TODO: think about a 'safe' merge style extension\n // for now just fallback to create time injection\n return factory;\n } else {\n\n var injections = injectionsFor(container, fullName);\n var factoryInjections = factoryInjectionsFor(container, fullName);\n\n factoryInjections._toString = container.makeToString(factory, fullName);\n\n injectedFactory = factory.extend(injections);\n injectedFactory.reopenClass(factoryInjections);\n\n cache.set(fullName, injectedFactory);\n\n return injectedFactory;\n }\n }\n\n function injectionsFor(container, fullName) {\n var splitName = fullName.split(\":\"),\n type = splitName[0],\n injections = [];\n\n injections = injections.concat(container.typeInjections.get(type) || []);\n injections = injections.concat(container.injections[fullName] || []);\n\n injections = buildInjections(container, injections);\n injections._debugContainerKey = fullName;\n injections.container = container;\n\n return injections;\n }\n\n function factoryInjectionsFor(container, fullName) {\n var splitName = fullName.split(\":\"),\n type = splitName[0],\n factoryInjections = [];\n\n factoryInjections = factoryInjections.concat(container.factoryTypeInjections.get(type) || []);\n factoryInjections = factoryInjections.concat(container.factoryInjections[fullName] || []);\n\n factoryInjections = buildInjections(container, factoryInjections);\n factoryInjections._debugContainerKey = fullName;\n\n return factoryInjections;\n }\n\n function instantiate(container, fullName) {\n var factory = factoryFor(container, fullName);\n\n if (option(container, fullName, 'instantiate') === false) {\n return factory;\n }\n\n if (factory) {\n if (typeof factory.extend === 'function') {\n // assume the factory was extendable and is already injected\n return factory.create();\n } else {\n // assume the factory was extendable\n // to create time injections\n // TODO: support new'ing for instantiation and merge injections for pure JS Functions\n return factory.create(injectionsFor(container, fullName));\n }\n }\n }\n\n function eachDestroyable(container, callback) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n callback(value);\n });\n }\n\n function resetCache(container) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n value.destroy();\n });\n container.cache.dict = {};\n }\n\n function addTypeInjection(rules, type, property, fullName) {\n var injections = rules.get(type);\n\n if (!injections) {\n injections = [];\n rules.set(type, injections);\n }\n\n injections.push({\n property: property,\n fullName: fullName\n });\n }\n\n var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/;\n function validateFullName(fullName) {\n if (!VALID_FULL_NAME_REGEXP.test(fullName)) {\n throw new TypeError('Invalid Fullname, expected: `type:name` got: ' + fullName);\n }\n }\n\n function addInjection(rules, factoryName, property, injectionName) {\n var injections = rules[factoryName] = rules[factoryName] || [];\n injections.push({ property: property, fullName: injectionName });\n }\n\n __exports__[\"default\"] = Container;\n });\ndefine(\"container/inheriting_dict\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n // A safe and simple inheriting object.\n function InheritingDict(parent) {\n this.parent = parent;\n this.dict = {};\n }\n\n InheritingDict.prototype = {\n\n /**\n @property parent\n @type InheritingDict\n @default null\n */\n\n parent: null,\n\n /**\n Object used to store the current nodes data.\n\n @property dict\n @type Object\n @default Object\n */\n dict: null,\n\n /**\n Retrieve the value given a key, if the value is present at the current\n level use it, otherwise walk up the parent hierarchy and try again. If\n no matching key is found, return undefined.\n\n @method get\n @param {String} key\n @return {any}\n */\n get: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return dict[key];\n }\n\n if (this.parent) {\n return this.parent.get(key);\n }\n },\n\n /**\n Set the given value for the given key, at the current level.\n\n @method set\n @param {String} key\n @param {Any} value\n */\n set: function(key, value) {\n this.dict[key] = value;\n },\n\n /**\n Delete the given key\n\n @method remove\n @param {String} key\n */\n remove: function(key) {\n delete this.dict[key];\n },\n\n /**\n Check for the existence of given a key, if the key is present at the current\n level return true, otherwise walk up the parent hierarchy and try again. If\n no matching key is found, return false.\n\n @method has\n @param {String} key\n @return {Boolean}\n */\n has: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return true;\n }\n\n if (this.parent) {\n return this.parent.has(key);\n }\n\n return false;\n },\n\n /**\n Iterate and invoke a callback for each local key-value pair.\n\n @method eachLocal\n @param {Function} callback\n @param {Object} binding\n */\n eachLocal: function(callback, binding) {\n var dict = this.dict;\n\n for (var prop in dict) {\n if (dict.hasOwnProperty(prop)) {\n callback.call(binding, prop, dict[prop]);\n }\n }\n }\n };\n\n __exports__[\"default\"] = InheritingDict;\n });\ndefine(\"container\",\n [\"container/container\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\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 /*\n Flag to enable/disable model factory injections (disabled by default)\n If model factory injections are enabled, models should not be\n accessed globally (only through `container.lookupFactory('model:modelName'))`);\n */\n Ember.MODEL_FACTORY_INJECTIONS = false;\n\n if (Ember.ENV && typeof Ember.ENV.MODEL_FACTORY_INJECTIONS !== 'undefined') {\n Ember.MODEL_FACTORY_INJECTIONS = !!Ember.ENV.MODEL_FACTORY_INJECTIONS;\n }\n\n\n var Container = __dependency1__[\"default\"];\n\n __exports__[\"default\"] = Container;\n });\n})();\n//@ sourceURL=container");minispade.register('ember-application', "(function() {minispade.require(\"ember-routing\");\nminispade.require(\"ember-extension-support\");\ndefine(\"ember-application/ext/controller\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/error\",\"ember-metal/utils\",\"ember-metal/computed\",\"ember-runtime/controllers/controller\",\"ember-routing/system/controller_for\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-application\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EmberError = __dependency4__[\"default\"];\n var inspect = __dependency5__.inspect;\n var computed = __dependency6__.computed;\n var ControllerMixin = __dependency7__.ControllerMixin;\n var meta = __dependency5__.meta;\n var controllerFor = __dependency8__.controllerFor;\n var meta = __dependency5__.meta;\n\n function verifyNeedsDependencies(controller, container, needs) {\n var dependency, i, l, missing = [];\n\n for (i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n\n Ember.assert(inspect(controller) + \"#needs must not specify dependencies with periods in their names (\" + dependency + \")\", dependency.indexOf('.') === -1);\n\n if (dependency.indexOf(':') === -1) {\n dependency = \"controller:\" + dependency;\n }\n\n // Structure assert to still do verification but not string concat in production\n if (!container.has(dependency)) {\n missing.push(dependency);\n }\n }\n if (missing.length) {\n throw new EmberError(inspect(controller) + \" needs [ \" + missing.join(', ') + \" ] but \" + (missing.length > 1 ? 'they' : 'it') + \" could not be found\");\n }\n }\n\n var defaultControllersComputedProperty = computed(function() {\n var controller = this;\n\n return {\n needs: get(controller, 'needs'),\n container: get(controller, 'container'),\n unknownProperty: function(controllerName) {\n var needs = this.needs,\n dependency, i, l;\n for (i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency === controllerName) {\n return this.container.lookup('controller:' + controllerName);\n }\n }\n\n var errorMessage = inspect(controller) + '#needs does not include `' + controllerName + '`. To access the ' + controllerName + ' controller from ' + inspect(controller) + ', ' + inspect(controller) + ' should have a `needs` property that is an array of the controllers it has access to.';\n throw new ReferenceError(errorMessage);\n },\n setUnknownProperty: function (key, value) {\n throw new Error(\"You cannot overwrite the value of `controllers.\" + key + \"` of \" + inspect(controller));\n }\n };\n });\n\n /**\n @class ControllerMixin\n @namespace Ember\n */\n ControllerMixin.reopen({\n concatenatedProperties: ['needs'],\n\n /**\n An array of other controller objects available inside\n instances of this controller via the `controllers`\n property:\n\n For example, when you define a controller:\n\n ```javascript\n App.CommentsController = Ember.ArrayController.extend({\n needs: ['post']\n });\n ```\n\n The application's single instance of these other\n controllers are accessible by name through the\n `controllers` property:\n\n ```javascript\n this.get('controllers.post'); // instance of App.PostController\n ```\n\n Given that you have a nested controller (nested resource):\n\n ```javascript\n App.CommentsNewController = Ember.ObjectController.extend({\n });\n ```\n\n When you define a controller that requires access to a nested one:\n\n ```javascript\n App.IndexController = Ember.ObjectController.extend({\n needs: ['commentsNew']\n });\n ```\n\n You will be able to get access to it:\n\n ```javascript\n this.get('controllers.commentsNew'); // instance of App.CommentsNewController\n ```\n\n This is only available for singleton controllers.\n\n @property {Array} needs\n @default []\n */\n needs: [],\n\n init: function() {\n var needs = get(this, 'needs'),\n length = get(needs, 'length');\n\n if (length > 0) {\n Ember.assert(' `' + inspect(this) + ' specifies `needs`, but does ' +\n \"not have a container. Please ensure this controller was \" +\n \"instantiated with a container.\",\n this.container || meta(this, false).descs.controllers !== defaultControllersComputedProperty);\n\n if (this.container) {\n verifyNeedsDependencies(this, this.container, needs);\n }\n\n // if needs then initialize controllers proxy\n get(this, 'controllers');\n }\n\n this._super.apply(this, arguments);\n },\n\n /**\n @method controllerFor\n @see {Ember.Route#controllerFor}\n @deprecated Use `needs` instead\n */\n controllerFor: function(controllerName) {\n Ember.deprecate(\"Controller#controllerFor is deprecated, please use Controller#needs instead\");\n return controllerFor(get(this, 'container'), controllerName);\n },\n\n /**\n Stores the instances of other controllers available from within\n this controller. Any controller listed by name in the `needs`\n property will be accessible by name through this property.\n\n ```javascript\n App.CommentsController = Ember.ArrayController.extend({\n needs: ['post'],\n postTitle: function(){\n var currentPost = this.get('controllers.post'); // instance of App.PostController\n return currentPost.get('title');\n }.property('controllers.post.title')\n });\n ```\n\n @see {Ember.ControllerMixin#needs}\n @property {Object} controllers\n @default null\n */\n controllers: defaultControllersComputedProperty\n });\n\n __exports__[\"default\"] = ControllerMixin;\n });\ndefine(\"ember-application\",\n [\"ember-metal/core\",\"ember-runtime/system/lazy_load\",\"ember-application/system/dag\",\"ember-application/system/resolver\",\"ember-application/system/application\",\"ember-application/ext/controller\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var runLoadHooks = __dependency2__.runLoadHooks;\n\n /**\n Ember Application\n\n @module ember\n @submodule ember-application\n @requires ember-views, ember-routing\n */\n\n var DAG = __dependency3__[\"default\"];var Resolver = __dependency4__.Resolver;\n var DefaultResolver = __dependency4__.DefaultResolver;\n var Application = __dependency5__[\"default\"];\n // side effect of extending ControllerMixin\n\n Ember.Application = Application;\n Ember.DAG = DAG;\n Ember.Resolver = Resolver;\n Ember.DefaultResolver = DefaultResolver;\n\n runLoadHooks('Ember.Application', Application);\n });\ndefine(\"ember-application/system/application\",\n [\"ember-metal\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/lazy_load\",\"ember-application/system/dag\",\"ember-runtime/system/namespace\",\"ember-runtime/mixins/deferred\",\"ember-application/system/resolver\",\"ember-metal/platform\",\"ember-metal/run_loop\",\"ember-metal/utils\",\"container/container\",\"ember-runtime/controllers/controller\",\"ember-metal/enumerable_utils\",\"ember-runtime/controllers/object_controller\",\"ember-runtime/controllers/array_controller\",\"ember-views/system/event_dispatcher\",\"ember-extension-support/container_debug_adapter\",\"ember-views/system/jquery\",\"ember-routing/system/route\",\"ember-routing/system/router\",\"ember-routing/location/hash_location\",\"ember-routing/location/history_location\",\"ember-routing/location/auto_location\",\"ember-routing/location/none_location\",\"ember-handlebars-compiler\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-application\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.FEATURES, Ember.deprecate, Ember.assert, Ember.libraries, LOG_VERSION, Namespace, BOOTED\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var runLoadHooks = __dependency4__.runLoadHooks;\n var DAG = __dependency5__[\"default\"];var Namespace = __dependency6__[\"default\"];\n var DeferredMixin = __dependency7__[\"default\"];\n var DefaultResolver = __dependency8__.DefaultResolver;\n var create = __dependency9__.create;\n var run = __dependency10__[\"default\"];\n var canInvoke = __dependency11__.canInvoke;\n var Container = __dependency12__[\"default\"];\n var Controller = __dependency13__.Controller;\n var EnumerableUtils = __dependency14__[\"default\"];\n var ObjectController = __dependency15__[\"default\"];\n var ArrayController = __dependency16__[\"default\"];\n var EventDispatcher = __dependency17__[\"default\"];\n var ContainerDebugAdapter = __dependency18__[\"default\"];\n var jQuery = __dependency19__[\"default\"];\n var Route = __dependency20__[\"default\"];\n var Router = __dependency21__[\"default\"];\n var HashLocation = __dependency22__[\"default\"];\n var HistoryLocation = __dependency23__[\"default\"];\n var AutoLocation = __dependency24__[\"default\"];\n var NoneLocation = __dependency25__[\"default\"];\n\n var EmberHandlebars = __dependency26__[\"default\"];\n\n var K = Ember.K;\n\n function DeprecatedContainer(container) {\n this._container = container;\n }\n\n DeprecatedContainer.deprecate = function(method) {\n return function() {\n var container = this._container;\n\n Ember.deprecate('Using the defaultContainer is no longer supported. [defaultContainer#' + method + '] see: http://git.io/EKPpnA', false);\n return container[method].apply(container, arguments);\n };\n };\n\n DeprecatedContainer.prototype = {\n _container: null,\n lookup: DeprecatedContainer.deprecate('lookup'),\n resolve: DeprecatedContainer.deprecate('resolve'),\n register: DeprecatedContainer.deprecate('register')\n };\n\n /**\n An instance of `Ember.Application` is the starting point for every Ember\n application. It helps to instantiate, initialize and coordinate the many\n objects that make up your app.\n\n Each Ember app has one and only one `Ember.Application` object. In fact, the\n very first thing you should do in your application is create the instance:\n\n ```javascript\n window.App = Ember.Application.create();\n ```\n\n Typically, the application object is the only global variable. All other\n classes in your app should be properties on the `Ember.Application` instance,\n which highlights its first role: a global namespace.\n\n For example, if you define a view class, it might look like this:\n\n ```javascript\n App.MyView = Ember.View.extend();\n ```\n\n By default, calling `Ember.Application.create()` will automatically initialize\n your application by calling the `Ember.Application.initialize()` method. If\n you need to delay initialization, you can call your app's `deferReadiness()`\n method. When you are ready for your app to be initialized, call its\n `advanceReadiness()` method.\n\n You can define a `ready` method on the `Ember.Application` instance, which\n will be run by Ember when the application is initialized.\n\n Because `Ember.Application` inherits from `Ember.Namespace`, any classes\n you create will have useful string representations when calling `toString()`.\n See the `Ember.Namespace` documentation for more information.\n\n While you can think of your `Ember.Application` as a container that holds the\n other classes in your application, there are several other responsibilities\n going on under-the-hood that you may want to understand.\n\n ### Event Delegation\n\n Ember uses a technique called _event delegation_. This allows the framework\n to set up a global, shared event listener instead of requiring each view to\n do it manually. For example, instead of each view registering its own\n `mousedown` listener on its associated element, Ember sets up a `mousedown`\n listener on the `body`.\n\n If a `mousedown` event occurs, Ember will look at the target of the event and\n start walking up the DOM node tree, finding corresponding views and invoking\n their `mouseDown` method as it goes.\n\n `Ember.Application` has a number of default events that it listens for, as\n well as a mapping from lowercase events to camel-cased view method names. For\n example, the `keypress` event causes the `keyPress` method on the view to be\n called, the `dblclick` event causes `doubleClick` to be called, and so on.\n\n If there is a bubbling browser event that Ember does not listen for by\n default, you can specify custom events and their corresponding view method\n names by setting the application's `customEvents` property:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the paste event\n paste: \"paste\"\n }\n });\n ```\n\n By default, the application sets up these event listeners on the document\n body. However, in cases where you are embedding an Ember application inside\n an existing page, you may want it to set up the listeners on an element\n inside the body.\n\n For example, if only events inside a DOM element with the ID of `ember-app`\n should be delegated, set your application's `rootElement` property:\n\n ```javascript\n window.App = Ember.Application.create({\n rootElement: '#ember-app'\n });\n ```\n\n The `rootElement` can be either a DOM element or a jQuery-compatible selector\n string. Note that *views appended to the DOM outside the root element will\n not receive events.* If you specify a custom root element, make sure you only\n append views inside it!\n\n To learn more about the advantages of event delegation and the Ember view\n layer, and a list of the event listeners that are setup by default, visit the\n [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation).\n\n ### Initializers\n\n Libraries on top of Ember can add initializers, like so:\n\n ```javascript\n Ember.Application.initializer({\n name: 'api-adapter',\n\n initialize: function(container, application) {\n application.register('api-adapter:main', ApiAdapter);\n }\n });\n ```\n\n Initializers provide an opportunity to access the container, which\n organizes the different components of an Ember application. Additionally\n they provide a chance to access the instantiated application. Beyond\n being used for libraries, initializers are also a great way to organize\n dependency injection or setup in your own application.\n\n ### Routing\n\n In addition to creating your application's router, `Ember.Application` is\n also responsible for telling the router when to start routing. Transitions\n between routes can be logged with the `LOG_TRANSITIONS` flag, and more\n detailed intra-transition logging can be logged with\n the `LOG_TRANSITIONS_INTERNAL` flag:\n\n ```javascript\n window.App = Ember.Application.create({\n LOG_TRANSITIONS: true, // basic logging of successful transitions\n LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n });\n ```\n\n By default, the router will begin trying to translate the current URL into\n application state once the browser emits the `DOMContentReady` event. If you\n need to defer routing, you can call the application's `deferReadiness()`\n method. Once routing can begin, call the `advanceReadiness()` method.\n\n If there is any setup required before routing begins, you can implement a\n `ready()` method on your app that will be invoked immediately before routing\n begins.\n ```\n\n @class Application\n @namespace Ember\n @extends Ember.Namespace\n */\n\n var Application = Namespace.extend(DeferredMixin, {\n\n /**\n The root DOM element of the Application. This can be specified as an\n element or a\n [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).\n\n This is the element that will be passed to the Application's,\n `eventDispatcher`, which sets up the listeners for event delegation. Every\n view in your application should be a child of the element you specify here.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n The `Ember.EventDispatcher` responsible for delegating events to this\n application's views.\n\n The event dispatcher is created by the application at initialization time\n and sets up event listeners on the DOM element described by the\n application's `rootElement` property.\n\n See the documentation for `Ember.EventDispatcher` for more information.\n\n @property eventDispatcher\n @type Ember.EventDispatcher\n @default null\n */\n eventDispatcher: null,\n\n /**\n The DOM events for which the event dispatcher should listen.\n\n By default, the application's `Ember.EventDispatcher` listens\n for a set of standard DOM events, such as `mousedown` and\n `keyup`, and delegates them to your application's `Ember.View`\n instances.\n\n If you would like additional bubbling events to be delegated to your\n views, set your `Ember.Application`'s `customEvents` property\n to a hash containing the DOM event name as the key and the\n corresponding view method name as the value. For example:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the paste event\n paste: \"paste\"\n }\n });\n ```\n\n @property customEvents\n @type Object\n @default null\n */\n customEvents: null,\n\n // Start off the number of deferrals at 1. This will be\n // decremented by the Application's own `initialize` method.\n _readinessDeferrals: 1,\n\n init: function() {\n if (!this.$) { this.$ = jQuery; }\n this.__container__ = this.buildContainer();\n\n this.Router = this.defaultRouter();\n\n this._super();\n\n this.scheduleInitialize();\n\n Ember.libraries.registerCoreLibrary('Handlebars', EmberHandlebars.VERSION);\n Ember.libraries.registerCoreLibrary('jQuery', jQuery().jquery);\n\n if ( Ember.LOG_VERSION ) {\n Ember.LOG_VERSION = false; // we only need to see this once per Application#init\n\n var nameLengths = EnumerableUtils.map(Ember.libraries, function(item) {\n return get(item, \"name.length\");\n });\n\n var maxNameLength = Math.max.apply(this, nameLengths);\n\n Ember.debug('-------------------------------');\n Ember.libraries.each(function(name, version) {\n var spaces = new Array(maxNameLength - name.length + 1).join(\" \");\n Ember.debug([name, spaces, ' : ', version].join(\"\"));\n });\n Ember.debug('-------------------------------');\n }\n },\n\n /**\n Build the container for the current application.\n\n Also register a default application view in case the application\n itself does not.\n\n @private\n @method buildContainer\n @return {Ember.Container} the configured container\n */\n buildContainer: function() {\n var container = this.__container__ = Application.buildContainer(this);\n\n return container;\n },\n\n /**\n If the application has not opted out of routing and has not explicitly\n defined a router, supply a default router for the application author\n to configure.\n\n This allows application developers to do:\n\n ```javascript\n var App = Ember.Application.create();\n\n App.Router.map(function() {\n this.resource('posts');\n });\n ```\n\n @private\n @method defaultRouter\n @return {Ember.Router} the default router\n */\n\n defaultRouter: function() {\n if (this.Router === false) { return; }\n var container = this.__container__;\n\n if (this.Router) {\n container.unregister('router:main');\n container.register('router:main', this.Router);\n }\n\n return container.lookupFactory('router:main');\n },\n\n /**\n Automatically initialize the application once the DOM has\n become ready.\n\n The initialization itself is scheduled on the actions queue\n which ensures that application loading finishes before\n booting.\n\n If you are asynchronously loading code, you should call\n `deferReadiness()` to defer booting, and then call\n `advanceReadiness()` once all of your code has finished\n loading.\n\n @private\n @method scheduleInitialize\n */\n scheduleInitialize: function() {\n var self = this;\n\n if (!this.$ || this.$.isReady) {\n run.schedule('actions', self, '_initialize');\n } else {\n this.$().ready(function runInitialize() {\n run(self, '_initialize');\n });\n }\n },\n\n /**\n Use this to defer readiness until some condition is true.\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n App.deferReadiness();\n\n jQuery.getJSON(\"/auth-token\", function(token) {\n App.token = token;\n App.advanceReadiness();\n });\n ```\n\n This allows you to perform asynchronous setup logic and defer\n booting your application until the setup has finished.\n\n However, if the setup requires a loading UI, it might be better\n to use the router for this purpose.\n\n @method deferReadiness\n */\n deferReadiness: function() {\n Ember.assert(\"You must call deferReadiness on an instance of Ember.Application\", this instanceof Application);\n Ember.assert(\"You cannot defer readiness since the `ready()` hook has already been called.\", this._readinessDeferrals > 0);\n this._readinessDeferrals++;\n },\n\n /**\n Call `advanceReadiness` after any asynchronous setup logic has completed.\n Each call to `deferReadiness` must be matched by a call to `advanceReadiness`\n or the application will never become ready and routing will not begin.\n\n @method advanceReadiness\n @see {Ember.Application#deferReadiness}\n */\n advanceReadiness: function() {\n Ember.assert(\"You must call advanceReadiness on an instance of Ember.Application\", this instanceof Application);\n this._readinessDeferrals--;\n\n if (this._readinessDeferrals === 0) {\n run.once(this, this.didBecomeReady);\n }\n },\n\n /**\n Registers a factory that can be used for dependency injection (with\n `App.inject`) or for service lookup. Each factory is registered with\n a full name including two parts: `type:name`.\n\n A simple example:\n\n ```javascript\n var App = Ember.Application.create();\n App.Orange = Ember.Object.extend();\n App.register('fruit:favorite', App.Orange);\n ```\n\n Ember will resolve factories from the `App` namespace automatically.\n For example `App.CarsController` will be discovered and returned if\n an application requests `controller:cars`.\n\n An example of registering a controller with a non-standard name:\n\n ```javascript\n var App = Ember.Application.create(),\n Session = Ember.Controller.extend();\n\n App.register('controller:session', Session);\n\n // The Session controller can now be treated like a normal controller,\n // despite its non-standard name.\n App.ApplicationController = Ember.Controller.extend({\n needs: ['session']\n });\n ```\n\n Registered factories are **instantiated** by having `create`\n called on them. Additionally they are **singletons**, each time\n they are looked up they return the same instance.\n\n Some examples modifying that default behavior:\n\n ```javascript\n var App = Ember.Application.create();\n\n App.Person = Ember.Object.extend();\n App.Orange = Ember.Object.extend();\n App.Email = Ember.Object.extend();\n App.session = Ember.Object.create();\n\n App.register('model:user', App.Person, {singleton: false });\n App.register('fruit:favorite', App.Orange);\n App.register('communication:main', App.Email, {singleton: false});\n App.register('session', App.session, {instantiate: false});\n ```\n\n @method register\n @param fullName {String} type:name (e.g., 'model:user')\n @param factory {Function} (e.g., App.Person)\n @param options {Object} (optional) disable instantiation or singleton usage\n **/\n register: function() {\n var container = this.__container__;\n container.register.apply(container, arguments);\n },\n\n /**\n Define a dependency injection onto a specific factory or all factories\n of a type.\n\n When Ember instantiates a controller, view, or other framework component\n it can attach a dependency to that component. This is often used to\n provide services to a set of framework components.\n\n An example of providing a session object to all controllers:\n\n ```javascript\n var App = Ember.Application.create(),\n Session = Ember.Object.extend({ isAuthenticated: false });\n\n // A factory must be registered before it can be injected\n App.register('session:main', Session);\n\n // Inject 'session:main' onto all factories of the type 'controller'\n // with the name 'session'\n App.inject('controller', 'session', 'session:main');\n\n App.IndexController = Ember.Controller.extend({\n isLoggedIn: Ember.computed.alias('session.isAuthenticated')\n });\n ```\n\n Injections can also be performed on specific factories.\n\n ```javascript\n App.inject(<full_name or type>, <property name>, <full_name>)\n App.inject('route', 'source', 'source:main')\n App.inject('route:application', 'email', 'model:email')\n ```\n\n It is important to note that injections can only be performed on\n classes that are instantiated by Ember itself. Instantiating a class\n directly (via `create` or `new`) bypasses the dependency injection\n system.\n\n Ember-Data instantiates its models in a unique manner, and consequently\n injections onto models (or all models) will not work as expected. Injections\n on models can be enabled by setting `Ember.MODEL_FACTORY_INJECTIONS`\n to `true`.\n\n @method inject\n @param factoryNameOrType {String}\n @param property {String}\n @param injectionName {String}\n **/\n inject: function() {\n var container = this.__container__;\n container.injection.apply(container, arguments);\n },\n\n /**\n Calling initialize manually is not supported.\n\n Please see Ember.Application#advanceReadiness and\n Ember.Application#deferReadiness.\n\n @private\n @deprecated\n @method initialize\n **/\n initialize: function() {\n Ember.deprecate('Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and Ember.Application#deferReadiness');\n },\n\n /**\n Initialize the application. This happens automatically.\n\n Run any initializers and run the application load hook. These hooks may\n choose to defer readiness. For example, an authentication hook might want\n to defer readiness until the auth token has been retrieved.\n\n @private\n @method _initialize\n */\n _initialize: function() {\n if (this.isDestroyed) { return; }\n\n // At this point, the App.Router must already be assigned\n if (this.Router) {\n var container = this.__container__;\n container.unregister('router:main');\n container.register('router:main', this.Router);\n }\n\n this.runInitializers();\n runLoadHooks('application', this);\n\n // At this point, any initializers or load hooks that would have wanted\n // to defer readiness have fired. In general, advancing readiness here\n // will proceed to didBecomeReady.\n this.advanceReadiness();\n\n return this;\n },\n\n /**\n Reset the application. This is typically used only in tests. It cleans up\n the application in the following order:\n\n 1. Deactivate existing routes\n 2. Destroy all objects in the container\n 3. Create a new application container\n 4. Re-route to the existing url\n\n Typical Example:\n\n ```javascript\n\n var App;\n\n run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n App.reset();\n }\n });\n\n test(\"first test\", function() {\n // App is freshly reset\n });\n\n test(\"first test\", function() {\n // App is again freshly reset\n });\n ```\n\n Advanced Example:\n\n Occasionally you may want to prevent the app from initializing during\n setup. This could enable extra configuration, or enable asserting prior\n to the app becoming ready.\n\n ```javascript\n\n var App;\n\n run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n run(function() {\n App.reset();\n App.deferReadiness();\n });\n }\n });\n\n test(\"first test\", function() {\n ok(true, 'something before app is initialized');\n\n run(function() {\n App.advanceReadiness();\n });\n ok(true, 'something after app is initialized');\n });\n ```\n\n @method reset\n **/\n reset: function() {\n this._readinessDeferrals = 1;\n\n function handleReset() {\n var router = this.__container__.lookup('router:main');\n router.reset();\n\n run(this.__container__, 'destroy');\n\n this.buildContainer();\n\n run.schedule('actions', this, function() {\n this._initialize();\n });\n }\n\n run.join(this, handleReset);\n },\n\n /**\n @private\n @method runInitializers\n */\n runInitializers: function() {\n var initializers = get(this.constructor, 'initializers'),\n container = this.__container__,\n graph = new DAG(),\n namespace = this,\n name, initializer;\n\n for (name in initializers) {\n initializer = initializers[name];\n graph.addEdges(initializer.name, initializer.initialize, initializer.before, initializer.after);\n }\n\n graph.topsort(function (vertex) {\n var initializer = vertex.value;\n Ember.assert(\"No application initializer named '\"+vertex.name+\"'\", initializer);\n initializer(container, namespace);\n });\n },\n\n /**\n @private\n @method didBecomeReady\n */\n didBecomeReady: function() {\n this.setupEventDispatcher();\n this.ready(); // user hook\n this.startRouting();\n\n if (!Ember.testing) {\n // Eagerly name all classes that are already loaded\n Ember.Namespace.processAll();\n Ember.BOOTED = true;\n }\n\n this.resolve(this);\n },\n\n /**\n Setup up the event dispatcher to receive events on the\n application's `rootElement` with any registered\n `customEvents`.\n\n @private\n @method setupEventDispatcher\n */\n setupEventDispatcher: function() {\n var customEvents = get(this, 'customEvents'),\n rootElement = get(this, 'rootElement'),\n dispatcher = this.__container__.lookup('event_dispatcher:main');\n\n set(this, 'eventDispatcher', dispatcher);\n dispatcher.setup(customEvents, rootElement);\n },\n\n /**\n If the application has a router, use it to route to the current URL, and\n trigger a new call to `route` whenever the URL changes.\n\n @private\n @method startRouting\n @property router {Ember.Router}\n */\n startRouting: function() {\n var router = this.__container__.lookup('router:main');\n if (!router) { return; }\n\n router.startRouting();\n },\n\n handleURL: function(url) {\n var router = this.__container__.lookup('router:main');\n\n router.handleURL(url);\n },\n\n /**\n Called when the Application has become ready.\n The call will be delayed until the DOM has become ready.\n\n @event ready\n */\n ready: K,\n\n /**\n @deprecated Use 'Resolver' instead\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n\n @property resolver\n */\n resolver: null,\n\n /**\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n @property resolver\n */\n Resolver: null,\n\n willDestroy: function() {\n Ember.BOOTED = false;\n // Ensure deactivation of routes before objects are destroyed\n this.__container__.lookup('router:main').reset();\n\n this.__container__.destroy();\n },\n\n initializer: function(options) {\n this.constructor.initializer(options);\n }\n });\n\n Application.reopenClass({\n initializers: {},\n\n /**\n Initializer receives an object which has the following attributes:\n `name`, `before`, `after`, `initialize`. The only required attribute is\n `initialize, all others are optional.\n\n * `name` allows you to specify under which name the initializer is registered.\n This must be a unique name, as trying to register two initializers with the\n same name will result in an error.\n\n ```javascript\n Ember.Application.initializer({\n name: 'namedInitializer',\n initialize: function(container, application) {\n Ember.debug(\"Running namedInitializer!\");\n }\n });\n ```\n\n * `before` and `after` are used to ensure that this initializer is ran prior\n or after the one identified by the value. This value can be a single string\n or an array of strings, referencing the `name` of other initializers.\n\n An example of ordering initializers, we create an initializer named `first`:\n\n ```javascript\n Ember.Application.initializer({\n name: 'first',\n initialize: function(container, application) {\n Ember.debug(\"First initializer!\");\n }\n });\n\n // DEBUG: First initializer!\n ```\n\n We add another initializer named `second`, specifying that it should run\n after the initializer named `first`:\n\n ```javascript\n Ember.Application.initializer({\n name: 'second',\n after: 'first',\n\n initialize: function(container, application) {\n Ember.debug(\"Second initializer!\");\n }\n });\n\n // DEBUG: First initializer!\n // DEBUG: Second initializer!\n ```\n\n Afterwards we add a further initializer named `pre`, this time specifying\n that it should run before the initializer named `first`:\n\n ```javascript\n Ember.Application.initializer({\n name: 'pre',\n before: 'first',\n\n initialize: function(container, application) {\n Ember.debug(\"Pre initializer!\");\n }\n });\n\n // DEBUG: Pre initializer!\n // DEBUG: First initializer!\n // DEBUG: Second initializer!\n ```\n\n Finally we add an initializer named `post`, specifying it should run after\n both the `first` and the `second` initializers:\n\n ```javascript\n Ember.Application.initializer({\n name: 'post',\n after: ['first', 'second'],\n\n initialize: function(container, application) {\n Ember.debug(\"Post initializer!\");\n }\n });\n\n // DEBUG: Pre initializer!\n // DEBUG: First initializer!\n // DEBUG: Second initializer!\n // DEBUG: Post initializer!\n ```\n\n * `initialize` is a callback function that receives two arguments, `container`\n and `application` on which you can operate.\n\n Example of using `container` to preload data into the store:\n\n ```javascript\n Ember.Application.initializer({\n name: \"preload-data\",\n\n initialize: function(container, application) {\n var store = container.lookup('store:main');\n store.pushPayload(preloadedData);\n }\n });\n ```\n\n Example of using `application` to register an adapter:\n\n ```javascript\n Ember.Application.initializer({\n name: 'api-adapter',\n\n initialize: function(container, application) {\n application.register('api-adapter:main', ApiAdapter);\n }\n });\n ```\n\n @method initializer\n @param initializer {Object}\n */\n initializer: function(initializer) {\n // If this is the first initializer being added to a subclass, we are going to reopen the class\n // to make sure we have a new `initializers` object, which extends from the parent class' using\n // prototypal inheritance. Without this, attempting to add initializers to the subclass would\n // pollute the parent class as well as other subclasses.\n if (this.superclass.initializers !== undefined && this.superclass.initializers === this.initializers) {\n this.reopenClass({\n initializers: create(this.initializers)\n });\n }\n\n Ember.assert(\"The initializer '\" + initializer.name + \"' has already been registered\", !this.initializers[initializer.name]);\n Ember.assert(\"An initializer cannot be registered without an initialize function\", canInvoke(initializer, 'initialize'));\n\n this.initializers[initializer.name] = initializer;\n },\n\n /**\n This creates a container with the default Ember naming conventions.\n\n It also configures the container:\n\n * registered views are created every time they are looked up (they are\n not singletons)\n * registered templates are not factories; the registered value is\n returned directly.\n * the router receives the application as its `namespace` property\n * all controllers receive the router as their `target` and `controllers`\n properties\n * all controllers receive the application as their `namespace` property\n * the application view receives the application controller as its\n `controller` property\n * the application view receives the application template as its\n `defaultTemplate` property\n\n @private\n @method buildContainer\n @static\n @param {Ember.Application} namespace the application to build the\n container for.\n @return {Ember.Container} the built container\n */\n buildContainer: function(namespace) {\n var container = new Container();\n\n Container.defaultContainer = new DeprecatedContainer(container);\n\n container.set = set;\n container.resolver = resolverFor(namespace);\n container.normalize = container.resolver.normalize;\n container.describe = container.resolver.describe;\n container.makeToString = container.resolver.makeToString;\n\n container.optionsForType('component', { singleton: false });\n container.optionsForType('view', { singleton: false });\n container.optionsForType('template', { instantiate: false });\n container.optionsForType('helper', { instantiate: false });\n\n container.register('application:main', namespace, { instantiate: false });\n\n container.register('controller:basic', Controller, { instantiate: false });\n container.register('controller:object', ObjectController, { instantiate: false });\n container.register('controller:array', ArrayController, { instantiate: false });\n container.register('route:basic', Route, { instantiate: false });\n container.register('event_dispatcher:main', EventDispatcher);\n\n container.register('router:main', Router);\n container.injection('router:main', 'namespace', 'application:main');\n\n container.register('location:auto', AutoLocation);\n container.register('location:hash', HashLocation);\n container.register('location:history', HistoryLocation);\n container.register('location:none', NoneLocation);\n\n container.injection('controller', 'target', 'router:main');\n container.injection('controller', 'namespace', 'application:main');\n\n container.injection('route', 'router', 'router:main');\n container.injection('location', 'rootURL', '-location-setting:root-url');\n\n // DEBUGGING\n container.register('resolver-for-debugging:main', container.resolver.__resolver__, { instantiate: false });\n container.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main');\n container.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main');\n // Custom resolver authors may want to register their own ContainerDebugAdapter with this key\n\n // ES6TODO: resolve this via import once ember-application package is ES6'ed\n requireModule('ember-extension-support');\n container.register('container-debug-adapter:main', ContainerDebugAdapter);\n\n return container;\n }\n });\n\n /**\n This function defines the default lookup rules for container lookups:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after classifying the name.\n For example, `controller:post` looks up `App.PostController` by default.\n * if the default lookup fails, look for registered classes on the container\n\n This allows the application to register default injections in the container\n that could be overridden by the normal naming convention.\n\n @private\n @method resolverFor\n @param {Ember.Namespace} namespace the namespace to look for classes\n @return {*} the resolved value for a given lookup\n */\n function resolverFor(namespace) {\n if (namespace.get('resolver')) {\n Ember.deprecate('Application.resolver is deprecated in favor of Application.Resolver', false);\n }\n\n var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || DefaultResolver;\n var resolver = ResolverClass.create({\n namespace: namespace\n });\n\n function resolve(fullName) {\n return resolver.resolve(fullName);\n }\n\n resolve.describe = function(fullName) {\n return resolver.lookupDescription(fullName);\n };\n\n resolve.makeToString = function(factory, fullName) {\n return resolver.makeToString(factory, fullName);\n };\n\n resolve.normalize = function(fullName) {\n if (resolver.normalize) {\n return resolver.normalize(fullName);\n } else {\n Ember.deprecate('The Resolver should now provide a \\'normalize\\' function', false);\n return fullName;\n }\n };\n\n resolve.__resolver__ = resolver;\n\n return resolve;\n }\n\n __exports__[\"default\"] = Application;\n });\ndefine(\"ember-application/system/dag\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n function visit(vertex, fn, visited, path) {\n var name = vertex.name,\n vertices = vertex.incoming,\n names = vertex.incomingNames,\n len = names.length,\n i;\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n }\n\n function DAG() {\n this.names = [];\n this.vertices = {};\n }\n\n DAG.prototype.add = function(name) {\n if (!name) { return; }\n if (this.vertices.hasOwnProperty(name)) {\n return this.vertices[name];\n }\n var vertex = {\n name: name, incoming: {}, incomingNames: [], hasOutgoing: false, value: null\n };\n this.vertices[name] = vertex;\n this.names.push(name);\n return vertex;\n };\n\n DAG.prototype.map = function(name, value) {\n this.add(name).value = value;\n };\n\n DAG.prototype.addEdge = function(fromName, toName) {\n if (!fromName || !toName || fromName === toName) {\n return;\n }\n var from = this.add(fromName), to = this.add(toName);\n if (to.incoming.hasOwnProperty(fromName)) {\n return;\n }\n function checkCycle(vertex, path) {\n if (vertex.name === toName) {\n throw new EmberError(\"cycle detected: \" + toName + \" <- \" + path.join(\" <- \"));\n }\n }\n visit(from, checkCycle);\n from.hasOutgoing = true;\n to.incoming[fromName] = from;\n to.incomingNames.push(fromName);\n };\n\n DAG.prototype.topsort = function(fn) {\n var visited = {},\n vertices = this.vertices,\n names = this.names,\n len = names.length,\n i, vertex;\n for (i = 0; i < len; i++) {\n vertex = vertices[names[i]];\n if (!vertex.hasOutgoing) {\n visit(vertex, fn, visited);\n }\n }\n };\n\n DAG.prototype.addEdges = function(name, value, before, after) {\n var i;\n this.map(name, value);\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n for (i = 0; i < before.length; i++) {\n this.addEdge(name, before[i]);\n }\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n for (i = 0; i < after.length; i++) {\n this.addEdge(after[i], name);\n }\n }\n }\n };\n\n __exports__[\"default\"] = DAG;\n });\ndefine(\"ember-application/system/resolver\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/logger\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-runtime/system/namespace\",\"ember-handlebars\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-application\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.TEMPLATES, Ember.assert\n var get = __dependency2__.get;\n var Logger = __dependency3__[\"default\"];\n var classify = __dependency4__.classify;\n var capitalize = __dependency4__.capitalize;\n var decamelize = __dependency4__.decamelize;\n var EmberObject = __dependency5__[\"default\"];\n var Namespace = __dependency6__[\"default\"];\n var EmberHandlebars = __dependency7__[\"default\"];\n\n var Resolver = EmberObject.extend({\n /**\n This will be set to the Application instance when it is\n created.\n\n @property namespace\n */\n namespace: null,\n normalize: function(fullName) {\n throw new Error(\"Invalid call to `resolver.normalize(fullName)`. Please override the 'normalize' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n resolve: function(fullName) {\n throw new Error(\"Invalid call to `resolver.resolve(parsedName)`. Please override the 'resolve' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n parseName: function(parsedName) {\n throw new Error(\"Invalid call to `resolver.resolveByType(parsedName)`. Please override the 'resolveByType' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n lookupDescription: function(fullName) {\n throw new Error(\"Invalid call to `resolver.lookupDescription(fullName)`. Please override the 'lookupDescription' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n makeToString: function(factory, fullName) {\n throw new Error(\"Invalid call to `resolver.makeToString(factory, fullName)`. Please override the 'makeToString' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n resolveOther: function(parsedName) {\n throw new Error(\"Invalid call to `resolver.resolveOther(parsedName)`. Please override the 'resolveOther' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n },\n _logLookup: function(found, parsedName) {\n throw new Error(\"Invalid call to `resolver._logLookup(found, parsedName)`. Please override the '_logLookup' method in subclass of `Ember.Resolver` to prevent falling through to this error.\");\n }\n });\n\n\n\n /**\n The DefaultResolver defines the default lookup rules to resolve\n container lookups before consulting the container for registered\n items:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after converting\n the name. For example, `controller:post` looks up\n `App.PostController` by default.\n * there are some nuances (see examples below)\n\n ### How Resolving Works\n\n The container calls this object's `resolve` method with the\n `fullName` argument.\n\n It first parses the fullName into an object using `parseName`.\n\n Then it checks for the presence of a type-specific instance\n method of the form `resolve[Type]` and calls it if it exists.\n For example if it was resolving 'template:post', it would call\n the `resolveTemplate` method.\n\n Its last resort is to call the `resolveOther` method.\n\n The methods of this object are designed to be easy to override\n in a subclass. For example, you could enhance how a template\n is resolved like so:\n\n ```javascript\n App = Ember.Application.create({\n Resolver: Ember.DefaultResolver.extend({\n resolveTemplate: function(parsedName) {\n var resolvedTemplate = this._super(parsedName);\n if (resolvedTemplate) { return resolvedTemplate; }\n return Ember.TEMPLATES['not_found'];\n }\n })\n });\n ```\n\n Some examples of how names are resolved:\n\n ```\n 'template:post' //=> Ember.TEMPLATES['post']\n 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:blogPost' //=> Ember.TEMPLATES['blogPost']\n // OR\n // Ember.TEMPLATES['blog_post']\n 'controller:post' //=> App.PostController\n 'controller:posts.index' //=> App.PostsIndexController\n 'controller:blog/post' //=> Blog.PostController\n 'controller:basic' //=> Ember.Controller\n 'route:post' //=> App.PostRoute\n 'route:posts.index' //=> App.PostsIndexRoute\n 'route:blog/post' //=> Blog.PostRoute\n 'route:basic' //=> Ember.Route\n 'view:post' //=> App.PostView\n 'view:posts.index' //=> App.PostsIndexView\n 'view:blog/post' //=> Blog.PostView\n 'view:basic' //=> Ember.View\n 'foo:post' //=> App.PostFoo\n 'model:post' //=> App.Post\n ```\n\n @class DefaultResolver\n @namespace Ember\n @extends Ember.Object\n */\n var DefaultResolver = EmberObject.extend({\n /**\n This will be set to the Application instance when it is\n created.\n\n @property namespace\n */\n namespace: null,\n\n normalize: function(fullName) {\n var split = fullName.split(':', 2),\n type = split[0],\n name = split[1];\n\n Ember.assert(\"Tried to normalize a container name without a colon (:) in it. You probably tried to lookup a name that did not contain a type, a colon, and a name. A proper lookup name would be `view:post`.\", split.length === 2);\n\n if (type !== 'template') {\n var result = name;\n\n if (result.indexOf('.') > -1) {\n result = result.replace(/\\.(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n if (name.indexOf('_') > -1) {\n result = result.replace(/_(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n return type + ':' + result;\n } else {\n return fullName;\n }\n },\n\n\n /**\n This method is called via the container's resolver method.\n It parses the provided `fullName` and then looks up and\n returns the appropriate template or class.\n\n @method resolve\n @param {String} fullName the lookup string\n @return {Object} the resolved factory\n */\n resolve: function(fullName) {\n var parsedName = this.parseName(fullName),\n resolveMethodName = parsedName.resolveMethodName,\n resolved;\n\n if (!(parsedName.name && parsedName.type)) {\n throw new TypeError(\"Invalid fullName: `\" + fullName + \"`, must be of the form `type:name` \");\n }\n\n if (this[resolveMethodName]) {\n resolved = this[resolveMethodName](parsedName);\n }\n\n if (!resolved) {\n resolved = this.resolveOther(parsedName);\n }\n\n if (parsedName.root && parsedName.root.LOG_RESOLVER) {\n this._logLookup(resolved, parsedName);\n }\n\n return resolved;\n },\n /**\n Convert the string name of the form \"type:name\" to\n a Javascript object with the parsed aspects of the name\n broken out.\n\n @protected\n @param {String} fullName the lookup string\n @method parseName\n */\n parseName: function(fullName) {\n var nameParts = fullName.split(\":\"),\n type = nameParts[0], fullNameWithoutType = nameParts[1],\n name = fullNameWithoutType,\n namespace = get(this, 'namespace'),\n root = namespace;\n\n if (type !== 'template' && name.indexOf('/') !== -1) {\n var parts = name.split('/');\n name = parts[parts.length - 1];\n var namespaceName = capitalize(parts.slice(0, -1).join('.'));\n root = Namespace.byName(namespaceName);\n\n Ember.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root);\n }\n\n return {\n fullName: fullName,\n type: type,\n fullNameWithoutType: fullNameWithoutType,\n name: name,\n root: root,\n resolveMethodName: \"resolve\" + classify(type)\n };\n },\n\n /**\n Returns a human-readable description for a fullName. Used by the\n Application namespace in assertions to describe the\n precise name of the class that Ember is looking for, rather than\n container keys.\n\n @protected\n @param {String} fullName the lookup string\n @method lookupDescription\n */\n lookupDescription: function(fullName) {\n var parsedName = this.parseName(fullName);\n\n if (parsedName.type === 'template') {\n return \"template at \" + parsedName.fullNameWithoutType.replace(/\\./g, '/');\n }\n\n var description = parsedName.root + \".\" + classify(parsedName.name);\n if (parsedName.type !== 'model') { description += classify(parsedName.type); }\n\n return description;\n },\n\n makeToString: function(factory, fullName) {\n return factory.toString();\n },\n /**\n Given a parseName object (output from `parseName`), apply\n the conventions expected by `Ember.Router`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method useRouterNaming\n */\n useRouterNaming: function(parsedName) {\n parsedName.name = parsedName.name.replace(/\\./g, '_');\n if (parsedName.name === 'basic') {\n parsedName.name = '';\n }\n },\n /**\n Look up the template in Ember.TEMPLATES\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveTemplate\n */\n resolveTemplate: function(parsedName) {\n var templateName = parsedName.fullNameWithoutType.replace(/\\./g, '/');\n\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n\n templateName = decamelize(templateName);\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n },\n /**\n Lookup the view using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveView\n */\n resolveView: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the controller using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveController\n */\n resolveController: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the route using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveRoute\n */\n resolveRoute: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n\n /**\n Lookup the model on the Application namespace\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveModel\n */\n resolveModel: function(parsedName) {\n var className = classify(parsedName.name),\n factory = get(parsedName.root, className);\n\n if (factory) { return factory; }\n },\n /**\n Look up the specified object (from parsedName) on the appropriate\n namespace (usually on the Application)\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveHelper\n */\n resolveHelper: function(parsedName) {\n return this.resolveOther(parsedName) || EmberHandlebars.helpers[parsedName.fullNameWithoutType];\n },\n /**\n Look up the specified object (from parsedName) on the appropriate\n namespace (usually on the Application)\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveOther\n */\n resolveOther: function(parsedName) {\n var className = classify(parsedName.name) + classify(parsedName.type),\n factory = get(parsedName.root, className);\n if (factory) { return factory; }\n },\n\n /**\n @method _logLookup\n @param {Boolean} found\n @param {Object} parsedName\n @private\n */\n _logLookup: function(found, parsedName) {\n var symbol, padding;\n\n if (found) { symbol = '[✓]'; }\n else { symbol = '[ ]'; }\n\n if (parsedName.fullName.length > 60) {\n padding = '.';\n } else {\n padding = new Array(60 - parsedName.fullName.length).join('.');\n }\n\n Logger.info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName));\n }\n });\n\n __exports__.Resolver = Resolver;\n __exports__.DefaultResolver = DefaultResolver;\n });\n})();\n//@ sourceURL=ember-application");minispade.register('ember-debug', "(function() {define(\"ember-debug\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/logger\"],\n function(__dependency1__, __dependency2__, __dependency3__) {\n \"use strict\";\n /*global __fail__*/\n\n var Ember = __dependency1__[\"default\"];\n var EmberError = __dependency2__[\"default\"];\n var Logger = __dependency3__[\"default\"];\n\n /**\n Ember Debug\n\n @module ember\n @submodule ember-debug\n */\n\n /**\n @class Ember\n */\n\n /**\n Define an assertion that will throw an exception if the condition is not\n met. Ember build tools will remove any calls to `Ember.assert()` when\n doing a production build. Example:\n\n ```javascript\n // Test for truthiness\n Ember.assert('Must pass a valid object', obj);\n\n // Fail unconditionally\n Ember.assert('This code path should never be run');\n ```\n\n @method assert\n @param {String} desc A description of the assertion. This will become\n the text of the Error thrown if the assertion fails.\n @param {Boolean} test Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.\n */\n Ember.assert = function(desc, test) {\n if (!test) {\n throw new EmberError(\"Assertion Failed: \" + desc);\n }\n };\n\n\n /**\n Display a warning with the provided message. Ember build tools will\n remove any calls to `Ember.warn()` when doing a production build.\n\n @method warn\n @param {String} message A warning to display.\n @param {Boolean} test An optional boolean. If falsy, the warning\n will be displayed.\n */\n Ember.warn = function(message, test) {\n if (!test) {\n Logger.warn(\"WARNING: \"+message);\n if ('trace' in Logger) Logger.trace();\n }\n };\n\n /**\n Display a debug notice. Ember build tools will remove any calls to\n `Ember.debug()` when doing a production build.\n\n ```javascript\n Ember.debug('I\\'m a debug notice!');\n ```\n\n @method debug\n @param {String} message A debug message to display.\n */\n Ember.debug = function(message) {\n Logger.debug(\"DEBUG: \"+message);\n };\n\n /**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only). Ember build tools will remove any calls to\n `Ember.deprecate()` when doing a production build.\n\n @method deprecate\n @param {String} message A description of the deprecation.\n @param {Boolean} test An optional boolean. If falsy, the deprecation\n will be displayed.\n */\n Ember.deprecate = function(message, test) {\n if (test) { return; }\n\n if (Ember.ENV.RAISE_ON_DEPRECATION) { throw new EmberError(message); }\n\n var error;\n\n // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome\n try { __fail__.fail(); } catch (e) { error = e; }\n\n if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {\n var stack, stackStr = '';\n if (error['arguments']) {\n // Chrome\n stack = error.stack.replace(/^\\s+at\\s+/gm, '').\n replace(/^([^\\(]+?)([\\n$])/gm, '{anonymous}($1)$2').\n replace(/^Object.<anonymous>\\s*\\(([^\\)]+)\\)/gm, '{anonymous}($1)').split('\\n');\n stack.shift();\n } else {\n // Firefox\n stack = error.stack.replace(/(?:\\n@:0)?\\s+$/m, '').\n replace(/^\\(/gm, '{anonymous}(').split('\\n');\n }\n\n stackStr = \"\\n \" + stack.slice(2).join(\"\\n \");\n message = message + stackStr;\n }\n\n Logger.warn(\"DEPRECATION: \"+message);\n };\n\n\n\n /**\n Alias an old, deprecated method with its new counterpart.\n\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only) when the assigned method is called.\n\n Ember build tools will not remove calls to `Ember.deprecateFunc()`, though\n no warnings will be shown in production.\n\n ```javascript\n Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);\n ```\n\n @method deprecateFunc\n @param {String} message A description of the deprecation.\n @param {Function} func The new function called to replace its deprecated counterpart.\n @return {Function} a new function that wrapped the original function with a deprecation warning\n */\n Ember.deprecateFunc = function(message, func) {\n return function() {\n Ember.deprecate(message);\n return func.apply(this, arguments);\n };\n };\n\n\n /**\n Run a function meant for debugging. Ember build tools will remove any calls to\n `Ember.runInDebug()` when doing a production build.\n\n ```javascript\n Ember.runInDebug(function() {\n Ember.Handlebars.EachView.reopen({\n didInsertElement: function() {\n console.log('I\\'m happy');\n }\n });\n });\n ```\n\n @method runInDebug\n @param {Function} func The function to be executed.\n @since 1.5.0\n */\n Ember.runInDebug = function(func) {\n func()\n };\n\n // Inform the developer about the Ember Inspector if not installed.\n if (!Ember.testing) {\n var isFirefox = typeof InstallTrigger !== 'undefined';\n var isChrome = !!window.chrome && !window.opera;\n\n if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) {\n window.addEventListener(\"load\", function() {\n if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) {\n var downloadURL;\n\n if(isChrome) {\n downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi';\n } else if(isFirefox) {\n downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';\n }\n\n Ember.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL);\n }\n }, false);\n }\n }\n });\n})();\n//@ sourceURL=ember-debug");minispade.register('ember-extension-support', "(function() {minispade.require(\"ember-application\");\ndefine(\"ember-extension-support/container_debug_adapter\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-runtime/system/string\",\"ember-runtime/system/namespace\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var typeOf = __dependency2__.typeOf;\n var dasherize = __dependency3__.dasherize;\n var classify = __dependency3__.classify;\n var Namespace = __dependency4__[\"default\"];\n var EmberObject = __dependency5__[\"default\"];\n\n /**\n @module ember\n @submodule ember-extension-support\n */\n\n /**\n The `ContainerDebugAdapter` helps the container and resolver interface\n with tools that debug Ember such as the\n [Ember Extension](https://github.com/tildeio/ember-extension)\n for Chrome and Firefox.\n\n This class can be extended by a custom resolver implementer\n to override some of the methods with library-specific code.\n\n The methods likely to be overridden are:\n\n * `canCatalogEntriesByType`\n * `catalogEntriesByType`\n\n The adapter will need to be registered\n in the application's container as `container-debug-adapter:main`\n\n Example:\n\n ```javascript\n Application.initializer({\n name: \"containerDebugAdapter\",\n\n initialize: function(container, application) {\n application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n }\n });\n ```\n\n @class ContainerDebugAdapter\n @namespace Ember\n @extends EmberObject\n @since 1.5.0\n */\n var ContainerDebugAdapter = EmberObject.extend({\n /**\n The container of the application being debugged.\n This property will be injected\n on creation.\n\n @property container\n @default null\n */\n container: null,\n\n /**\n The resolver instance of the application\n being debugged. This property will be injected\n on creation.\n\n @property resolver\n @default null\n */\n resolver: null,\n\n /**\n Returns true if it is possible to catalog a list of available\n classes in the resolver for a given type.\n\n @method canCatalogEntriesByType\n @param {string} type The type. e.g. \"model\", \"controller\", \"route\"\n @return {boolean} whether a list is available for this type.\n */\n canCatalogEntriesByType: function(type) {\n if (type === 'model' || type === 'template') return false;\n return true;\n },\n\n /**\n Returns the available classes a given type.\n\n @method catalogEntriesByType\n @param {string} type The type. e.g. \"model\", \"controller\", \"route\"\n @return {Array} An array of strings.\n */\n catalogEntriesByType: function(type) {\n var namespaces = Ember.A(Namespace.NAMESPACES), types = Ember.A(), self = this;\n var typeSuffixRegex = new RegExp(classify(type) + \"$\");\n\n namespaces.forEach(function(namespace) {\n if (namespace !== Ember) {\n for (var key in namespace) {\n if (!namespace.hasOwnProperty(key)) { continue; }\n if (typeSuffixRegex.test(key)) {\n var klass = namespace[key];\n if (typeOf(klass) === 'class') {\n types.push(dasherize(key.replace(typeSuffixRegex, '')));\n }\n }\n }\n }\n });\n return types;\n }\n });\n\n __exports__[\"default\"] = ContainerDebugAdapter;\n });\ndefine(\"ember-extension-support/data_adapter\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/run_loop\",\"ember-runtime/system/string\",\"ember-runtime/system/namespace\",\"ember-runtime/system/object\",\"ember-runtime/system/native_array\",\"ember-application/system/application\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var run = __dependency3__[\"default\"];\n var dasherize = __dependency4__.dasherize;\n var Namespace = __dependency5__[\"default\"];\n var EmberObject = __dependency6__[\"default\"];\n var A = __dependency7__.A;\n var Application = __dependency8__[\"default\"];\n\n /**\n @module ember\n @submodule ember-extension-support\n */\n\n /**\n The `DataAdapter` helps a data persistence library\n interface with tools that debug Ember such\n as the [Ember Extension](https://github.com/tildeio/ember-extension)\n for Chrome and Firefox.\n\n This class will be extended by a persistence library\n which will override some of the methods with\n library-specific code.\n\n The methods likely to be overridden are:\n\n * `getFilters`\n * `detect`\n * `columnsForType`\n * `getRecords`\n * `getRecordColumnValues`\n * `getRecordKeywords`\n * `getRecordFilterValues`\n * `getRecordColor`\n * `observeRecord`\n\n The adapter will need to be registered\n in the application's container as `dataAdapter:main`\n\n Example:\n\n ```javascript\n Application.initializer({\n name: \"data-adapter\",\n\n initialize: function(container, application) {\n application.register('data-adapter:main', DS.DataAdapter);\n }\n });\n ```\n\n @class DataAdapter\n @namespace Ember\n @extends EmberObject\n */\n var DataAdapter = EmberObject.extend({\n init: function() {\n this._super();\n this.releaseMethods = A();\n },\n\n /**\n The container of the application being debugged.\n This property will be injected\n on creation.\n\n @property container\n @default null\n @since 1.3.0\n */\n container: null,\n\n\n /**\n The container-debug-adapter which is used\n to list all models.\n\n @property containerDebugAdapter\n @default undefined\n @since 1.5.0\n **/\n containerDebugAdapter: undefined,\n\n /**\n Number of attributes to send\n as columns. (Enough to make the record\n identifiable).\n\n @private\n @property attributeLimit\n @default 3\n @since 1.3.0\n */\n attributeLimit: 3,\n\n /**\n Stores all methods that clear observers.\n These methods will be called on destruction.\n\n @private\n @property releaseMethods\n @since 1.3.0\n */\n releaseMethods: A(),\n\n /**\n Specifies how records can be filtered.\n Records returned will need to have a `filterValues`\n property with a key for every name in the returned array.\n\n @public\n @method getFilters\n @return {Array} List of objects defining filters.\n The object should have a `name` and `desc` property.\n */\n getFilters: function() {\n return A();\n },\n\n /**\n Fetch the model types and observe them for changes.\n\n @public\n @method watchModelTypes\n\n @param {Function} typesAdded Callback to call to add types.\n Takes an array of objects containing wrapped types (returned from `wrapModelType`).\n\n @param {Function} typesUpdated Callback to call when a type has changed.\n Takes an array of objects containing wrapped types.\n\n @return {Function} Method to call to remove all observers\n */\n watchModelTypes: function(typesAdded, typesUpdated) {\n var modelTypes = this.getModelTypes(),\n self = this, typesToSend, releaseMethods = A();\n\n typesToSend = modelTypes.map(function(type) {\n var klass = type.klass;\n var wrapped = self.wrapModelType(klass, type.name);\n releaseMethods.push(self.observeModelType(klass, typesUpdated));\n return wrapped;\n });\n\n typesAdded(typesToSend);\n\n var release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n self.releaseMethods.removeObject(release);\n };\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n _nameToClass: function(type) {\n if (typeof type === 'string') {\n type = this.container.lookupFactory('model:' + type);\n }\n return type;\n },\n\n /**\n Fetch the records of a given type and observe them for changes.\n\n @public\n @method watchRecords\n\n @param {Function} recordsAdded Callback to call to add records.\n Takes an array of objects containing wrapped records.\n The object should have the following properties:\n columnValues: {Object} key and value of a table cell\n object: {Object} the actual record object\n\n @param {Function} recordsUpdated Callback to call when a record has changed.\n Takes an array of objects containing wrapped records.\n\n @param {Function} recordsRemoved Callback to call when a record has removed.\n Takes the following parameters:\n index: the array index where the records were removed\n count: the number of records removed\n\n @return {Function} Method to call to remove all observers\n */\n watchRecords: function(type, recordsAdded, recordsUpdated, recordsRemoved) {\n var self = this, releaseMethods = A(), records = this.getRecords(type), release;\n\n var recordUpdated = function(updatedRecord) {\n recordsUpdated([updatedRecord]);\n };\n\n var recordsToSend = records.map(function(record) {\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n return self.wrapRecord(record);\n });\n\n\n var contentDidChange = function(array, idx, removedCount, addedCount) {\n for (var i = idx; i < idx + addedCount; i++) {\n var record = array.objectAt(i);\n var wrapped = self.wrapRecord(record);\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n recordsAdded([wrapped]);\n }\n\n if (removedCount) {\n recordsRemoved(idx, removedCount);\n }\n };\n\n var observer = { didChange: contentDidChange, willChange: Ember.K };\n records.addArrayObserver(self, observer);\n\n release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n records.removeArrayObserver(self, observer);\n self.releaseMethods.removeObject(release);\n };\n\n recordsAdded(recordsToSend);\n\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n /**\n Clear all observers before destruction\n @private\n @method willDestroy\n */\n willDestroy: function() {\n this._super();\n this.releaseMethods.forEach(function(fn) {\n fn();\n });\n },\n\n /**\n Detect whether a class is a model.\n\n Test that against the model class\n of your persistence library\n\n @private\n @method detect\n @param {Class} klass The class to test\n @return boolean Whether the class is a model class or not\n */\n detect: function(klass) {\n return false;\n },\n\n /**\n Get the columns for a given model type.\n\n @private\n @method columnsForType\n @param {Class} type The model type\n @return {Array} An array of columns of the following format:\n name: {String} name of the column\n desc: {String} Humanized description (what would show in a table column name)\n */\n columnsForType: function(type) {\n return A();\n },\n\n /**\n Adds observers to a model type class.\n\n @private\n @method observeModelType\n @param {Class} type The model type class\n @param {Function} typesUpdated Called when a type is modified.\n @return {Function} The function to call to remove observers\n */\n\n observeModelType: function(type, typesUpdated) {\n var self = this, records = this.getRecords(type);\n\n var onChange = function() {\n typesUpdated([self.wrapModelType(type)]);\n };\n var observer = {\n didChange: function() {\n run.scheduleOnce('actions', this, onChange);\n },\n willChange: Ember.K\n };\n\n records.addArrayObserver(this, observer);\n\n var release = function() {\n records.removeArrayObserver(self, observer);\n };\n\n return release;\n },\n\n\n /**\n Wraps a given model type and observes changes to it.\n\n @private\n @method wrapModelType\n @param {Class} type A model class\n @param {String} Optional name of the class\n @return {Object} contains the wrapped type and the function to remove observers\n Format:\n type: {Object} the wrapped type\n The wrapped type has the following format:\n name: {String} name of the type\n count: {Integer} number of records available\n columns: {Columns} array of columns to describe the record\n object: {Class} the actual Model type class\n release: {Function} The function to remove observers\n */\n wrapModelType: function(type, name) {\n var release, records = this.getRecords(type),\n typeToSend, self = this;\n\n typeToSend = {\n name: name || type.toString(),\n count: get(records, 'length'),\n columns: this.columnsForType(type),\n object: type\n };\n\n\n return typeToSend;\n },\n\n\n /**\n Fetches all models defined in the application.\n\n @private\n @method getModelTypes\n @return {Array} Array of model types\n */\n getModelTypes: function() {\n var types, self = this,\n containerDebugAdapter = this.get('containerDebugAdapter');\n\n if (containerDebugAdapter.canCatalogEntriesByType('model')) {\n types = containerDebugAdapter.catalogEntriesByType('model');\n } else {\n types = this._getObjectsOnNamespaces();\n }\n\n // New adapters return strings instead of classes\n types = A(types).map(function(name) {\n return {\n klass: self._nameToClass(name),\n name: name\n };\n });\n types = A(types).filter(function(type) {\n return self.detect(type.klass);\n });\n\n return A(types);\n },\n\n /**\n Loops over all namespaces and all objects\n attached to them\n\n @private\n @method _getObjectsOnNamespaces\n @return {Array} Array of model type strings\n */\n _getObjectsOnNamespaces: function() {\n var namespaces = A(Namespace.NAMESPACES),\n types = A(),\n self = this;\n\n namespaces.forEach(function(namespace) {\n for (var key in namespace) {\n if (!namespace.hasOwnProperty(key)) { continue; }\n // Even though we will filter again in `getModelTypes`,\n // we should not call `lookupContainer` on non-models\n // (especially when `Ember.MODEL_FACTORY_INJECTIONS` is `true`)\n if (!self.detect(namespace[key])) { continue; }\n var name = dasherize(key);\n if (!(namespace instanceof Application) && namespace.toString()) {\n name = namespace + '/' + name;\n }\n types.push(name);\n }\n });\n return types;\n },\n\n /**\n Fetches all loaded records for a given type.\n\n @private\n @method getRecords\n @return {Array} An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.\n */\n getRecords: function(type) {\n return A();\n },\n\n /**\n Wraps a record and observers changes to it.\n\n @private\n @method wrapRecord\n @param {Object} record The record instance.\n @return {Object} The wrapped record. Format:\n columnValues: {Array}\n searchKeywords: {Array}\n */\n wrapRecord: function(record) {\n var recordToSend = { object: record }, columnValues = {}, self = this;\n\n recordToSend.columnValues = this.getRecordColumnValues(record);\n recordToSend.searchKeywords = this.getRecordKeywords(record);\n recordToSend.filterValues = this.getRecordFilterValues(record);\n recordToSend.color = this.getRecordColor(record);\n\n return recordToSend;\n },\n\n /**\n Gets the values for each column.\n\n @private\n @method getRecordColumnValues\n @return {Object} Keys should match column names defined\n by the model type.\n */\n getRecordColumnValues: function(record) {\n return {};\n },\n\n /**\n Returns keywords to match when searching records.\n\n @private\n @method getRecordKeywords\n @return {Array} Relevant keywords for search.\n */\n getRecordKeywords: function(record) {\n return A();\n },\n\n /**\n Returns the values of filters defined by `getFilters`.\n\n @private\n @method getRecordFilterValues\n @param {Object} record The record instance\n @return {Object} The filter values\n */\n getRecordFilterValues: function(record) {\n return {};\n },\n\n /**\n Each record can have a color that represents its state.\n\n @private\n @method getRecordColor\n @param {Object} record The record instance\n @return {String} The record's color\n Possible options: black, red, blue, green\n */\n getRecordColor: function(record) {\n return null;\n },\n\n /**\n Observes all relevant properties and re-sends the wrapped record\n when a change occurs.\n\n @private\n @method observerRecord\n @param {Object} record The record instance\n @param {Function} recordUpdated The callback to call when a record is updated.\n @return {Function} The function to call to remove all observers.\n */\n observeRecord: function(record, recordUpdated) {\n return function(){};\n }\n\n });\n\n __exports__[\"default\"] = DataAdapter;\n });\ndefine(\"ember-extension-support/initializers\",\n [],\n function() {\n \"use strict\";\n\n });\ndefine(\"ember-extension-support\",\n [\"ember-metal/core\",\"ember-extension-support/data_adapter\",\"ember-extension-support/container_debug_adapter\"],\n function(__dependency1__, __dependency2__, __dependency3__) {\n \"use strict\";\n /**\n Ember Extension Support\n\n @module ember\n @submodule ember-extension-support\n @requires ember-application\n */\n\n var Ember = __dependency1__[\"default\"];\n var DataAdapter = __dependency2__[\"default\"];\n var ContainerDebugAdapter = __dependency3__[\"default\"];\n\n Ember.DataAdapter = DataAdapter;\n Ember.ContainerDebugAdapter = ContainerDebugAdapter;\n });\n})();\n//@ sourceURL=ember-extension-support");minispade.register('ember-handlebars-compiler', "(function() {minispade.require(\"ember-views\");\ndefine(\"ember-handlebars-compiler\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars-compiler\n */\n\n var Ember = __dependency1__[\"default\"];\n\n // ES6Todo: you'll need to import debugger once debugger is es6'd.\n if (typeof Ember.assert === 'undefined') { Ember.assert = function(){}; };\n if (typeof Ember.FEATURES === 'undefined') { Ember.FEATURES = { isEnabled: function(){} }; };\n\n var objectCreate = Object.create || function(parent) {\n function F() {}\n F.prototype = parent;\n return new F();\n };\n\n // set up for circular references later\n var View, Component;\n\n // ES6Todo: when ember-debug is es6'ed import this.\n // var emberAssert = Ember.assert;\n var Handlebars = (Ember.imports && Ember.imports.Handlebars) || (this && this.Handlebars);\n if (!Handlebars && typeof require === 'function') {\n Handlebars = require('handlebars');\n }\n\n Ember.assert(\"Ember Handlebars requires Handlebars version 1.0 or 1.1. Include \" +\n \"a SCRIPT tag in the HTML HEAD linking to the Handlebars file \" +\n \"before you link to Ember.\", Handlebars);\n\n Ember.assert(\"Ember Handlebars requires Handlebars version 1.0 or 1.1, \" +\n \"COMPILER_REVISION expected: 4, got: \" + Handlebars.COMPILER_REVISION +\n \" - Please note: Builds of master may have other COMPILER_REVISION values.\",\n Handlebars.COMPILER_REVISION === 4);\n\n /**\n Prepares the Handlebars templating library for use inside Ember's view\n system.\n\n The `Ember.Handlebars` object is the standard Handlebars library, extended to\n use Ember's `get()` method instead of direct property access, which allows\n computed properties to be used inside templates.\n\n To create an `Ember.Handlebars` template, call `Ember.Handlebars.compile()`.\n This will return a function that can be used by `Ember.View` for rendering.\n\n @class Handlebars\n @namespace Ember\n */\n var EmberHandlebars = Ember.Handlebars = objectCreate(Handlebars);\n\n /**\n Register a bound helper or custom view helper.\n\n ## Simple bound helper example\n\n ```javascript\n Ember.Handlebars.helper('capitalize', function(value) {\n return value.toUpperCase();\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n For more examples of bound helpers, see documentation for\n `Ember.Handlebars.registerBoundHelper`.\n\n ## Custom view helper example\n\n Assuming a view subclass named `App.CalendarView` were defined, a helper\n for rendering instances of this view could be registered as follows:\n\n ```javascript\n Ember.Handlebars.helper('calendar', App.CalendarView):\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{calendar}}\n ```\n\n Which is functionally equivalent to:\n\n ```handlebars\n {{view App.CalendarView}}\n ```\n\n Options in the helper will be passed to the view in exactly the same\n manner as with the `view` helper.\n\n @method helper\n @for Ember.Handlebars\n @param {String} name\n @param {Function|Ember.View} function or view class constructor\n @param {String} dependentKeys*\n */\n EmberHandlebars.helper = function(name, value) {\n if (!View) { View = requireModule('ember-views/views/view')['View']; } // ES6TODO: stupid circular dep\n if (!Component) { Component = requireModule('ember-views/views/component')['default']; } // ES6TODO: stupid circular dep\n\n Ember.assert(\"You tried to register a component named '\" + name + \"', but component names must include a '-'\", !Component.detect(value) || name.match(/-/));\n\n if (View.detect(value)) {\n EmberHandlebars.registerHelper(name, EmberHandlebars.makeViewHelper(value));\n } else {\n EmberHandlebars.registerBoundHelper.apply(null, arguments);\n }\n };\n\n /**\n Returns a helper function that renders the provided ViewClass.\n\n Used internally by Ember.Handlebars.helper and other methods\n involving helper/component registration.\n\n @private\n @method makeViewHelper\n @for Ember.Handlebars\n @param {Function} ViewClass view class constructor\n @since 1.2.0\n */\n EmberHandlebars.makeViewHelper = function(ViewClass) {\n return function(options) {\n Ember.assert(\"You can only pass attributes (such as name=value) not bare values to a helper for a View found in '\" + ViewClass.toString() + \"'\", arguments.length < 2);\n return EmberHandlebars.helpers.view.call(this, ViewClass, options);\n };\n };\n\n /**\n @class helpers\n @namespace Ember.Handlebars\n */\n EmberHandlebars.helpers = objectCreate(Handlebars.helpers);\n\n /**\n Override the the opcode compiler and JavaScript compiler for Handlebars.\n\n @class Compiler\n @namespace Ember.Handlebars\n @private\n @constructor\n */\n EmberHandlebars.Compiler = function() {};\n\n // Handlebars.Compiler doesn't exist in runtime-only\n if (Handlebars.Compiler) {\n EmberHandlebars.Compiler.prototype = objectCreate(Handlebars.Compiler.prototype);\n }\n\n EmberHandlebars.Compiler.prototype.compiler = EmberHandlebars.Compiler;\n\n /**\n @class JavaScriptCompiler\n @namespace Ember.Handlebars\n @private\n @constructor\n */\n EmberHandlebars.JavaScriptCompiler = function() {};\n\n // Handlebars.JavaScriptCompiler doesn't exist in runtime-only\n if (Handlebars.JavaScriptCompiler) {\n EmberHandlebars.JavaScriptCompiler.prototype = objectCreate(Handlebars.JavaScriptCompiler.prototype);\n EmberHandlebars.JavaScriptCompiler.prototype.compiler = EmberHandlebars.JavaScriptCompiler;\n }\n\n\n EmberHandlebars.JavaScriptCompiler.prototype.namespace = \"Ember.Handlebars\";\n\n EmberHandlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {\n return \"''\";\n };\n\n /**\n Override the default buffer for Ember Handlebars. By default, Handlebars\n creates an empty String at the beginning of each invocation and appends to\n it. Ember's Handlebars overrides this to append to a single shared buffer.\n\n @private\n @method appendToBuffer\n @param string {String}\n */\n EmberHandlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {\n return \"data.buffer.push(\"+string+\");\";\n };\n\n // Hacks ahead:\n // Handlebars presently has a bug where the `blockHelperMissing` hook\n // doesn't get passed the name of the missing helper name, but rather\n // gets passed the value of that missing helper evaluated on the current\n // context, which is most likely `undefined` and totally useless.\n //\n // So we alter the compiled template function to pass the name of the helper\n // instead, as expected.\n //\n // This can go away once the following is closed:\n // https://github.com/wycats/handlebars.js/issues/634\n\n var DOT_LOOKUP_REGEX = /helpers\\.(.*?)\\)/,\n BRACKET_STRING_LOOKUP_REGEX = /helpers\\['(.*?)'/,\n INVOCATION_SPLITTING_REGEX = /(.*blockHelperMissing\\.call\\(.*)(stack[0-9]+)(,.*)/;\n\n EmberHandlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation = function(source) {\n var helperInvocation = source[source.length - 1],\n helperName = (DOT_LOOKUP_REGEX.exec(helperInvocation) || BRACKET_STRING_LOOKUP_REGEX.exec(helperInvocation))[1],\n matches = INVOCATION_SPLITTING_REGEX.exec(helperInvocation);\n\n source[source.length - 1] = matches[1] + \"'\" + helperName + \"'\" + matches[3];\n };\n\n var stringifyBlockHelperMissing = EmberHandlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation;\n\n var originalBlockValue = EmberHandlebars.JavaScriptCompiler.prototype.blockValue;\n EmberHandlebars.JavaScriptCompiler.prototype.blockValue = function() {\n originalBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\n };\n\n var originalAmbiguousBlockValue = EmberHandlebars.JavaScriptCompiler.prototype.ambiguousBlockValue;\n EmberHandlebars.JavaScriptCompiler.prototype.ambiguousBlockValue = function() {\n originalAmbiguousBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\n };\n\n /**\n Rewrite simple mustaches from `{{foo}}` to `{{bind \"foo\"}}`. This means that\n all simple mustaches in Ember's Handlebars will also set up an observer to\n keep the DOM up to date when the underlying property changes.\n\n @private\n @method mustache\n @for Ember.Handlebars.Compiler\n @param mustache\n */\n EmberHandlebars.Compiler.prototype.mustache = function(mustache) {\n if (!(mustache.params.length || mustache.hash)) {\n var id = new Handlebars.AST.IdNode([{ part: '_triageMustache' }]);\n\n // Update the mustache node to include a hash value indicating whether the original node\n // was escaped. This will allow us to properly escape values when the underlying value\n // changes and we need to re-render the value.\n if (!mustache.escaped) {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"unescaped\", new Handlebars.AST.StringNode(\"true\")]);\n }\n mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);\n }\n\n return Handlebars.Compiler.prototype.mustache.call(this, mustache);\n };\n\n /**\n Used for precompilation of Ember Handlebars templates. This will not be used\n during normal app execution.\n\n @method precompile\n @for Ember.Handlebars\n @static\n @param {String} string The template to precompile\n @param {Boolean} asObject optional parameter, defaulting to true, of whether or not the\n compiled template should be returned as an Object or a String\n */\n EmberHandlebars.precompile = function(string, asObject) {\n var ast = Handlebars.parse(string);\n\n var options = {\n knownHelpers: {\n action: true,\n unbound: true,\n 'bind-attr': true,\n template: true,\n view: true,\n _triageMustache: true\n },\n data: true,\n stringParams: true\n };\n\n asObject = asObject === undefined ? true : asObject;\n\n var environment = new EmberHandlebars.Compiler().compile(ast, options);\n return new EmberHandlebars.JavaScriptCompiler().compile(environment, options, undefined, asObject);\n };\n\n // We don't support this for Handlebars runtime-only\n if (Handlebars.compile) {\n /**\n The entry point for Ember Handlebars. This replaces the default\n `Handlebars.compile` and turns on template-local data and String\n parameters.\n\n @method compile\n @for Ember.Handlebars\n @static\n @param {String} string The template to compile\n @return {Function}\n */\n EmberHandlebars.compile = function(string) {\n var ast = Handlebars.parse(string);\n var options = { data: true, stringParams: true };\n var environment = new EmberHandlebars.Compiler().compile(ast, options);\n var templateSpec = new EmberHandlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n\n var template = EmberHandlebars.template(templateSpec);\n template.isMethod = false; //Make sure we don't wrap templates with ._super\n\n return template;\n };\n }\n\n __exports__[\"default\"] = EmberHandlebars;\n });\n})();\n//@ sourceURL=ember-handlebars-compiler");minispade.register('ember-handlebars', "(function() {minispade.require(\"ember-handlebars-compiler\");\nminispade.require(\"ember-views\");\nminispade.require(\"metamorph\");\ndefine(\"ember-handlebars/component_lookup\",\n [\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var EmberObject = __dependency1__[\"default\"];\n\n var ComponentLookup = EmberObject.extend({\n lookupFactory: function(name, container) {\n\n container = container || this.container;\n\n var fullName = 'component:' + name,\n templateFullName = 'template:components/' + name,\n templateRegistered = container && container.has(templateFullName);\n\n if (templateRegistered) {\n container.injection(fullName, 'layout', templateFullName);\n }\n\n var Component = container.lookupFactory(fullName);\n\n // Only treat as a component if either the component\n // or a template has been registered.\n if (templateRegistered || Component) {\n if (!Component) {\n container.register(fullName, Ember.Component);\n Component = container.lookupFactory(fullName);\n }\n return Component;\n }\n }\n });\n\n __exports__[\"default\"] = ComponentLookup;\n });\ndefine(\"ember-handlebars/controls\",\n [\"ember-handlebars/controls/checkbox\",\"ember-handlebars/controls/text_field\",\"ember-handlebars/controls/text_area\",\"ember-metal/core\",\"ember-handlebars-compiler\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Checkbox = __dependency1__[\"default\"];\n var TextField = __dependency2__[\"default\"];\n var TextArea = __dependency3__[\"default\"];\n\n var Ember = __dependency4__[\"default\"];\n // Ember.assert\n // var emberAssert = Ember.assert;\n\n var EmberHandlebars = __dependency5__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n /**\n @module ember\n @submodule ember-handlebars-compiler\n */\n\n /**\n\n The `{{input}}` helper inserts an HTML `<input>` tag into the template,\n with a `type` value of either `text` or `checkbox`. If no `type` is provided,\n `text` will be the default value applied. The attributes of `{{input}}`\n match those of the native HTML tag as closely as possible for these two types.\n\n ## Use as text field\n An `{{input}}` with no `type` or a `type` of `text` will render an HTML text input.\n The following HTML attributes can be set via the helper:\n\n <table>\n <tr><td>`readonly`</td><td>`required`</td><td>`autofocus`</td></tr>\n <tr><td>`value`</td><td>`placeholder`</td><td>`disabled`</td></tr>\n <tr><td>`size`</td><td>`tabindex`</td><td>`maxlength`</td></tr>\n <tr><td>`name`</td><td>`min`</td><td>`max`</td></tr>\n <tr><td>`pattern`</td><td>`accept`</td><td>`autocomplete`</td></tr>\n <tr><td>`autosave`</td><td>`formaction`</td><td>`formenctype`</td></tr>\n <tr><td>`formmethod`</td><td>`formnovalidate`</td><td>`formtarget`</td></tr>\n <tr><td>`height`</td><td>`inputmode`</td><td>`multiple`</td></tr>\n <tr><td>`step`</td><td>`width`</td><td>`form`</td></tr>\n <tr><td>`selectionDirection`</td><td>`spellcheck`</td><td> </td></tr>\n </table>\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input value=\"http://www.facebook.com\"}}\n ```\n\n\n ```html\n <input type=\"text\" value=\"http://www.facebook.com\"/>\n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n firstName: \"Stanley\",\n entryNotAllowed: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"text\" value=firstName disabled=entryNotAllowed size=\"50\"}}\n ```\n\n\n ```html\n <input type=\"text\" value=\"Stanley\" disabled=\"disabled\" size=\"50\"/>\n ```\n\n ## Extension\n\n Internally, `{{input type=\"text\"}}` creates an instance of `Ember.TextField`, passing\n arguments from the helper to `Ember.TextField`'s `create` method. You can extend the\n capabilities of text inputs in your applications by reopening this class. For example,\n if you are building a Bootstrap project where `data-*` attributes are used, you\n can add one to the `TextField`'s `attributeBindings` property:\n\n\n ```javascript\n Ember.TextField.reopen({\n attributeBindings: ['data-error']\n });\n ```\n\n Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n\n ## Use as checkbox\n\n An `{{input}}` with a `type` of `checkbox` will render an HTML checkbox input.\n The following HTML attributes can be set via the helper:\n\n * `checked`\n * `disabled`\n * `tabindex`\n * `indeterminate`\n * `name`\n * `autofocus`\n * `form`\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input type=\"checkbox\" name=\"isAdmin\"}}\n ```\n\n ```html\n <input type=\"checkbox\" name=\"isAdmin\" />\n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n isAdmin: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"checkbox\" checked=isAdmin }}\n ```\n\n\n ```html\n <input type=\"checkbox\" checked=\"checked\" />\n ```\n\n ## Extension\n\n Internally, `{{input type=\"checkbox\"}}` creates an instance of `Ember.Checkbox`, passing\n arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the\n capablilties of checkbox inputs in your applications by reopening this class. For example,\n if you wanted to add a css class to all checkboxes in your application:\n\n\n ```javascript\n Ember.Checkbox.reopen({\n classNames: ['my-app-checkbox']\n });\n ```\n\n\n @method input\n @for Ember.Handlebars.helpers\n @param {Hash} options\n */\n function inputHelper(options) {\n Ember.assert('You can only pass attributes to the `input` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes,\n inputType = hash.type,\n onEvent = hash.on;\n\n delete hash.type;\n delete hash.on;\n\n if (inputType === 'checkbox') {\n Ember.assert(\"{{input type='checkbox'}} does not support setting `value=someBooleanValue`; you must use `checked=someBooleanValue` instead.\", options.hashTypes.value !== 'ID');\n return helpers.view.call(this, Checkbox, options);\n } else {\n if (inputType) { hash.type = inputType; }\n hash.onEvent = onEvent || 'enter';\n return helpers.view.call(this, TextField, options);\n }\n }\n\n /**\n `{{textarea}}` inserts a new instance of `<textarea>` tag into the template.\n The attributes of `{{textarea}}` match those of the native HTML tags as\n closely as possible.\n\n The following HTML attributes can be set:\n\n * `value`\n * `name`\n * `rows`\n * `cols`\n * `placeholder`\n * `disabled`\n * `maxlength`\n * `tabindex`\n * `selectionEnd`\n * `selectionStart`\n * `selectionDirection`\n * `wrap`\n * `readonly`\n * `autofocus`\n * `form`\n * `spellcheck`\n * `required`\n\n When set to a quoted string, these value will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n Unbound:\n\n ```handlebars\n {{textarea value=\"Lots of static text that ISN'T bound\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of static text that ISN'T bound\n </textarea>\n ```\n\n Bound:\n\n In the following example, the `writtenWords` property on `App.ApplicationController`\n will be updated live as the user types 'Lots of text that IS bound' into\n the text area of their browser's window.\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\"\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n ```\n\n If you wanted a one way binding between the text area and a div tag\n somewhere else on your screen, you could use `Ember.computed.oneWay`:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n outputWrittenWords: Ember.computed.oneWay(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n\n <div>\n {{outputWrittenWords}}\n </div>\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n\n <-- the following div will be updated in real time as you type -->\n\n <div>\n Lots of text that IS bound\n </div>\n ```\n\n Finally, this example really shows the power and ease of Ember when two\n properties are bound to eachother via `Ember.computed.alias`. Type into\n either text area box and they'll both stay in sync. Note that\n `Ember.computed.alias` costs more in terms of performance, so only use it when\n your really binding in both directions:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n twoWayWrittenWords: Ember.computed.alias(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n {{textarea value=twoWayWrittenWords}}\n ```\n\n ```html\n <textarea id=\"ember1\" class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n\n <-- both updated in real time -->\n\n <textarea id=\"ember2\" class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n ```\n\n ## Extension\n\n Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing\n arguments from the helper to `Ember.TextArea`'s `create` method. You can\n extend the capabilities of text areas in your application by reopening this\n class. For example, if you are building a Bootstrap project where `data-*` \n attributes are used, you can globally add support for a `data-*` attribute\n on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or\n `Ember.TextSupport` and adding it to the `attributeBindings` concatenated\n property:\n\n ```javascript\n Ember.TextArea.reopen({\n attributeBindings: ['data-error']\n });\n ```\n\n Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n @method textarea\n @for Ember.Handlebars.helpers\n @param {Hash} options\n */\n function textareaHelper(options) {\n Ember.assert('You can only pass attributes to the `textarea` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes;\n\n return helpers.view.call(this, TextArea, options);\n }\n\n __exports__.inputHelper = inputHelper;\n __exports__.textareaHelper = textareaHelper;\n });\ndefine(\"ember-handlebars/controls/checkbox\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var View = __dependency3__.View;\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n /**\n The internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `checkbox`.\n\n See [handlebars.helpers.input](/api/classes/Ember.Handlebars.helpers.html#method_input) for usage details.\n\n ## Direct manipulation of `checked`\n\n The `checked` attribute of an `Ember.Checkbox` object should always be set\n through the Ember object or by interacting with its rendered element\n representation via the mouse, keyboard, or touch. Updating the value of the\n checkbox via jQuery will result in the checked value of the object and its\n element losing synchronization.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class Checkbox\n @namespace Ember\n @extends Ember.View\n */\n var Checkbox = View.extend({\n instrumentDisplay: '{{input type=\"checkbox\"}}',\n\n classNames: ['ember-checkbox'],\n\n tagName: 'input',\n\n attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name',\n 'autofocus', 'required', 'form'],\n\n type: \"checkbox\",\n checked: false,\n disabled: false,\n indeterminate: false,\n\n init: function() {\n this._super();\n this.on(\"change\", this, this._updateElementValue);\n },\n\n didInsertElement: function() {\n this._super();\n get(this, 'element').indeterminate = !!get(this, 'indeterminate');\n },\n\n _updateElementValue: function() {\n set(this, 'checked', this.$().prop('checked'));\n }\n });\n\n __exports__[\"default\"] = Checkbox;\n });\ndefine(\"ember-handlebars/controls/select\",\n [\"ember-handlebars-compiler\",\"ember-metal/enumerable_utils\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/view\",\"ember-views/views/collection_view\",\"ember-metal/utils\",\"ember-metal/is_none\",\"ember-metal/computed\",\"ember-runtime/system/native_array\",\"ember-metal/mixin\",\"ember-metal/properties\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n /*jshint eqeqeq:false newcap:false */\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var EmberHandlebars = __dependency1__[\"default\"];\n var EnumerableUtils = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var View = __dependency5__.View;\n var CollectionView = __dependency6__[\"default\"];\n var isArray = __dependency7__.isArray;\n var isNone = __dependency8__[\"default\"];\n var computed = __dependency9__.computed;\n var A = __dependency10__.A;\n var observer = __dependency11__.observer;\n var defineProperty = __dependency12__.defineProperty;\n\n var indexOf = EnumerableUtils.indexOf,\n indexesOf = EnumerableUtils.indexesOf,\n forEach = EnumerableUtils.forEach,\n replace = EnumerableUtils.replace,\n precompileTemplate = EmberHandlebars.compile;\n\n var SelectOption = View.extend({\n instrumentDisplay: 'Ember.SelectOption',\n\n tagName: 'option',\n attributeBindings: ['value', 'selected'],\n\n defaultTemplate: function(context, options) {\n options = { data: options.data, hash: {} };\n EmberHandlebars.helpers.bind.call(context, \"view.label\", options);\n },\n\n init: function() {\n this.labelPathDidChange();\n this.valuePathDidChange();\n\n this._super();\n },\n\n selected: computed(function() {\n var content = get(this, 'content'),\n selection = get(this, 'parentView.selection');\n if (get(this, 'parentView.multiple')) {\n return selection && indexOf(selection, content.valueOf()) > -1;\n } else {\n // Primitives get passed through bindings as objects... since\n // `new Number(4) !== 4`, we use `==` below\n return content == selection;\n }\n }).property('content', 'parentView.selection'),\n\n labelPathDidChange: observer('parentView.optionLabelPath', function() {\n var labelPath = get(this, 'parentView.optionLabelPath');\n\n if (!labelPath) { return; }\n\n defineProperty(this, 'label', computed(function() {\n return get(this, labelPath);\n }).property(labelPath));\n }),\n\n valuePathDidChange: observer('parentView.optionValuePath', function() {\n var valuePath = get(this, 'parentView.optionValuePath');\n\n if (!valuePath) { return; }\n\n defineProperty(this, 'value', computed(function() {\n return get(this, valuePath);\n }).property(valuePath));\n })\n });\n\n var SelectOptgroup = CollectionView.extend({\n instrumentDisplay: 'Ember.SelectOptgroup',\n\n tagName: 'optgroup',\n attributeBindings: ['label'],\n\n selectionBinding: 'parentView.selection',\n multipleBinding: 'parentView.multiple',\n optionLabelPathBinding: 'parentView.optionLabelPath',\n optionValuePathBinding: 'parentView.optionValuePath',\n\n itemViewClassBinding: 'parentView.optionView'\n });\n\n /**\n The `Ember.Select` view class renders a\n [select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,\n allowing the user to choose from a list of options.\n\n The text and `value` property of each `<option>` element within the\n `<select>` element are populated from the objects in the `Element.Select`'s\n `content` property. The underlying data object of the selected `<option>` is\n stored in the `Element.Select`'s `value` property.\n\n ## The Content Property (array of strings)\n\n The simplest version of an `Ember.Select` takes an array of strings as its\n `content` property. The string will be used as both the `value` property and\n the inner text of each `<option>` element inside the rendered `<select>`.\n\n Example:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n names: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select content=names}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n You can control which `<option>` is selected through the `Ember.Select`'s\n `value` property:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n selectedName: 'Tom',\n names: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=names\n value=selectedName\n }}\n ```\n\n Would result in the following HTML with the `<option>` for 'Tom' selected:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n A user interacting with the rendered `<select>` to choose \"Yehuda\" would\n update the value of `selectedName` to \"Yehuda\".\n\n ## The Content Property (array of Objects)\n\n An `Ember.Select` can also take an array of JavaScript or Ember objects as\n its `content` property.\n\n When using objects you need to tell the `Ember.Select` which property should\n be accessed on each object to supply the `value` attribute of the `<option>`\n and which property should be used to supply the element text.\n\n The `optionValuePath` option is used to specify the path on each object to\n the desired property for the `value` attribute. The `optionLabelPath`\n specifies the path on each object to the desired property for the\n element's text. Both paths must reference each object itself as `content`:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\">Tom</option>\n </select>\n ```\n\n The `value` attribute of the selected `<option>` within an `Ember.Select`\n can be bound to a property on another object:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ],\n currentProgrammer: {\n id: 2\n }\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n value=currentProgrammer.id}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `id` of `currentProgrammer`\n to match the `value` property of the newly selected `<option>`.\n\n Alternatively, you can control selection through the underlying objects\n used to render each object by binding the `selection` option. When the selected\n `<option>` is changed, the property path provided to `selection`\n will be updated to match the content object of the rendered `<option>`\n element:\n\n ```javascript\n\n var yehuda = {firstName: \"Yehuda\", id: 1, bff4eva: 'tom'}\n var tom = {firstName: \"Tom\", id: 2, bff4eva: 'yehuda'};\n\n App.ApplicationController = Ember.ObjectController.extend({\n selectedPerson: tom,\n programmers: [\n yehuda,\n tom\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n selection=selectedPerson}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `selectedPerson` to match the object of\n the newly selected `<option>`. In this case it is the first object\n in the `programmers`\n\n ## Supplying a Prompt\n\n A `null` value for the `Ember.Select`'s `value` or `selection` property\n results in there being no `<option>` with a `selected` attribute:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n selectedProgrammer: null,\n programmers: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ``` handlebars\n {{view Ember.Select\n content=programmers\n value=selectedProgrammer\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n Although `selectedProgrammer` is `null` and no `<option>`\n has a `selected` attribute the rendered HTML will display the\n first item as though it were selected. You can supply a string\n value for the `Ember.Select` to display when there is no selection\n with the `prompt` option:\n\n ```javascript\n App.ApplicationController = Ember.ObjectController.extend({\n selectedProgrammer: null,\n programmers: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n value=selectedProgrammer\n prompt=\"Please select a name\"\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option>Please select a name</option>\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n @class Select\n @namespace Ember\n @extends Ember.View\n */\n var Select = View.extend({\n instrumentDisplay: 'Ember.Select',\n\n tagName: 'select',\n classNames: ['ember-select'],\n defaultTemplate: precompileTemplate('{{#if view.prompt}}<option value=\"\">{{view.prompt}}</option>{{/if}}{{#if view.optionGroupPath}}{{#each view.groupedContent}}{{view view.groupView content=content label=label}}{{/each}}{{else}}{{#each view.content}}{{view view.optionView content=this}}{{/each}}{{/if}}'),\n attributeBindings: ['multiple', 'disabled', 'tabindex', 'name', 'required', 'autofocus',\n 'form', 'size'],\n\n /**\n The `multiple` attribute of the select element. Indicates whether multiple\n options can be selected.\n\n @property multiple\n @type Boolean\n @default false\n */\n multiple: false,\n\n /**\n The `disabled` attribute of the select element. Indicates whether\n the element is disabled from interactions.\n\n @property disabled\n @type Boolean\n @default false\n */\n disabled: false,\n\n /**\n The `required` attribute of the select element. Indicates whether\n a selected option is required for form validation.\n\n @property required\n @type Boolean\n @default false\n @since 1.5.0\n */\n required: false,\n\n /**\n The list of options.\n\n If `optionLabelPath` and `optionValuePath` are not overridden, this should\n be a list of strings, which will serve simultaneously as labels and values.\n\n Otherwise, this should be a list of objects. For instance:\n\n ```javascript\n Ember.Select.create({\n content: A([\n { id: 1, firstName: 'Yehuda' },\n { id: 2, firstName: 'Tom' }\n ]),\n optionLabelPath: 'content.firstName',\n optionValuePath: 'content.id'\n });\n ```\n\n @property content\n @type Array\n @default null\n */\n content: null,\n\n /**\n When `multiple` is `false`, the element of `content` that is currently\n selected, if any.\n\n When `multiple` is `true`, an array of such elements.\n\n @property selection\n @type Object or Array\n @default null\n */\n selection: null,\n\n /**\n In single selection mode (when `multiple` is `false`), value can be used to\n get the current selection's value or set the selection by it's value.\n\n It is not currently supported in multiple selection mode.\n\n @property value\n @type String\n @default null\n */\n value: computed(function(key, value) {\n if (arguments.length === 2) { return value; }\n var valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, '');\n return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection');\n }).property('selection'),\n\n /**\n If given, a top-most dummy option will be rendered to serve as a user\n prompt.\n\n @property prompt\n @type String\n @default null\n */\n prompt: null,\n\n /**\n The path of the option labels. See [content](/api/classes/Ember.Select.html#property_content).\n\n @property optionLabelPath\n @type String\n @default 'content'\n */\n optionLabelPath: 'content',\n\n /**\n The path of the option values. See [content](/api/classes/Ember.Select.html#property_content).\n\n @property optionValuePath\n @type String\n @default 'content'\n */\n optionValuePath: 'content',\n\n /**\n The path of the option group.\n When this property is used, `content` should be sorted by `optionGroupPath`.\n\n @property optionGroupPath\n @type String\n @default null\n */\n optionGroupPath: null,\n\n /**\n The view class for optgroup.\n\n @property groupView\n @type Ember.View\n @default Ember.SelectOptgroup\n */\n groupView: SelectOptgroup,\n\n groupedContent: computed(function() {\n var groupPath = get(this, 'optionGroupPath');\n var groupedContent = A();\n var content = get(this, 'content') || [];\n\n forEach(content, function(item) {\n var label = get(item, groupPath);\n\n if (get(groupedContent, 'lastObject.label') !== label) {\n groupedContent.pushObject({\n label: label,\n content: A()\n });\n }\n\n get(groupedContent, 'lastObject.content').push(item);\n });\n\n return groupedContent;\n }).property('optionGroupPath', 'content.@each'),\n\n /**\n The view class for option.\n\n @property optionView\n @type Ember.View\n @default Ember.SelectOption\n */\n optionView: SelectOption,\n\n _change: function() {\n if (get(this, 'multiple')) {\n this._changeMultiple();\n } else {\n this._changeSingle();\n }\n },\n\n selectionDidChange: observer('selection.@each', function() {\n var selection = get(this, 'selection');\n if (get(this, 'multiple')) {\n if (!isArray(selection)) {\n set(this, 'selection', A([selection]));\n return;\n }\n this._selectionDidChangeMultiple();\n } else {\n this._selectionDidChangeSingle();\n }\n }),\n\n valueDidChange: observer('value', function() {\n var content = get(this, 'content'),\n value = get(this, 'value'),\n valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, ''),\n selectedValue = (valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection')),\n selection;\n\n if (value !== selectedValue) {\n selection = content ? content.find(function(obj) {\n return value === (valuePath ? get(obj, valuePath) : obj);\n }) : null;\n\n this.set('selection', selection);\n }\n }),\n\n\n _triggerChange: function() {\n var selection = get(this, 'selection');\n var value = get(this, 'value');\n\n if (!isNone(selection)) { this.selectionDidChange(); }\n if (!isNone(value)) { this.valueDidChange(); }\n\n this._change();\n },\n\n _changeSingle: function() {\n var selectedIndex = this.$()[0].selectedIndex,\n content = get(this, 'content'),\n prompt = get(this, 'prompt');\n\n if (!content || !get(content, 'length')) { return; }\n if (prompt && selectedIndex === 0) { set(this, 'selection', null); return; }\n\n if (prompt) { selectedIndex -= 1; }\n set(this, 'selection', content.objectAt(selectedIndex));\n },\n\n\n _changeMultiple: function() {\n var options = this.$('option:selected'),\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n content = get(this, 'content'),\n selection = get(this, 'selection');\n\n if (!content) { return; }\n if (options) {\n var selectedIndexes = options.map(function() {\n return this.index - offset;\n }).toArray();\n var newSelection = content.objectsAt(selectedIndexes);\n\n if (isArray(selection)) {\n replace(selection, 0, get(selection, 'length'), newSelection);\n } else {\n set(this, 'selection', newSelection);\n }\n }\n },\n\n _selectionDidChangeSingle: function() {\n var el = this.get('element');\n if (!el) { return; }\n\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectionIndex = content ? indexOf(content, selection) : -1,\n prompt = get(this, 'prompt');\n\n if (prompt) { selectionIndex += 1; }\n if (el) { el.selectedIndex = selectionIndex; }\n },\n\n _selectionDidChangeMultiple: function() {\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectedIndexes = content ? indexesOf(content, selection) : [-1],\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n options = this.$('option'),\n adjusted;\n\n if (options) {\n options.each(function() {\n adjusted = this.index > -1 ? this.index - offset : -1;\n this.selected = indexOf(selectedIndexes, adjusted) > -1;\n });\n }\n },\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._triggerChange);\n this.on(\"change\", this, this._change);\n }\n });\n\n __exports__[\"default\"] = Select\n __exports__.Select = Select;\n __exports__.SelectOption = SelectOption;\n __exports__.SelectOptgroup = SelectOptgroup;\n });\ndefine(\"ember-handlebars/controls/text_area\",\n [\"ember-metal/property_get\",\"ember-views/views/component\",\"ember-handlebars/controls/text_support\",\"ember-metal/mixin\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n var get = __dependency1__.get;\n var Component = __dependency2__[\"default\"];\n var TextSupport = __dependency3__[\"default\"];\n var observer = __dependency4__.observer;\n\n /**\n The internal class used to create textarea element when the `{{textarea}}`\n helper is used.\n\n See [handlebars.helpers.textarea](/api/classes/Ember.Handlebars.helpers.html#method_textarea) for usage details.\n\n ## Layout and LayoutName properties\n\n Because HTML `textarea` elements do not contain inner HTML the `layout` and\n `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextArea\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n */\n var TextArea = Component.extend(TextSupport, {\n instrumentDisplay: '{{textarea}}',\n\n classNames: ['ember-text-area'],\n\n tagName: \"textarea\",\n attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap'],\n rows: null,\n cols: null,\n\n _updateElementValue: observer('value', function() {\n // We do this check so cursor position doesn't get affected in IE\n var value = get(this, 'value'),\n $el = this.$();\n if ($el && value !== $el.val()) {\n $el.val(value);\n }\n }),\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._updateElementValue);\n }\n\n });\n\n __exports__[\"default\"] = TextArea;\n });\ndefine(\"ember-handlebars/controls/text_field\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/component\",\"ember-handlebars/controls/text_support\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var Component = __dependency3__[\"default\"];\n var TextSupport = __dependency4__[\"default\"];\n\n /**\n\n The internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `text`.\n\n See [Handlebars.helpers.input](/api/classes/Ember.Handlebars.helpers.html#method_input) for usage details.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextField\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n */\n var TextField = Component.extend(TextSupport, {\n instrumentDisplay: '{{input type=\"text\"}}',\n\n classNames: ['ember-text-field'],\n tagName: \"input\",\n attributeBindings: ['type', 'value', 'size', 'pattern', 'name', 'min', 'max',\n 'accept', 'autocomplete', 'autosave', 'formaction',\n 'formenctype', 'formmethod', 'formnovalidate', 'formtarget',\n 'height', 'inputmode', 'list', 'multiple', 'pattern', 'step',\n 'width'],\n\n /**\n The `value` attribute of the input element. As the user inputs text, this\n property is updated live.\n\n @property value\n @type String\n @default \"\"\n */\n value: \"\",\n\n /**\n The `type` attribute of the input element.\n\n @property type\n @type String\n @default \"text\"\n */\n type: \"text\",\n\n /**\n The `size` of the text field in characters.\n\n @property size\n @type String\n @default null\n */\n size: null,\n\n /**\n The `pattern` attribute of input element.\n\n @property pattern\n @type String\n @default null\n */\n pattern: null,\n\n /**\n The `min` attribute of input element used with `type=\"number\"` or `type=\"range\"`.\n\n @property min\n @type String\n @default null\n @since 1.4.0\n */\n min: null,\n\n /**\n The `max` attribute of input element used with `type=\"number\"` or `type=\"range\"`.\n\n @property max\n @type String\n @default null\n @since 1.4.0\n */\n max: null\n });\n\n __exports__[\"default\"] = TextField;\n });\ndefine(\"ember-handlebars/controls/text_support\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/mixin\",\"ember-runtime/mixins/target_action_support\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var Mixin = __dependency3__.Mixin;\n var TargetActionSupport = __dependency4__[\"default\"];\n\n /**\n Shared mixin used by `Ember.TextField` and `Ember.TextArea`.\n\n @class TextSupport\n @namespace Ember\n @uses Ember.TargetActionSupport\n @extends Ember.Mixin\n @private\n */\n var TextSupport = Mixin.create(TargetActionSupport, {\n value: \"\",\n\n attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex', 'readonly',\n 'autofocus', 'form', 'selectionDirection', 'spellcheck', 'required',\n 'title', 'autocapitalize', 'autocorrect'],\n placeholder: null,\n disabled: false,\n maxlength: null,\n\n init: function() {\n this._super();\n this.on(\"focusOut\", this, this._elementValueDidChange);\n this.on(\"change\", this, this._elementValueDidChange);\n this.on(\"paste\", this, this._elementValueDidChange);\n this.on(\"cut\", this, this._elementValueDidChange);\n this.on(\"input\", this, this._elementValueDidChange);\n this.on(\"keyUp\", this, this.interpretKeyEvents);\n },\n\n /**\n The action to be sent when the user presses the return key.\n\n This is similar to the `{{action}}` helper, but is fired when\n the user presses the return key when editing a text field, and sends\n the value of the field as the context.\n\n @property action\n @type String\n @default null\n */\n action: null,\n\n /**\n The event that should send the action.\n\n Options are:\n\n * `enter`: the user pressed enter\n * `keyPress`: the user pressed a key\n\n @property onEvent\n @type String\n @default enter\n */\n onEvent: 'enter',\n\n /**\n Whether they `keyUp` event that triggers an `action` to be sent continues\n propagating to other views.\n\n By default, when the user presses the return key on their keyboard and\n the text field has an `action` set, the action will be sent to the view's\n controller and the key event will stop propagating.\n\n If you would like parent views to receive the `keyUp` event even after an\n action has been dispatched, set `bubbles` to true.\n\n @property bubbles\n @type Boolean\n @default false\n */\n bubbles: false,\n\n interpretKeyEvents: function(event) {\n var map = TextSupport.KEY_EVENTS;\n var method = map[event.keyCode];\n\n this._elementValueDidChange();\n if (method) { return this[method](event); }\n },\n\n _elementValueDidChange: function() {\n set(this, 'value', this.$().val());\n },\n\n /**\n The action to be sent when the user inserts a new line.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 13.\n Uses sendAction to send the `enter` action to the controller.\n\n @method insertNewline\n @param {Event} event\n */\n insertNewline: function(event) {\n sendAction('enter', this, event);\n sendAction('insert-newline', this, event);\n },\n\n /**\n Called when the user hits escape.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 27.\n Uses sendAction to send the `escape-press` action to the controller.\n\n @method cancel\n @param {Event} event\n */\n cancel: function(event) {\n sendAction('escape-press', this, event);\n },\n\n /**\n Called when the text area is focused.\n\n @method focusIn\n @param {Event} event\n */\n focusIn: function(event) {\n sendAction('focus-in', this, event);\n },\n\n /**\n Called when the text area is blurred.\n\n @method focusOut\n @param {Event} event\n */\n focusOut: function(event) {\n sendAction('focus-out', this, event);\n },\n\n /**\n The action to be sent when the user presses a key. Enabled by setting\n the `onEvent` property to `keyPress`.\n\n Uses sendAction to send the `keyPress` action to the controller.\n\n @method keyPress\n @param {Event} event\n */\n keyPress: function(event) {\n sendAction('key-press', this, event);\n }\n\n });\n\n TextSupport.KEY_EVENTS = {\n 13: 'insertNewline',\n 27: 'cancel'\n };\n\n // In principle, this shouldn't be necessary, but the legacy\n // sendAction semantics for TextField are different from\n // the component semantics so this method normalizes them.\n function sendAction(eventName, view, event) {\n var action = get(view, eventName),\n on = get(view, 'onEvent'),\n value = get(view, 'value');\n\n // back-compat support for keyPress as an event name even though\n // it's also a method name that consumes the event (and therefore\n // incompatible with sendAction semantics).\n if (on === eventName || (on === 'keyPress' && eventName === 'key-press')) {\n view.sendAction('action', value);\n }\n\n view.sendAction(eventName, value);\n\n if (action || on === eventName) {\n if(!get(view, 'bubbles')) {\n event.stopPropagation();\n }\n }\n }\n\n __exports__[\"default\"] = TextSupport;\n });\ndefine(\"ember-handlebars/ext\",\n [\"ember-metal/core\",\"ember-runtime/system/string\",\"ember-handlebars-compiler\",\"ember-metal/property_get\",\"ember-metal/binding\",\"ember-metal/error\",\"ember-metal/mixin\",\"ember-metal/is_empty\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.FEATURES, Ember.assert, Ember.Handlebars, Ember.lookup\n // var emberAssert = Ember.assert;\n\n var fmt = __dependency2__.fmt;\n\n var EmberHandlebars = __dependency3__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n\n var get = __dependency4__.get;\n var isGlobalPath = __dependency5__.isGlobalPath;\n var EmberError = __dependency6__[\"default\"];\n var IS_BINDING = __dependency7__.IS_BINDING;\n\n // late bound via requireModule because of circular dependencies.\n var resolveHelper,\n SimpleHandlebarsView;\n\n var isEmpty = __dependency8__[\"default\"];\n\n var slice = [].slice, originalTemplate = EmberHandlebars.template;\n\n /**\n If a path starts with a reserved keyword, returns the root\n that should be used.\n\n @private\n @method normalizePath\n @for Ember\n @param root {Object}\n @param path {String}\n @param data {Hash}\n */\n function normalizePath(root, path, data) {\n var keywords = (data && data.keywords) || {},\n keyword, isKeyword;\n\n // Get the first segment of the path. For example, if the\n // path is \"foo.bar.baz\", returns \"foo\".\n keyword = path.split('.', 1)[0];\n\n // Test to see if the first path is a keyword that has been\n // passed along in the view's data hash. If so, we will treat\n // that object as the new root.\n if (keywords.hasOwnProperty(keyword)) {\n // Look up the value in the template's data hash.\n root = keywords[keyword];\n isKeyword = true;\n\n // Handle cases where the entire path is the reserved\n // word. In that case, return the object itself.\n if (path === keyword) {\n path = '';\n } else {\n // Strip the keyword from the path and look up\n // the remainder from the newly found root.\n path = path.substr(keyword.length+1);\n }\n }\n\n return { root: root, path: path, isKeyword: isKeyword };\n };\n\n\n /**\n Lookup both on root and on window. If the path starts with\n a keyword, the corresponding object will be looked up in the\n template's data hash and used to resolve the path.\n\n @method get\n @for Ember.Handlebars\n @param {Object} root The object to look up the property on\n @param {String} path The path to be lookedup\n @param {Object} options The template's option hash\n */\n function handlebarsGet(root, path, options) {\n var data = options && options.data,\n normalizedPath = normalizePath(root, path, data),\n value;\n\n if (Ember.FEATURES.isEnabled(\"ember-handlebars-caps-lookup\")) {\n\n // If the path starts with a capital letter, look it up on Ember.lookup,\n // which defaults to the `window` object in browsers.\n if (isGlobalPath(path)) {\n value = get(Ember.lookup, path);\n } else {\n\n // In cases where the path begins with a keyword, change the\n // root to the value represented by that keyword, and ensure\n // the path is relative to it.\n value = get(normalizedPath.root, normalizedPath.path);\n }\n\n } else {\n root = normalizedPath.root;\n path = normalizedPath.path;\n\n value = get(root, path);\n\n if (value === undefined && root !== Ember.lookup && isGlobalPath(path)) {\n value = get(Ember.lookup, path);\n }\n }\n\n return value;\n }\n\n /**\n This method uses `Ember.Handlebars.get` to lookup a value, then ensures\n that the value is escaped properly.\n\n If `unescaped` is a truthy value then the escaping will not be performed.\n\n @method getEscaped\n @for Ember.Handlebars\n @param {Object} root The object to look up the property on\n @param {String} path The path to be lookedup\n @param {Object} options The template's option hash\n @since 1.4.0\n */\n function getEscaped(root, path, options) {\n var result = handlebarsGet(root, path, options);\n\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n if (!options.hash.unescaped){\n result = Handlebars.Utils.escapeExpression(result);\n }\n\n return result;\n };\n\n function resolveParams(context, params, options) {\n var resolvedParams = [], types = options.types, param, type;\n\n for (var i=0, l=params.length; i<l; i++) {\n param = params[i];\n type = types[i];\n\n if (type === 'ID') {\n resolvedParams.push(handlebarsGet(context, param, options));\n } else {\n resolvedParams.push(param);\n }\n }\n\n return resolvedParams;\n };\n\n function resolveHash(context, hash, options) {\n var resolvedHash = {}, types = options.hashTypes, type;\n\n for (var key in hash) {\n if (!hash.hasOwnProperty(key)) { continue; }\n\n type = types[key];\n\n if (type === 'ID') {\n resolvedHash[key] = handlebarsGet(context, hash[key], options);\n } else {\n resolvedHash[key] = hash[key];\n }\n }\n\n return resolvedHash;\n };\n\n /**\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @private\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n */\n function helperMissingHelper(path) {\n if (!resolveHelper) { resolveHelper = requireModule('ember-handlebars/helpers/binding')['resolveHelper']; } // ES6TODO: stupid circular dep\n\n var error, view = \"\";\n\n var options = arguments[arguments.length - 1];\n\n var helper = resolveHelper(options.data.view.container, path);\n\n if (helper) {\n return helper.apply(this, slice.call(arguments, 1));\n }\n\n error = \"%@ Handlebars error: Could not find property '%@' on object %@.\";\n if (options.data) {\n view = options.data.view;\n }\n throw new EmberError(fmt(error, [view, path, this]));\n }\n\n /**\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @private\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n */\n function blockHelperMissingHelper(path) {\n if (!resolveHelper) { resolveHelper = requireModule('ember-handlebars/helpers/binding')['resolveHelper']; } // ES6TODO: stupid circular dep\n\n var options = arguments[arguments.length - 1];\n\n Ember.assert(\"`blockHelperMissing` was invoked without a helper name, which \" +\n \"is most likely due to a mismatch between the version of \" +\n \"Ember.js you're running now and the one used to precompile your \" +\n \"templates. Please make sure the version of \" +\n \"`ember-handlebars-compiler` you're using is up to date.\", path);\n\n var helper = resolveHelper(options.data.view.container, path);\n\n if (helper) {\n return helper.apply(this, slice.call(arguments, 1));\n } else {\n return helpers.helperMissing.call(this, path);\n }\n }\n\n /**\n Register a bound handlebars helper. Bound helpers behave similarly to regular\n handlebars helpers, with the added ability to re-render when the underlying data\n changes.\n\n ## Simple example\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalize', function(value) {\n return Ember.String.capitalize(value);\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n ## Example with options\n\n Like normal handlebars helpers, bound helpers have access to the options\n passed into the helper call.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('repeat', function(value, options) {\n var count = options.hash.count;\n var a = [];\n while(a.length < count) {\n a.push(value);\n }\n return a.join('');\n });\n ```\n\n This helper could be used in a template as follows:\n\n ```handlebars\n {{repeat text count=3}}\n ```\n\n ## Example with bound options\n\n Bound hash options are also supported. Example:\n\n ```handlebars\n {{repeat text count=numRepeats}}\n ```\n\n In this example, count will be bound to the value of\n the `numRepeats` property on the context. If that property\n changes, the helper will be re-rendered.\n\n ## Example with extra dependencies\n\n The `Ember.Handlebars.registerBoundHelper` method takes a variable length\n third parameter which indicates extra dependencies on the passed in value.\n This allows the handlebars helper to update when these dependencies change.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalizeName', function(value) {\n return value.get('name').toUpperCase();\n }, 'name');\n ```\n\n ## Example with multiple bound properties\n\n `Ember.Handlebars.registerBoundHelper` supports binding to\n multiple properties, e.g.:\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('concatenate', function() {\n var values = Array.prototype.slice.call(arguments, 0, -1);\n return values.join('||');\n });\n ```\n\n Which allows for template syntax such as `{{concatenate prop1 prop2}}` or\n `{{concatenate prop1 prop2 prop3}}`. If any of the properties change,\n the helper will re-render. Note that dependency keys cannot be\n using in conjunction with multi-property helpers, since it is ambiguous\n which property the dependent keys would belong to.\n\n ## Use with unbound helper\n\n The `{{unbound}}` helper can be used with bound helper invocations\n to render them in their unbound form, e.g.\n\n ```handlebars\n {{unbound capitalize name}}\n ```\n\n In this example, if the name property changes, the helper\n will not re-render.\n\n ## Use with blocks not supported\n\n Bound helpers do not support use with Handlebars blocks or\n the addition of child views of any kind.\n\n @method registerBoundHelper\n @for Ember.Handlebars\n @param {String} name\n @param {Function} function\n @param {String} dependentKeys*\n */\n function registerBoundHelper(name, fn) {\n var boundHelperArgs = slice.call(arguments, 1),\n boundFn = makeBoundHelper.apply(this, boundHelperArgs);\n EmberHandlebars.registerHelper(name, boundFn);\n };\n\n /**\n A helper function used by `registerBoundHelper`. Takes the\n provided Handlebars helper function fn and returns it in wrapped\n bound helper form.\n\n The main use case for using this outside of `registerBoundHelper`\n is for registering helpers on the container:\n\n ```js\n var boundHelperFn = Ember.Handlebars.makeBoundHelper(function(word) {\n return word.toUpperCase();\n });\n\n container.register('helper:my-bound-helper', boundHelperFn);\n ```\n\n In the above example, if the helper function hadn't been wrapped in\n `makeBoundHelper`, the registered helper would be unbound.\n\n @method makeBoundHelper\n @for Ember.Handlebars\n @param {Function} function\n @param {String} dependentKeys*\n @since 1.2.0\n */\n function makeBoundHelper(fn) {\n if (!SimpleHandlebarsView) { SimpleHandlebarsView = requireModule('ember-handlebars/views/handlebars_bound_view')['SimpleHandlebarsView']; } // ES6TODO: stupid circular dep\n\n var dependentKeys = slice.call(arguments, 1);\n\n function helper() {\n var properties = slice.call(arguments, 0, -1),\n numProperties = properties.length,\n options = arguments[arguments.length - 1],\n normalizedProperties = [],\n data = options.data,\n types = data.isUnbound ? slice.call(options.types, 1) : options.types,\n hash = options.hash,\n view = data.view,\n contexts = options.contexts,\n currentContext = (contexts && contexts.length) ? contexts[0] : this,\n prefixPathForDependentKeys = '',\n loc, len, hashOption,\n boundOption, property,\n normalizedValue = SimpleHandlebarsView.prototype.normalizedValue;\n\n Ember.assert(\"registerBoundHelper-generated helpers do not support use with Handlebars blocks.\", !options.fn);\n\n // Detect bound options (e.g. countBinding=\"otherCount\")\n var boundOptions = hash.boundOptions = {};\n for (hashOption in hash) {\n if (IS_BINDING.test(hashOption)) {\n // Lop off 'Binding' suffix.\n boundOptions[hashOption.slice(0, -7)] = hash[hashOption];\n }\n }\n\n // Expose property names on data.properties object.\n var watchedProperties = [];\n data.properties = [];\n for (loc = 0; loc < numProperties; ++loc) {\n data.properties.push(properties[loc]);\n if (types[loc] === 'ID') {\n var normalizedProp = normalizePath(currentContext, properties[loc], data);\n normalizedProperties.push(normalizedProp);\n watchedProperties.push(normalizedProp);\n } else {\n if(data.isUnbound) {\n normalizedProperties.push({path: properties[loc]});\n }else {\n normalizedProperties.push(null);\n }\n }\n }\n\n // Handle case when helper invocation is preceded by `unbound`, e.g.\n // {{unbound myHelper foo}}\n if (data.isUnbound) {\n return evaluateUnboundHelper(this, fn, normalizedProperties, options);\n }\n\n var bindView = new SimpleHandlebarsView(null, null, !options.hash.unescaped, options.data);\n\n // Override SimpleHandlebarsView's method for generating the view's content.\n bindView.normalizedValue = function() {\n var args = [], boundOption;\n\n // Copy over bound hash options.\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n property = normalizePath(currentContext, boundOptions[boundOption], data);\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n hash[boundOption] = normalizedValue.call(bindView);\n }\n\n for (loc = 0; loc < numProperties; ++loc) {\n property = normalizedProperties[loc];\n if (property) {\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n args.push(normalizedValue.call(bindView));\n } else {\n args.push(properties[loc]);\n }\n }\n args.push(options);\n\n // Run the supplied helper function.\n return fn.apply(currentContext, args);\n };\n\n view.appendChild(bindView);\n\n // Assemble list of watched properties that'll re-render this helper.\n for (boundOption in boundOptions) {\n if (boundOptions.hasOwnProperty(boundOption)) {\n watchedProperties.push(normalizePath(currentContext, boundOptions[boundOption], data));\n }\n }\n\n // Observe each property.\n for (loc = 0, len = watchedProperties.length; loc < len; ++loc) {\n property = watchedProperties[loc];\n view.registerObserver(property.root, property.path, bindView, bindView.rerender);\n }\n\n if (types[0] !== 'ID' || normalizedProperties.length === 0) {\n return;\n }\n\n // Add dependent key observers to the first param\n var normalized = normalizedProperties[0],\n pathRoot = normalized.root,\n path = normalized.path;\n\n if(!isEmpty(path)) {\n prefixPathForDependentKeys = path + '.';\n }\n for (var i=0, l=dependentKeys.length; i<l; i++) {\n view.registerObserver(pathRoot, prefixPathForDependentKeys + dependentKeys[i], bindView, bindView.rerender);\n }\n }\n\n helper._rawFunction = fn;\n return helper;\n };\n\n /**\n Renders the unbound form of an otherwise bound helper function.\n\n @private\n @method evaluateUnboundHelper\n @param {Function} fn\n @param {Object} context\n @param {Array} normalizedProperties\n @param {String} options\n */\n function evaluateUnboundHelper(context, fn, normalizedProperties, options) {\n var args = [],\n hash = options.hash,\n boundOptions = hash.boundOptions,\n types = slice.call(options.types, 1),\n loc,\n len,\n property,\n propertyType,\n boundOption;\n\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n hash[boundOption] = handlebarsGet(context, boundOptions[boundOption], options);\n }\n\n for(loc = 0, len = normalizedProperties.length; loc < len; ++loc) {\n property = normalizedProperties[loc];\n propertyType = types[loc];\n if(propertyType === \"ID\") {\n args.push(handlebarsGet(property.root, property.path, options));\n } else {\n args.push(property.path);\n }\n }\n args.push(options);\n return fn.apply(context, args);\n }\n\n /**\n Overrides Handlebars.template so that we can distinguish\n user-created, top-level templates from inner contexts.\n\n @private\n @method template\n @for Ember.Handlebars\n @param {String} spec\n */\n function template(spec) {\n var t = originalTemplate(spec);\n t.isTop = true;\n return t;\n };\n\n __exports__.normalizePath = normalizePath;\n __exports__.template = template;\n __exports__.makeBoundHelper = makeBoundHelper;\n __exports__.registerBoundHelper = registerBoundHelper;\n __exports__.resolveHash = resolveHash;\n __exports__.resolveParams = resolveParams;\n __exports__.handlebarsGet = handlebarsGet;\n __exports__.getEscaped = getEscaped;\n __exports__.evaluateUnboundHelper = evaluateUnboundHelper;\n __exports__.helperMissingHelper = helperMissingHelper;\n __exports__.blockHelperMissingHelper = blockHelperMissingHelper;\n });\ndefine(\"ember-handlebars/helpers/binding\",\n [\"ember-metal/core\",\"ember-handlebars-compiler\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/string\",\"ember-metal/utils\",\"ember-metal/platform\",\"ember-metal/is_none\",\"ember-metal/enumerable_utils\",\"ember-metal/array\",\"ember-views/views/view\",\"ember-metal/run_loop\",\"ember-handlebars/views/handlebars_bound_view\",\"ember-metal/observer\",\"ember-metal/binding\",\"ember-views/system/jquery\",\"ember-handlebars/ext\",\"ember-runtime/keys\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.warn, uuid\n // var emberAssert = Ember.assert, Ember.warn = Ember.warn;\n\n var EmberHandlebars = __dependency2__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n var SafeString = EmberHandlebars.SafeString;\n\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var fmt = __dependency5__.fmt;\n var apply = __dependency6__.apply;\n var o_create = __dependency7__.create;\n var isNone = __dependency8__[\"default\"];\n var EnumerableUtils = __dependency9__[\"default\"];\n var forEach = __dependency10__.forEach;\n var View = __dependency11__.View;\n var run = __dependency12__[\"default\"];\n var _HandlebarsBoundView = __dependency13__._HandlebarsBoundView;\n var SimpleHandlebarsView = __dependency13__.SimpleHandlebarsView;\n var removeObserver = __dependency14__.removeObserver;\n var isGlobalPath = __dependency15__.isGlobalPath;\n var emberBind = __dependency15__.bind;\n var guidFor = __dependency6__.guidFor;\n var typeOf = __dependency6__.typeOf;\n var jQuery = __dependency16__[\"default\"];\n var isArray = __dependency6__.isArray;\n var normalizePath = __dependency17__.normalizePath;\n var handlebarsGet = __dependency17__.handlebarsGet;\n var getEscaped = __dependency17__.getEscaped;\n var handlebarsGetEscaped = __dependency17__.getEscaped;\n var keys = __dependency18__[\"default\"];\n\n function exists(value) {\n return !isNone(value);\n }\n\n var WithView = _HandlebarsBoundView.extend({\n init: function() {\n var controller;\n\n apply(this, this._super, arguments);\n\n var keywords = this.templateData.keywords;\n var keywordName = this.templateHash.keywordName;\n var keywordPath = this.templateHash.keywordPath;\n var controllerName = this.templateHash.controller;\n var preserveContext = this.preserveContext;\n\n if (controllerName) {\n var previousContext = this.previousContext;\n controller = this.container.lookupFactory('controller:'+controllerName).create({\n parentController: previousContext,\n target: previousContext\n });\n\n this._generatedController = controller;\n\n if (!preserveContext) {\n this.set('controller', controller);\n\n this.valueNormalizerFunc = function(result) {\n controller.set('model', result);\n return controller;\n };\n } else {\n var controllerPath = jQuery.expando + guidFor(controller);\n keywords[controllerPath] = controller;\n emberBind(keywords, controllerPath + '.model', keywordPath);\n keywordPath = controllerPath;\n }\n }\n\n if (preserveContext) {\n emberBind(keywords, keywordName, keywordPath);\n }\n\n },\n willDestroy: function() {\n this._super();\n\n if (this._generatedController) {\n this._generatedController.destroy();\n }\n }\n });\n\n // Binds a property into the DOM. This will create a hook in DOM that the\n // KVO system will look for and update if the property changes.\n function bind(property, options, preserveContext, shouldDisplay, valueNormalizer, childProperties) {\n var data = options.data,\n fn = options.fn,\n inverse = options.inverse,\n view = data.view,\n normalized, observer, i;\n\n // we relied on the behavior of calling without\n // context to mean this === window, but when running\n // \"use strict\", it's possible for this to === undefined;\n var currentContext = this || window;\n\n normalized = normalizePath(currentContext, property, data);\n\n // Set up observers for observable objects\n if ('object' === typeof this) {\n if (data.insideGroup) {\n observer = function() {\n run.once(view, 'rerender');\n };\n\n var template, context, result = handlebarsGet(currentContext, property, options);\n\n result = valueNormalizer ? valueNormalizer(result) : result;\n\n context = preserveContext ? currentContext : result;\n if (shouldDisplay(result)) {\n template = fn;\n } else if (inverse) {\n template = inverse;\n }\n\n template(context, { data: options.data });\n } else {\n var viewClass = _HandlebarsBoundView;\n var viewOptions = {\n preserveContext: preserveContext,\n shouldDisplayFunc: shouldDisplay,\n valueNormalizerFunc: valueNormalizer,\n displayTemplate: fn,\n inverseTemplate: inverse,\n path: property,\n pathRoot: currentContext,\n previousContext: currentContext,\n isEscaped: !options.hash.unescaped,\n templateData: options.data,\n templateHash: options.hash,\n helperName: options.helperName\n };\n\n if (options.isWithHelper) {\n viewClass = WithView;\n }\n\n // Create the view that will wrap the output of this template/property\n // and add it to the nearest view's childViews array.\n // See the documentation of Ember._HandlebarsBoundView for more.\n var bindView = view.createChildView(viewClass, viewOptions);\n\n view.appendChild(bindView);\n\n observer = function() {\n run.scheduleOnce('render', bindView, 'rerenderIfNeeded');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n if (childProperties) {\n for (i=0; i<childProperties.length; i++) {\n view.registerObserver(normalized.root, normalized.path+'.'+childProperties[i], observer);\n }\n }\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n data.buffer.push(handlebarsGetEscaped(currentContext, property, options));\n }\n }\n\n function simpleBind(currentContext, property, options) {\n var data = options.data,\n view = data.view,\n normalized, observer, pathRoot, output;\n\n normalized = normalizePath(currentContext, property, data);\n pathRoot = normalized.root;\n\n // Set up observers for observable objects\n if (pathRoot && ('object' === typeof pathRoot)) {\n if (data.insideGroup) {\n observer = function() {\n run.once(view, 'rerender');\n };\n\n output = handlebarsGetEscaped(currentContext, property, options);\n\n data.buffer.push(output);\n } else {\n var bindView = new SimpleHandlebarsView(\n property, currentContext, !options.hash.unescaped, options.data\n );\n\n bindView._parentView = view;\n view.appendChild(bindView);\n\n observer = function() {\n run.scheduleOnce('render', bindView, 'rerender');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n output = handlebarsGetEscaped(currentContext, property, options);\n data.buffer.push(output);\n }\n }\n\n function shouldDisplayIfHelperContent(result) {\n var truthy = result && get(result, 'isTruthy');\n if (typeof truthy === 'boolean') { return truthy; }\n\n if (isArray(result)) {\n return get(result, 'length') !== 0;\n } else {\n return !!result;\n }\n }\n\n /**\n '_triageMustache' is used internally select between a binding, helper, or component for\n the given context. Until this point, it would be hard to determine if the\n mustache is a property reference or a regular helper reference. This triage\n helper resolves that.\n\n This would not be typically invoked by directly.\n\n @private\n @method _triageMustache\n @for Ember.Handlebars.helpers\n @param {String} property Property/helperID to triage\n @param {Object} options hash of template/rendering options\n @return {String} HTML string\n */\n function _triageMustacheHelper(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the _triageMustache helper\", arguments.length <= 2);\n\n var helper = EmberHandlebars.resolveHelper(options.data.view.container, property);\n if (helper) {\n return helper.call(this, options);\n }\n\n return helpers.bind.call(this, property, options);\n }\n\n /**\n Used to lookup/resolve handlebars helpers. The lookup order is:\n\n * Look for a registered helper\n * If a dash exists in the name:\n * Look for a helper registed in the container\n * Use Ember.ComponentLookup to find an Ember.Component that resolves\n to the given name\n\n @private\n @method resolveHelper\n @param {Container} container\n @param {String} name the name of the helper to lookup\n @return {Handlebars Helper}\n */\n function resolveHelper(container, name) {\n if (helpers[name]) {\n return helpers[name];\n }\n\n if (!container || name.indexOf('-') === -1) {\n return;\n }\n\n var helper = container.lookup('helper:' + name);\n if (!helper) {\n var componentLookup = container.lookup('component-lookup:main');\n Ember.assert(\"Could not find 'component-lookup:main' on the provided container, which is necessary for performing component lookups\", componentLookup);\n\n var Component = componentLookup.lookupFactory(name, container);\n if (Component) {\n helper = EmberHandlebars.makeViewHelper(Component);\n container.register('helper:' + name, helper);\n }\n }\n return helper;\n }\n\n\n /**\n `bind` can be used to display a value, then update that value if it\n changes. For example, if you wanted to print the `title` property of\n `content`:\n\n ```handlebars\n {{bind \"content.title\"}}\n ```\n\n This will return the `title` property as a string, then create a new observer\n at the specified path. If it changes, it will update the value in DOM. Note\n that if you need to support IE7 and IE8 you must modify the model objects\n properties using `Ember.get()` and `Ember.set()` for this to work as it\n relies on Ember's KVO system. For all other browsers this will be handled for\n you automatically.\n\n @private\n @method bind\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n */\n function bindHelper(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the bind helper\", arguments.length <= 2);\n\n var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this;\n\n if (!options.fn) {\n return simpleBind(context, property, options);\n }\n\n options.helperName = 'bind';\n\n return bind.call(context, property, options, false, exists);\n }\n\n /**\n Use the `boundIf` helper to create a conditional that re-evaluates\n whenever the truthiness of the bound value changes.\n\n ```handlebars\n {{#boundIf \"content.shouldDisplayTitle\"}}\n {{content.title}}\n {{/boundIf}}\n ```\n\n @private\n @method boundIf\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n */\n function boundIfHelper(property, fn) {\n var context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : this;\n\n fn.helperName = fn.helperName || 'boundIf';\n\n return bind.call(context, property, fn, true, shouldDisplayIfHelperContent, shouldDisplayIfHelperContent, ['isTruthy', 'length']);\n }\n\n\n /**\n @private\n\n Use the `unboundIf` helper to create a conditional that evaluates once.\n\n ```handlebars\n {{#unboundIf \"content.shouldDisplayTitle\"}}\n {{content.title}}\n {{/unboundIf}}\n ```\n\n @method unboundIf\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n @since 1.4.0\n */\n function unboundIfHelper(property, fn) {\n var context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : this,\n data = fn.data,\n template = fn.fn,\n inverse = fn.inverse,\n normalized, propertyValue, result;\n\n normalized = normalizePath(context, property, data);\n propertyValue = handlebarsGet(context, property, fn);\n\n if (!shouldDisplayIfHelperContent(propertyValue)) {\n template = inverse;\n }\n\n template(context, { data: data });\n }\n\n /**\n Use the `{{with}}` helper when you want to scope context. Take the following code as an example:\n\n ```handlebars\n <h5>{{user.name}}</h5>\n\n <div class=\"role\">\n <h6>{{user.role.label}}</h6>\n <span class=\"role-id\">{{user.role.id}}</span>\n\n <p class=\"role-desc\">{{user.role.description}}</p>\n </div>\n ```\n\n `{{with}}` can be our best friend in these cases,\n instead of writing `user.role.*` over and over, we use `{{#with user.role}}`.\n Now the context within the `{{#with}} .. {{/with}}` block is `user.role` so you can do the following:\n\n ```handlebars\n <h5>{{user.name}}</h5>\n\n <div class=\"role\">\n {{#with user.role}}\n <h6>{{label}}</h6>\n <span class=\"role-id\">{{id}}</span>\n\n <p class=\"role-desc\">{{description}}</p>\n {{/with}}\n </div>\n ```\n\n ### `as` operator\n\n This operator aliases the scope to a new name. It's helpful for semantic clarity and to retain\n default scope or to reference from another `{{with}}` block.\n\n ```handlebars\n // posts might not be\n {{#with user.posts as blogPosts}}\n <div class=\"notice\">\n There are {{blogPosts.length}} blog posts written by {{user.name}}.\n </div>\n\n {{#each post in blogPosts}}\n <li>{{post.title}}</li>\n {{/each}}\n {{/with}}\n ```\n\n Without the `as` operator, it would be impossible to reference `user.name` in the example above.\n\n NOTE: The alias should not reuse a name from the bound property path.\n For example: `{{#with foo.bar as foo}}` is not supported because it attempts to alias using\n the first part of the property path, `foo`. Instead, use `{{#with foo.bar as baz}}`.\n\n ### `controller` option\n\n Adding `controller='something'` instructs the `{{with}}` helper to create and use an instance of\n the specified controller with the new context as its content.\n\n This is very similar to using an `itemController` option with the `{{each}}` helper.\n\n ```handlebars\n {{#with users.posts controller='userBlogPosts'}}\n {{!- The current context is wrapped in our controller instance }}\n {{/with}}\n ```\n\n In the above example, the template provided to the `{{with}}` block is now wrapped in the\n `userBlogPost` controller, which provides a very elegant way to decorate the context with custom\n functions/properties.\n\n @method with\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n */\n function withHelper(context, options) {\n var bindContext, preserveContext, controller, helperName = 'with';\n\n if (arguments.length === 4) {\n var keywordName, path, rootPath, normalized, contextPath;\n\n Ember.assert(\"If you pass more than one argument to the with helper, it must be in the form #with foo as bar\", arguments[1] === \"as\");\n options = arguments[3];\n keywordName = arguments[2];\n path = arguments[0];\n\n if (path) {\n helperName += ' ' + path + ' as ' + keywordName;\n }\n\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n var localizedOptions = o_create(options);\n localizedOptions.data = o_create(options.data);\n localizedOptions.data.keywords = o_create(options.data.keywords || {});\n\n if (isGlobalPath(path)) {\n contextPath = path;\n } else {\n normalized = normalizePath(this, path, options.data);\n path = normalized.path;\n rootPath = normalized.root;\n\n // This is a workaround for the fact that you cannot bind separate objects\n // together. When we implement that functionality, we should use it here.\n var contextKey = jQuery.expando + guidFor(rootPath);\n localizedOptions.data.keywords[contextKey] = rootPath;\n // if the path is '' (\"this\"), just bind directly to the current context\n contextPath = path ? contextKey + '.' + path : contextKey;\n }\n\n localizedOptions.hash.keywordName = keywordName;\n localizedOptions.hash.keywordPath = contextPath;\n\n bindContext = this;\n context = path;\n options = localizedOptions;\n preserveContext = true;\n } else {\n Ember.assert(\"You must pass exactly one argument to the with helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n helperName += ' ' + context;\n bindContext = options.contexts[0];\n preserveContext = false;\n }\n\n options.helperName = helperName;\n options.isWithHelper = true;\n\n return bind.call(bindContext, context, options, preserveContext, exists);\n }\n /**\n See [boundIf](/api/classes/Ember.Handlebars.helpers.html#method_boundIf)\n and [unboundIf](/api/classes/Ember.Handlebars.helpers.html#method_unboundIf)\n\n @method if\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n */\n function ifHelper(context, options) {\n Ember.assert(\"You must pass exactly one argument to the if helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the if helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n options.helperName = options.helperName || ('if ' + context);\n\n if (options.data.isUnbound) {\n return helpers.unboundIf.call(options.contexts[0], context, options);\n } else {\n return helpers.boundIf.call(options.contexts[0], context, options);\n }\n }\n\n /**\n @method unless\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n */\n function unlessHelper(context, options) {\n Ember.assert(\"You must pass exactly one argument to the unless helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the unless helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n var fn = options.fn, inverse = options.inverse, helperName = 'unless';\n\n if (context) {\n helperName += ' ' + context;\n }\n\n options.fn = inverse;\n options.inverse = fn;\n\n options.helperName = options.helperName || helperName;\n\n if (options.data.isUnbound) {\n return helpers.unboundIf.call(options.contexts[0], context, options);\n } else {\n return helpers.boundIf.call(options.contexts[0], context, options);\n }\n }\n\n /**\n `bind-attr` allows you to create a binding between DOM element attributes and\n Ember objects. For example:\n\n ```handlebars\n <img {{bind-attr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n The above handlebars template will fill the `<img>`'s `src` attribute will\n the value of the property referenced with `\"imageUrl\"` and its `alt`\n attribute with the value of the property referenced with `\"imageTitle\"`.\n\n If the rendering context of this template is the following object:\n\n ```javascript\n {\n imageUrl: 'http://lolcats.info/haz-a-funny',\n imageTitle: 'A humorous image of a cat'\n }\n ```\n\n The resulting HTML output will be:\n\n ```html\n <img src=\"http://lolcats.info/haz-a-funny\" alt=\"A humorous image of a cat\">\n ```\n\n `bind-attr` cannot redeclare existing DOM element attributes. The use of `src`\n in the following `bind-attr` example will be ignored and the hard coded value\n of `src=\"/failwhale.gif\"` will take precedence:\n\n ```handlebars\n <img src=\"/failwhale.gif\" {{bind-attr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n ### `bind-attr` and the `class` attribute\n\n `bind-attr` supports a special syntax for handling a number of cases unique\n to the `class` DOM element attribute. The `class` attribute combines\n multiple discrete values into a single attribute as a space-delimited\n list of strings. Each string can be:\n\n * a string return value of an object's property.\n * a boolean return value of an object's property\n * a hard-coded value\n\n A string return value works identically to other uses of `bind-attr`. The\n return value of the property will become the value of the attribute. For\n example, the following view and template:\n\n ```javascript\n AView = View.extend({\n someProperty: function() {\n return \"aValue\";\n }.property()\n })\n ```\n\n ```handlebars\n <img {{bind-attr class=\"view.someProperty}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"aValue\">\n ```\n\n A boolean return value will insert a specified class name if the property\n returns `true` and remove the class name if the property returns `false`.\n\n A class name is provided via the syntax\n `somePropertyName:class-name-if-true`.\n\n ```javascript\n AView = View.extend({\n someBool: true\n })\n ```\n\n ```handlebars\n <img {{bind-attr class=\"view.someBool:class-name-if-true\"}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"class-name-if-true\">\n ```\n\n An additional section of the binding can be provided if you want to\n replace the existing class instead of removing it when the boolean\n value changes:\n\n ```handlebars\n <img {{bind-attr class=\"view.someBool:class-name-if-true:class-name-if-false\"}}>\n ```\n\n A hard-coded value can be used by prepending `:` to the desired\n class name: `:class-name-to-always-apply`.\n\n ```handlebars\n <img {{bind-attr class=\":class-name-to-always-apply\"}}>\n ```\n\n Results in the following rendered output:\n\n ```html\n <img class=\"class-name-to-always-apply\">\n ```\n\n All three strategies - string return value, boolean return value, and\n hard-coded value – can be combined in a single declaration:\n\n ```handlebars\n <img {{bind-attr class=\":class-name-to-always-apply view.someBool:class-name-if-true view.someProperty\"}}>\n ```\n\n @method bind-attr\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n */\n function bindAttrHelper(options) {\n var attrs = options.hash;\n\n Ember.assert(\"You must specify at least one hash argument to bind-attr\", !!keys(attrs).length);\n\n var view = options.data.view;\n var ret = [];\n\n // we relied on the behavior of calling without\n // context to mean this === window, but when running\n // \"use strict\", it's possible for this to === undefined;\n var ctx = this || window;\n\n // Generate a unique id for this element. This will be added as a\n // data attribute to the element so it can be looked up when\n // the bound property changes.\n var dataId = ++Ember.uuid;\n\n // Handle classes differently, as we can bind multiple classes\n var classBindings = attrs['class'];\n if (classBindings != null) {\n var classResults = bindClasses(ctx, classBindings, view, dataId, options);\n\n ret.push('class=\"' + Handlebars.Utils.escapeExpression(classResults.join(' ')) + '\"');\n delete attrs['class'];\n }\n\n var attrKeys = keys(attrs);\n\n // For each attribute passed, create an observer and emit the\n // current value of the property as an attribute.\n forEach.call(attrKeys, function(attr) {\n var path = attrs[attr],\n normalized;\n\n Ember.assert(fmt(\"You must provide an expression as the value of bound attribute. You specified: %@=%@\", [attr, path]), typeof path === 'string');\n\n normalized = normalizePath(ctx, path, options.data);\n\n var value = (path === 'this') ? normalized.root : handlebarsGet(ctx, path, options),\n type = typeOf(value);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [value]), value === null || value === undefined || type === 'number' || type === 'string' || type === 'boolean');\n\n var observer, invoker;\n\n observer = function observer() {\n var result = handlebarsGet(ctx, path, options);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [result]),\n result === null || result === undefined || typeof result === 'number' ||\n typeof result === 'string' || typeof result === 'boolean');\n\n var elem = view.$(\"[data-bindattr-\" + dataId + \"='\" + dataId + \"']\");\n\n // If we aren't able to find the element, it means the element\n // to which we were bound has been removed from the view.\n // In that case, we can assume the template has been re-rendered\n // and we need to clean up the observer.\n if (!elem || elem.length === 0) {\n removeObserver(normalized.root, normalized.path, invoker);\n return;\n }\n\n View.applyAttributeBindings(elem, attr, result);\n };\n\n // Add an observer to the view for when the property changes.\n // When the observer fires, find the element using the\n // unique data id and update the attribute to the new value.\n // Note: don't add observer when path is 'this' or path\n // is whole keyword e.g. {{#each x in list}} ... {{bind-attr attr=\"x\"}}\n if (path !== 'this' && !(normalized.isKeyword && normalized.path === '' )) {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n\n // if this changes, also change the logic in ember-views/lib/views/view.js\n if ((type === 'string' || (type === 'number' && !isNaN(value)))) {\n ret.push(attr + '=\"' + Handlebars.Utils.escapeExpression(value) + '\"');\n } else if (value && type === 'boolean') {\n // The developer controls the attr name, so it should always be safe\n ret.push(attr + '=\"' + attr + '\"');\n }\n }, this);\n\n // Add the unique identifier\n // NOTE: We use all lower-case since Firefox has problems with mixed case in SVG\n ret.push('data-bindattr-' + dataId + '=\"' + dataId + '\"');\n return new SafeString(ret.join(' '));\n }\n\n /**\n See `bind-attr`\n\n @method bindAttr\n @for Ember.Handlebars.helpers\n @deprecated\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n */\n function bindAttrHelperDeprecated() {\n Ember.warn(\"The 'bindAttr' view helper is deprecated in favor of 'bind-attr'\");\n return helpers['bind-attr'].apply(this, arguments);\n }\n\n /**\n Helper that, given a space-separated string of property paths and a context,\n returns an array of class names. Calling this method also has the side\n effect of setting up observers at those property paths, such that if they\n change, the correct class name will be reapplied to the DOM element.\n\n For example, if you pass the string \"fooBar\", it will first look up the\n \"fooBar\" value of the context. If that value is true, it will add the\n \"foo-bar\" class to the current element (i.e., the dasherized form of\n \"fooBar\"). If the value is a string, it will add that string as the class.\n Otherwise, it will not add any new class name.\n\n @private\n @method bindClasses\n @for Ember.Handlebars\n @param {Ember.Object} context The context from which to lookup properties\n @param {String} classBindings A string, space-separated, of class bindings\n to use\n @param {View} view The view in which observers should look for the\n element to update\n @param {Srting} bindAttrId Optional bindAttr id used to lookup elements\n @return {Array} An array of class names to add\n */\n function bindClasses(context, classBindings, view, bindAttrId, options) {\n var ret = [], newClass, value, elem;\n\n // Helper method to retrieve the property from the context and\n // determine which class string to return, based on whether it is\n // a Boolean or not.\n var classStringForPath = function(root, parsedPath, options) {\n var val,\n path = parsedPath.path;\n\n if (path === 'this') {\n val = root;\n } else if (path === '') {\n val = true;\n } else {\n val = handlebarsGet(root, path, options);\n }\n\n return View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n };\n\n // For each property passed, loop through and setup\n // an observer.\n forEach.call(classBindings.split(' '), function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n\n var observer, invoker;\n\n var parsedPath = View._parsePropertyPath(binding),\n path = parsedPath.path,\n pathRoot = context,\n normalized;\n\n if (path !== '' && path !== 'this') {\n normalized = normalizePath(context, path, options.data);\n\n pathRoot = normalized.root;\n path = normalized.path;\n }\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n observer = function() {\n // Get the current value of the property\n newClass = classStringForPath(context, parsedPath, options);\n elem = bindAttrId ? view.$(\"[data-bindattr-\" + bindAttrId + \"='\" + bindAttrId + \"']\") : view.$();\n\n // If we can't find the element anymore, a parent template has been\n // re-rendered and we've been nuked. Remove the observer.\n if (!elem || elem.length === 0) {\n removeObserver(pathRoot, path, invoker);\n } else {\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n }\n };\n\n if (path !== '' && path !== 'this') {\n view.registerObserver(pathRoot, path, observer);\n }\n\n // We've already setup the observer; now we just need to figure out the\n // correct behavior right now on the first pass through.\n value = classStringForPath(context, parsedPath, options);\n\n if (value) {\n ret.push(value);\n\n // Make sure we save the current value so that it can be removed if the\n // observer fires.\n oldClass = value;\n }\n });\n\n return ret;\n };\n\n __exports__.bind = bind;\n __exports__._triageMustacheHelper = _triageMustacheHelper;\n __exports__.resolveHelper = resolveHelper;\n __exports__.bindHelper = bindHelper;\n __exports__.boundIfHelper = boundIfHelper;\n __exports__.unboundIfHelper = unboundIfHelper;\n __exports__.withHelper = withHelper;\n __exports__.ifHelper = ifHelper;\n __exports__.unlessHelper = unlessHelper;\n __exports__.bindAttrHelper = bindAttrHelper;\n __exports__.bindAttrHelperDeprecated = bindAttrHelperDeprecated;\n __exports__.bindClasses = bindClasses;\n });\ndefine(\"ember-handlebars/helpers/collection\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-handlebars-compiler\",\"ember-runtime/system/string\",\"ember-metal/property_get\",\"ember-handlebars/ext\",\"ember-handlebars/helpers/view\",\"ember-metal/computed\",\"ember-views/views/collection_view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.deprecate\n var inspect = __dependency2__.inspect;\n\n // var emberAssert = Ember.assert;\n // emberDeprecate = Ember.deprecate;\n\n var EmberHandlebars = __dependency3__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n\n var fmt = __dependency4__.fmt;\n var get = __dependency5__.get;\n var handlebarsGet = __dependency6__.handlebarsGet;\n var ViewHelper = __dependency7__.ViewHelper;\n var computed = __dependency8__.computed;\n var CollectionView = __dependency9__[\"default\"];\n\n var alias = computed.alias;\n /**\n `{{collection}}` is a `Ember.Handlebars` helper for adding instances of\n `Ember.CollectionView` to a template. See [Ember.CollectionView](/api/classes/Ember.CollectionView.html)\n for additional information on how a `CollectionView` functions.\n\n `{{collection}}`'s primary use is as a block helper with a `contentBinding`\n option pointing towards an `Ember.Array`-compatible object. An `Ember.View`\n instance will be created for each item in its `content` property. Each view\n will have its own `content` property set to the appropriate item in the\n collection.\n\n The provided block will be applied as the template for each item's view.\n\n Given an empty `<body>` the following template:\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n And the following application code\n\n ```javascript\n App = Ember.Application.create()\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Hi Dave</div>\n <div class=\"ember-view\">Hi Mary</div>\n <div class=\"ember-view\">Hi Sara</div>\n </div>\n ```\n\n ### Blockless use in a collection\n\n If you provide an `itemViewClass` option that has its own `template` you can\n omit the block.\n\n The following template:\n\n ```handlebars\n {{collection contentBinding=\"App.items\" itemViewClass=\"App.AnItemView\"}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create();\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ];\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{view.content.name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n ### Specifying a CollectionView subclass\n\n By default the `{{collection}}` helper will create an instance of\n `Ember.CollectionView`. You can supply a `Ember.CollectionView` subclass to\n the helper by passing it as the first argument:\n\n ```handlebars\n {{#collection App.MyCustomCollectionClass contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n ### Forwarded `item.*`-named Options\n\n As with the `{{view}}`, helper options passed to the `{{collection}}` will be\n set on the resulting `Ember.CollectionView` as properties. Additionally,\n options prefixed with `item` will be applied to the views rendered for each\n item (note the camelcasing):\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"\n itemTagName=\"p\"\n itemClassNames=\"greeting\"}}\n Howdy {{view.content.name}}\n {{/collection}}\n ```\n\n Will result in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <p class=\"ember-view greeting\">Howdy Dave</p>\n <p class=\"ember-view greeting\">Howdy Mary</p>\n <p class=\"ember-view greeting\">Howdy Sara</p>\n </div>\n ```\n\n @method collection\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n @deprecated Use `{{each}}` helper instead.\n */\n function collectionHelper(path, options) {\n Ember.deprecate(\"Using the {{collection}} helper without specifying a class has been deprecated as the {{each}} helper now supports the same functionality.\", path !== 'collection');\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = undefined;\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 1);\n } else {\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 2);\n }\n\n var fn = options.fn;\n var data = options.data;\n var inverse = options.inverse;\n var view = options.data.view;\n\n\n var controller, container;\n // If passed a path string, convert that into an object.\n // Otherwise, just default to the standard class.\n var collectionClass;\n if (path) {\n controller = data.keywords.controller;\n container = controller && controller.container;\n collectionClass = handlebarsGet(this, path, options) || container.lookupFactory('view:' + path);\n Ember.assert(fmt(\"%@ #collection: Could not find collection class %@\", [data.view, path]), !!collectionClass);\n }\n else {\n collectionClass = CollectionView;\n }\n\n var hash = options.hash, itemHash = {}, match;\n\n // Extract item view class if provided else default to the standard class\n var collectionPrototype = collectionClass.proto(), itemViewClass;\n\n if (hash.itemView) {\n controller = data.keywords.controller;\n Ember.assert('You specified an itemView, but the current context has no ' +\n 'container to look the itemView up in. This probably means ' +\n 'that you created a view manually, instead of through the ' +\n 'container. Instead, use container.lookup(\"view:viewName\"), ' +\n 'which will properly instantiate your view.',\n controller && controller.container);\n container = controller.container;\n itemViewClass = container.lookupFactory('view:' + hash.itemView);\n Ember.assert('You specified the itemView ' + hash.itemView + \", but it was \" +\n \"not found at \" + container.describe(\"view:\" + hash.itemView) +\n \" (and it was not registered in the container)\", !!itemViewClass);\n } else if (hash.itemViewClass) {\n itemViewClass = handlebarsGet(collectionPrototype, hash.itemViewClass, options);\n } else {\n itemViewClass = collectionPrototype.itemViewClass;\n }\n\n Ember.assert(fmt(\"%@ #collection: Could not find itemViewClass %@\", [data.view, itemViewClass]), !!itemViewClass);\n\n delete hash.itemViewClass;\n delete hash.itemView;\n\n // Go through options passed to the {{collection}} helper and extract options\n // that configure item views instead of the collection itself.\n for (var prop in hash) {\n if (hash.hasOwnProperty(prop)) {\n match = prop.match(/^item(.)(.*)$/);\n\n if (match && prop !== 'itemController') {\n // Convert itemShouldFoo -> shouldFoo\n itemHash[match[1].toLowerCase() + match[2]] = hash[prop];\n // Delete from hash as this will end up getting passed to the\n // {{view}} helper method.\n delete hash[prop];\n }\n }\n }\n\n if (fn) {\n itemHash.template = fn;\n delete options.fn;\n }\n\n var emptyViewClass;\n if (inverse && inverse !== EmberHandlebars.VM.noop) {\n emptyViewClass = get(collectionPrototype, 'emptyViewClass');\n emptyViewClass = emptyViewClass.extend({\n template: inverse,\n tagName: itemHash.tagName\n });\n } else if (hash.emptyViewClass) {\n emptyViewClass = handlebarsGet(this, hash.emptyViewClass, options);\n }\n if (emptyViewClass) { hash.emptyView = emptyViewClass; }\n\n if (hash.keyword) {\n itemHash._context = this;\n } else {\n itemHash._context = alias('content');\n }\n\n var viewOptions = ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);\n hash.itemViewClass = itemViewClass.extend(viewOptions);\n\n options.helperName = options.helperName || 'collection';\n\n return helpers.view.call(this, collectionClass, options);\n }\n\n __exports__[\"default\"] = collectionHelper;\n });\ndefine(\"ember-handlebars/helpers/debug\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/logger\",\"ember-metal/property_get\",\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n /*jshint debug:true*/\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.FEATURES,\n var inspect = __dependency2__.inspect;\n var Logger = __dependency3__[\"default\"];\n\n var get = __dependency4__.get;\n var normalizePath = __dependency5__.normalizePath;\n var handlebarsGet = __dependency5__.handlebarsGet;\n\n var a_slice = [].slice;\n\n /**\n `log` allows you to output the value of variables in the current rendering\n context. `log` also accepts primitive types such as strings or numbers.\n\n ```handlebars\n {{log \"myVariable:\" myVariable }}\n ```\n\n @method log\n @for Ember.Handlebars.helpers\n @param {String} property\n */\n function logHelper() {\n var params = a_slice.call(arguments, 0, -1),\n options = arguments[arguments.length - 1],\n logger = Logger.log,\n values = [],\n allowPrimitives = true;\n\n for (var i = 0; i < params.length; i++) {\n var type = options.types[i];\n\n if (type === 'ID' || !allowPrimitives) {\n var context = (options.contexts && options.contexts[i]) || this,\n normalized = normalizePath(context, params[i], options.data);\n\n if (normalized.path === 'this') {\n values.push(normalized.root);\n } else {\n values.push(handlebarsGet(normalized.root, normalized.path, options));\n }\n } else {\n values.push(params[i]);\n }\n }\n\n logger.apply(logger, values);\n };\n\n /**\n Execute the `debugger` statement in the current context.\n\n ```handlebars\n {{debugger}}\n ```\n\n Before invoking the `debugger` statement, there\n are a few helpful variables defined in the\n body of this helper that you can inspect while\n debugging that describe how and where this\n helper was invoked:\n\n - templateContext: this is most likely a controller\n from which this template looks up / displays properties\n - typeOfTemplateContext: a string description of\n what the templateContext is\n\n For example, if you're wondering why a value `{{foo}}`\n isn't rendering as expected within a template, you\n could place a `{{debugger}}` statement, and when\n the `debugger;` breakpoint is hit, you can inspect\n `templateContext`, determine if it's the object you\n expect, and/or evaluate expressions in the console\n to perform property lookups on the `templateContext`:\n\n ```\n > templateContext.get('foo') // -> \"<value of {{foo}}>\"\n ```\n\n @method debugger\n @for Ember.Handlebars.helpers\n @param {String} property\n */\n function debuggerHelper(options) {\n\n // These are helpful values you can inspect while debugging.\n var templateContext = this;\n var typeOfTemplateContext = inspect(templateContext);\n\n debugger;\n }\n\n __exports__.logHelper = logHelper;\n __exports__.debuggerHelper = debuggerHelper;\n });\ndefine(\"ember-handlebars/helpers/each\",\n [\"ember-metal/core\",\"ember-handlebars-compiler\",\"ember-runtime/system/string\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-handlebars/views/metamorph_view\",\"ember-views/views/collection_view\",\"ember-metal/binding\",\"ember-runtime/controllers/controller\",\"ember-runtime/controllers/array_controller\",\"ember-runtime/mixins/array\",\"ember-runtime/copy\",\"ember-metal/run_loop\",\"ember-metal/observer\",\"ember-metal/events\",\"ember-handlebars/ext\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __exports__) {\n \"use strict\";\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.assert;, Ember.K\n // var emberAssert = Ember.assert,\n var K = Ember.K;\n\n var EmberHandlebars = __dependency2__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n\n var fmt = __dependency3__.fmt;\n var get = __dependency4__.get;\n var set = __dependency5__.set;\n var _Metamorph = __dependency6__._Metamorph;\n var _MetamorphView = __dependency6__._MetamorphView;\n var CollectionView = __dependency7__[\"default\"];\n var Binding = __dependency8__.Binding;\n var ControllerMixin = __dependency9__.ControllerMixin;\n var ArrayController = __dependency10__[\"default\"];\n var EmberArray = __dependency11__[\"default\"];\n var copy = __dependency12__[\"default\"];\n var run = __dependency13__[\"default\"];\n var addObserver = __dependency14__.addObserver;\n var removeObserver = __dependency14__.removeObserver;\n var addBeforeObserver = __dependency14__.addBeforeObserver;\n var removeBeforeObserver = __dependency14__.removeBeforeObserver;\n var on = __dependency15__.on;\n var handlebarsGet = __dependency16__.handlebarsGet;\n var computed = __dependency17__.computed;\n\n var handlebarsGet = __dependency16__.handlebarsGet;\n\n var EachView = CollectionView.extend(_Metamorph, {\n\n init: function() {\n var itemController = get(this, 'itemController');\n var binding;\n\n if (itemController) {\n var controller = get(this, 'controller.container').lookupFactory('controller:array').create({\n _isVirtual: true,\n parentController: get(this, 'controller'),\n itemController: itemController,\n target: get(this, 'controller'),\n _eachView: this\n });\n\n this.disableContentObservers(function() {\n set(this, 'content', controller);\n binding = new Binding('content', '_eachView.dataSource').oneWay();\n binding.connect(controller);\n });\n\n set(this, '_arrayController', controller);\n } else {\n this.disableContentObservers(function() {\n binding = new Binding('content', 'dataSource').oneWay();\n binding.connect(this);\n });\n }\n\n return this._super();\n },\n\n _assertArrayLike: function(content) {\n Ember.assert(fmt(\"The value that #each loops over must be an Array. You \" +\n \"passed %@, but it should have been an ArrayController\",\n [content.constructor]),\n !ControllerMixin.detect(content) ||\n (content && content.isGenerated) ||\n content instanceof ArrayController);\n Ember.assert(fmt(\"The value that #each loops over must be an Array. You passed %@\", [(ControllerMixin.detect(content) && content.get('model') !== undefined) ? fmt(\"'%@' (wrapped in %@)\", [content.get('model'), content]) : content]), EmberArray.detect(content));\n },\n\n disableContentObservers: function(callback) {\n removeBeforeObserver(this, 'content', null, '_contentWillChange');\n removeObserver(this, 'content', null, '_contentDidChange');\n\n callback.call(this);\n\n addBeforeObserver(this, 'content', null, '_contentWillChange');\n addObserver(this, 'content', null, '_contentDidChange');\n },\n\n itemViewClass: _MetamorphView,\n emptyViewClass: _MetamorphView,\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n // At the moment, if a container view subclass wants\n // to insert keywords, it is responsible for cloning\n // the keywords hash. This will be fixed momentarily.\n var keyword = get(this, 'keyword');\n var content = get(view, 'content');\n\n if (keyword) {\n var data = get(view, 'templateData');\n\n data = copy(data);\n data.keywords = view.cloneKeywords();\n set(view, 'templateData', data);\n\n // In this case, we do not bind, because the `content` of\n // a #each item cannot change.\n data.keywords[keyword] = content;\n }\n\n // If {{#each}} is looping over an array of controllers,\n // point each child view at their respective controller.\n if (content && content.isController) {\n set(view, 'controller', content);\n }\n\n return view;\n },\n\n destroy: function() {\n if (!this._super()) { return; }\n\n var arrayController = get(this, '_arrayController');\n\n if (arrayController) {\n arrayController.destroy();\n }\n\n return this;\n }\n });\n\n // Defeatureify doesn't seem to like nested functions that need to be removed\n function _addMetamorphCheck() {\n EachView.reopen({\n _checkMetamorph: on('didInsertElement', function() {\n Ember.assert(\"The metamorph tags, \" +\n this.morph.start + \" and \" + this.morph.end +\n \", have different parents.\\nThe browser has fixed your template to output valid HTML (for example, check that you have properly closed all tags and have used a TBODY tag when creating a table with '{{#each}}')\",\n document.getElementById( this.morph.start ).parentNode ===\n document.getElementById( this.morph.end ).parentNode\n );\n })\n });\n }\n\n // until ember-debug is es6ed\n var runInDebug = function(f){f()};\n runInDebug( function() {\n _addMetamorphCheck();\n });\n\n var GroupedEach = EmberHandlebars.GroupedEach = function(context, path, options) {\n var self = this,\n normalized = EmberHandlebars.normalizePath(context, path, options.data);\n\n this.context = context;\n this.path = path;\n this.options = options;\n this.template = options.fn;\n this.containingView = options.data.view;\n this.normalizedRoot = normalized.root;\n this.normalizedPath = normalized.path;\n this.content = this.lookupContent();\n\n this.addContentObservers();\n this.addArrayObservers();\n\n this.containingView.on('willClearRender', function() {\n self.destroy();\n });\n };\n\n GroupedEach.prototype = {\n contentWillChange: function() {\n this.removeArrayObservers();\n },\n\n contentDidChange: function() {\n this.content = this.lookupContent();\n this.addArrayObservers();\n this.rerenderContainingView();\n },\n\n contentArrayWillChange: K,\n\n contentArrayDidChange: function() {\n this.rerenderContainingView();\n },\n\n lookupContent: function() {\n return handlebarsGet(this.normalizedRoot, this.normalizedPath, this.options);\n },\n\n addArrayObservers: function() {\n if (!this.content) { return; }\n\n this.content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n removeArrayObservers: function() {\n if (!this.content) { return; }\n\n this.content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n addContentObservers: function() {\n addBeforeObserver(this.normalizedRoot, this.normalizedPath, this, this.contentWillChange);\n addObserver(this.normalizedRoot, this.normalizedPath, this, this.contentDidChange);\n },\n\n removeContentObservers: function() {\n removeBeforeObserver(this.normalizedRoot, this.normalizedPath, this.contentWillChange);\n removeObserver(this.normalizedRoot, this.normalizedPath, this.contentDidChange);\n },\n\n render: function() {\n if (!this.content) { return; }\n\n var content = this.content,\n contentLength = get(content, 'length'),\n data = this.options.data,\n template = this.template;\n\n data.insideEach = true;\n for (var i = 0; i < contentLength; i++) {\n template(content.objectAt(i), { data: data });\n }\n },\n\n rerenderContainingView: function() {\n var self = this;\n run.scheduleOnce('render', this, function() {\n // It's possible it's been destroyed after we enqueued a re-render call.\n if (!self.destroyed) {\n self.containingView.rerender();\n }\n });\n },\n\n destroy: function() {\n this.removeContentObservers();\n if (this.content) {\n this.removeArrayObservers();\n }\n this.destroyed = true;\n }\n };\n\n /**\n The `{{#each}}` helper loops over elements in a collection, rendering its\n block once for each item. It is an extension of the base Handlebars `{{#each}}`\n helper:\n\n ```javascript\n Developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}];\n ```\n\n ```handlebars\n {{#each Developers}}\n {{name}}\n {{/each}}\n ```\n\n `{{each}}` supports an alternative syntax with element naming:\n\n ```handlebars\n {{#each person in Developers}}\n {{person.name}}\n {{/each}}\n ```\n\n When looping over objects that do not have properties, `{{this}}` can be used\n to render the object:\n\n ```javascript\n DeveloperNames = ['Yehuda', 'Tom', 'Paul']\n ```\n\n ```handlebars\n {{#each DeveloperNames}}\n {{this}}\n {{/each}}\n ```\n ### {{else}} condition\n `{{#each}}` can have a matching `{{else}}`. The contents of this block will render\n if the collection is empty.\n\n ```\n {{#each person in Developers}}\n {{person.name}}\n {{else}}\n <p>Sorry, nobody is available for this task.</p>\n {{/each}}\n ```\n ### Specifying a View class for items\n If you provide an `itemViewClass` option that references a view class\n with its own `template` you can omit the block.\n\n The following template:\n\n ```handlebars\n {{#view App.MyView }}\n {{each view.items itemViewClass=\"App.AnItemView\"}}\n {{/view}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create({\n MyView: Ember.View.extend({\n items: [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n })\n });\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n If an `itemViewClass` is defined on the helper, and therefore the helper is not\n being used as a block, an `emptyViewClass` can also be provided optionally.\n The `emptyViewClass` will match the behavior of the `{{else}}` condition\n described above. That is, the `emptyViewClass` will render if the collection\n is empty.\n\n ### Representing each item with a Controller.\n By default the controller lookup within an `{{#each}}` block will be\n the controller of the template where the `{{#each}}` was used. If each\n item needs to be presented by a custom controller you can provide a\n `itemController` option which references a controller by lookup name.\n Each item in the loop will be wrapped in an instance of this controller\n and the item itself will be set to the `content` property of that controller.\n\n This is useful in cases where properties of model objects need transformation\n or synthesis for display:\n\n ```javascript\n App.DeveloperController = Ember.ObjectController.extend({\n isAvailableForHire: function() {\n return !this.get('content.isEmployed') && this.get('content.isSeekingWork');\n }.property('isEmployed', 'isSeekingWork')\n })\n ```\n\n ```handlebars\n {{#each person in developers itemController=\"developer\"}}\n {{person.name}} {{#if person.isAvailableForHire}}Hire me!{{/if}}\n {{/each}}\n ```\n\n Each itemController will receive a reference to the current controller as\n a `parentController` property.\n\n ### (Experimental) Grouped Each\n\n When used in conjunction with the experimental [group helper](https://github.com/emberjs/group-helper),\n you can inform Handlebars to re-render an entire group of items instead of\n re-rendering them one at a time (in the event that they are changed en masse\n or an item is added/removed).\n\n ```handlebars\n {{#group}}\n {{#each people}}\n {{firstName}} {{lastName}}\n {{/each}}\n {{/group}}\n ```\n\n This can be faster than the normal way that Handlebars re-renders items\n in some cases.\n\n If for some reason you have a group with more than one `#each`, you can make\n one of the collections be updated in normal (non-grouped) fashion by setting\n the option `groupedRows=true` (counter-intuitive, I know).\n\n For example,\n\n ```handlebars\n {{dealershipName}}\n\n {{#group}}\n {{#each dealers}}\n {{firstName}} {{lastName}}\n {{/each}}\n\n {{#each car in cars groupedRows=true}}\n {{car.make}} {{car.model}} {{car.color}}\n {{/each}}\n {{/group}}\n ```\n Any change to `dealershipName` or the `dealers` collection will cause the\n entire group to be re-rendered. However, changes to the `cars` collection\n will be re-rendered individually (as normal).\n\n Note that `group` behavior is also disabled by specifying an `itemViewClass`.\n\n @method each\n @for Ember.Handlebars.helpers\n @param [name] {String} name for item (used with `in`)\n @param [path] {String} path\n @param [options] {Object} Handlebars key/value pairs of options\n @param [options.itemViewClass] {String} a path to a view class used for each item\n @param [options.itemController] {String} name of a controller to be created for each item\n @param [options.groupedRows] {boolean} enable normal item-by-item rendering when inside a `#group` helper\n */\n function eachHelper(path, options) {\n var ctx, helperName = 'each';\n\n if (arguments.length === 4) {\n Ember.assert(\"If you pass more than one argument to the each helper, it must be in the form #each foo in bar\", arguments[1] === \"in\");\n\n var keywordName = arguments[0];\n\n\n options = arguments[3];\n path = arguments[2];\n\n helperName += ' ' + keywordName + ' in ' + path;\n\n if (path === '') { path = \"this\"; }\n\n options.hash.keyword = keywordName;\n\n } else if (arguments.length === 1) {\n options = path;\n path = 'this';\n } else {\n helperName += ' ' + path;\n }\n\n options.hash.dataSourceBinding = path;\n // Set up emptyView as a metamorph with no tag\n //options.hash.emptyViewClass = Ember._MetamorphView;\n\n // can't rely on this default behavior when use strict\n ctx = this || window;\n\n options.helperName = options.helperName || helperName;\n\n if (options.data.insideGroup && !options.hash.groupedRows && !options.hash.itemViewClass) {\n new GroupedEach(ctx, path, options).render();\n } else {\n // ES6TODO: figure out how to do this without global lookup.\n return helpers.collection.call(ctx, 'Ember.Handlebars.EachView', options);\n }\n }\n\n __exports__.EachView = EachView;\n __exports__.GroupedEach = GroupedEach;\n __exports__.eachHelper = eachHelper;\n });\ndefine(\"ember-handlebars/helpers/loc\",\n [\"ember-runtime/system/string\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var loc = __dependency1__.loc;\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n // ES6TODO:\n // Pretty sure this can be expressed as\n // var locHelper EmberStringUtils.loc ?\n\n /**\n Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the\n provided string.\n\n This is a convenient way to localize text. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"home\">\n {{loc \"welcome\"}}\n </script>\n ```\n\n Take note that `\"welcome\"` is a string and not an object\n reference.\n\n See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to \n set up localized string references.\n\n @method loc\n @for Ember.Handlebars.helpers\n @param {String} str The string to format\n @see {Ember.String#loc}\n */\n function locHelper(str) {\n return loc(str);\n }\n\n __exports__[\"default\"] = locHelper;\n });\ndefine(\"ember-handlebars/helpers/partial\",\n [\"ember-metal/core\",\"ember-metal/is_none\",\"ember-handlebars/ext\",\"ember-handlebars/helpers/binding\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n // var emberAssert = Ember.assert;\n\n var isNone = __dependency2__.isNone;\n var handlebarsGet = __dependency3__.handlebarsGet;\n var bind = __dependency4__.bind;\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n /**\n The `partial` helper renders another template without\n changing the template context:\n\n ```handlebars\n {{foo}}\n {{partial \"nav\"}}\n ```\n\n The above example template will render a template named\n \"_nav\", which has the same context as the parent template\n it's rendered into, so if the \"_nav\" template also referenced\n `{{foo}}`, it would print the same thing as the `{{foo}}`\n in the above example.\n\n If a \"_nav\" template isn't found, the `partial` helper will\n fall back to a template named \"nav\".\n\n ## Bound template names\n\n The parameter supplied to `partial` can also be a path\n to a property containing a template name, e.g.:\n\n ```handlebars\n {{partial someTemplateName}}\n ```\n\n The above example will look up the value of `someTemplateName`\n on the template context (e.g. a controller) and use that\n value as the name of the template to render. If the resolved\n value is falsy, nothing will be rendered. If `someTemplateName`\n changes, the partial will be re-rendered using the new template\n name.\n\n ## Setting the partial's context with `with`\n\n The `partial` helper can be used in conjunction with the `with`\n helper to set a context that will be used by the partial:\n\n ```handlebars\n {{#with currentUser}}\n {{partial \"user_info\"}}\n {{/with}}\n ```\n\n @method partial\n @for Ember.Handlebars.helpers\n @param {String} partialName the name of the template to render minus the leading underscore\n */\n\n function partialHelper(name, options) {\n\n var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this;\n\n options.helperName = options.helperName || 'partial';\n\n if (options.types[0] === \"ID\") {\n // Helper was passed a property path; we need to\n // create a binding that will re-render whenever\n // this property changes.\n options.fn = function(context, fnOptions) {\n var partialName = handlebarsGet(context, name, fnOptions);\n renderPartial(context, partialName, fnOptions);\n };\n\n return bind.call(context, name, options, true, exists);\n } else {\n // Render the partial right into parent template.\n renderPartial(context, name, options);\n }\n }\n\n function exists(value) {\n return !isNone(value);\n }\n\n function renderPartial(context, name, options) {\n var nameParts = name.split(\"/\");\n var lastPart = nameParts[nameParts.length - 1];\n\n nameParts[nameParts.length - 1] = \"_\" + lastPart;\n\n var view = options.data.view;\n var underscoredName = nameParts.join(\"/\");\n var template = view.templateForName(underscoredName);\n var deprecatedTemplate = !template && view.templateForName(name);\n\n Ember.assert(\"Unable to find partial with name '\"+name+\"'.\", template || deprecatedTemplate);\n\n template = template || deprecatedTemplate;\n\n template(context, { data: options.data });\n }\n\n __exports__[\"default\"] = partialHelper;\n });\ndefine(\"ember-handlebars/helpers/shared\",\n [\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var handlebarsGet = __dependency1__.handlebarsGet;\n\n function resolvePaths(options) {\n var ret = [],\n contexts = options.contexts,\n roots = options.roots,\n data = options.data;\n\n for (var i=0, l=contexts.length; i<l; i++) {\n ret.push( handlebarsGet(roots[i], contexts[i], { data: data }) );\n }\n\n return ret;\n }\n\n __exports__[\"default\"] = resolvePaths;\n });\ndefine(\"ember-handlebars/helpers/template\",\n [\"ember-metal/core\",\"ember-handlebars-compiler\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // var emberDeprecate = Ember.deprecate;\n\n var EmberHandlebars = __dependency2__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n /**\n `template` allows you to render a template from inside another template.\n This allows you to re-use the same template in multiple places. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"logged_in_user\">\n {{#with loggedInUser}}\n Last Login: {{lastLogin}}\n User Info: {{template \"user_info\"}}\n {{/with}}\n </script>\n ```\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"user_info\">\n Name: <em>{{name}}</em>\n Karma: <em>{{karma}}</em>\n </script>\n ```\n\n ```handlebars\n {{#if isUser}}\n {{template \"user_info\"}}\n {{else}}\n {{template \"unlogged_user_info\"}}\n {{/if}}\n ```\n\n This helper looks for templates in the global `Ember.TEMPLATES` hash. If you\n add `<script>` tags to your page with the `data-template-name` attribute set,\n they will be compiled and placed in this hash automatically.\n\n You can also manually register templates by adding them to the hash:\n\n ```javascript\n Ember.TEMPLATES[\"my_cool_template\"] = Ember.Handlebars.compile('<b>{{user}}</b>');\n ```\n\n @deprecated\n @method template\n @for Ember.Handlebars.helpers\n @param {String} templateName the template to render\n */\n function templateHelper(name, options) {\n Ember.deprecate(\"The `template` helper has been deprecated in favor of the `partial` helper. Please use `partial` instead, which will work the same way.\");\n\n options.helperName = options.helperName || 'template';\n\n return helpers.partial.apply(this, arguments);\n }\n\n __exports__[\"default\"] = templateHelper;\n });\ndefine(\"ember-handlebars/helpers/unbound\",\n [\"ember-handlebars-compiler\",\"ember-handlebars/helpers/binding\",\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /*globals Handlebars */\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var EmberHandlebars = __dependency1__[\"default\"];\n var helpers = EmberHandlebars.helpers;\n\n var resolveHelper = __dependency2__.resolveHelper;\n var handlebarsGet = __dependency3__.handlebarsGet;\n\n var slice = [].slice;\n\n /**\n `unbound` allows you to output a property without binding. *Important:* The\n output will not be updated if the property changes. Use with caution.\n\n ```handlebars\n <div>{{unbound somePropertyThatDoesntChange}}</div>\n ```\n\n `unbound` can also be used in conjunction with a bound helper to\n render it in its unbound form:\n\n ```handlebars\n <div>{{unbound helperName somePropertyThatDoesntChange}}</div>\n ```\n\n @method unbound\n @for Ember.Handlebars.helpers\n @param {String} property\n @return {String} HTML string\n */\n function unboundHelper(property, fn) {\n var options = arguments[arguments.length - 1],\n container = options.data.view.container,\n helper, context, out, ctx;\n\n ctx = this;\n if (arguments.length > 2) {\n // Unbound helper call.\n options.data.isUnbound = true;\n helper = resolveHelper(container, property) || helpers.helperMissing;\n out = helper.apply(ctx, slice.call(arguments, 1));\n delete options.data.isUnbound;\n return out;\n }\n\n context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : ctx;\n return handlebarsGet(context, property, fn);\n }\n\n __exports__[\"default\"] = unboundHelper;\n });\ndefine(\"ember-handlebars/helpers/view\",\n [\"ember-metal/core\",\"ember-runtime/system/object\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/mixin\",\"ember-views/system/jquery\",\"ember-views/views/view\",\"ember-metal/binding\",\"ember-handlebars/ext\",\"ember-runtime/system/string\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n /*globals Handlebars */\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.warn, Ember.assert\n // var emberWarn = Ember.warn, emberAssert = Ember.assert;\n\n var EmberObject = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var IS_BINDING = __dependency5__.IS_BINDING;\n var jQuery = __dependency6__[\"default\"];\n var View = __dependency7__.View;\n var isGlobalPath = __dependency8__.isGlobalPath;\n var normalizePath = __dependency9__.normalizePath;\n var handlebarsGet = __dependency9__.handlebarsGet;\n var EmberString = __dependency10__[\"default\"];\n\n\n var LOWERCASE_A_Z = /^[a-z]/,\n VIEW_PREFIX = /^view\\./;\n\n function makeBindings(thisContext, options) {\n var hash = options.hash,\n hashType = options.hashTypes;\n\n for (var prop in hash) {\n if (hashType[prop] === 'ID') {\n\n var value = hash[prop];\n\n if (IS_BINDING.test(prop)) {\n Ember.warn(\"You're attempting to render a view by passing \" + prop + \"=\" + value + \" to a view helper, but this syntax is ambiguous. You should either surround \" + value + \" in quotes or remove `Binding` from \" + prop + \".\");\n } else {\n hash[prop + 'Binding'] = value;\n hashType[prop + 'Binding'] = 'STRING';\n delete hash[prop];\n delete hashType[prop];\n }\n }\n }\n\n if (hash.hasOwnProperty('idBinding')) {\n // id can't be bound, so just perform one-time lookup.\n hash.id = handlebarsGet(thisContext, hash.idBinding, options);\n hashType.id = 'STRING';\n delete hash.idBinding;\n delete hashType.idBinding;\n }\n }\n\n var ViewHelper = EmberObject.create({\n\n propertiesFromHTMLOptions: function(options) {\n var hash = options.hash, data = options.data;\n var extensions = {},\n classes = hash['class'],\n dup = false;\n\n if (hash.id) {\n extensions.elementId = hash.id;\n dup = true;\n }\n\n if (hash.tag) {\n extensions.tagName = hash.tag;\n dup = true;\n }\n\n if (classes) {\n classes = classes.split(' ');\n extensions.classNames = classes;\n dup = true;\n }\n\n if (hash.classBinding) {\n extensions.classNameBindings = hash.classBinding.split(' ');\n dup = true;\n }\n\n if (hash.classNameBindings) {\n if (extensions.classNameBindings === undefined) extensions.classNameBindings = [];\n extensions.classNameBindings = extensions.classNameBindings.concat(hash.classNameBindings.split(' '));\n dup = true;\n }\n\n if (hash.attributeBindings) {\n Ember.assert(\"Setting 'attributeBindings' via Handlebars is not allowed. Please subclass Ember.View and set it there instead.\");\n extensions.attributeBindings = null;\n dup = true;\n }\n\n if (dup) {\n hash = jQuery.extend({}, hash);\n delete hash.id;\n delete hash.tag;\n delete hash['class'];\n delete hash.classBinding;\n }\n\n // Set the proper context for all bindings passed to the helper. This applies to regular attribute bindings\n // as well as class name bindings. If the bindings are local, make them relative to the current context\n // instead of the view.\n var path;\n\n // Evaluate the context of regular attribute bindings:\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n\n // Test if the property ends in \"Binding\"\n if (IS_BINDING.test(prop) && typeof hash[prop] === 'string') {\n path = this.contextualizeBindingPath(hash[prop], data);\n if (path) { hash[prop] = path; }\n }\n }\n\n // Evaluate the context of class name bindings:\n if (extensions.classNameBindings) {\n for (var b in extensions.classNameBindings) {\n var full = extensions.classNameBindings[b];\n if (typeof full === 'string') {\n // Contextualize the path of classNameBinding so this:\n //\n // classNameBinding=\"isGreen:green\"\n //\n // is converted to this:\n //\n // classNameBinding=\"_parentView.context.isGreen:green\"\n var parsedPath = View._parsePropertyPath(full);\n path = this.contextualizeBindingPath(parsedPath.path, data);\n if (path) { extensions.classNameBindings[b] = path + parsedPath.classNames; }\n }\n }\n }\n\n return jQuery.extend(hash, extensions);\n },\n\n // Transform bindings from the current context to a context that can be evaluated within the view.\n // Returns null if the path shouldn't be changed.\n //\n // TODO: consider the addition of a prefix that would allow this method to return `path`.\n contextualizeBindingPath: function(path, data) {\n var normalized = normalizePath(null, path, data);\n if (normalized.isKeyword) {\n return 'templateData.keywords.' + path;\n } else if (isGlobalPath(path)) {\n return null;\n } else if (path === 'this' || path === '') {\n return '_parentView.context';\n } else {\n return '_parentView.context.' + path;\n }\n },\n\n helper: function(thisContext, path, options) {\n var data = options.data,\n fn = options.fn,\n newView;\n\n makeBindings(thisContext, options);\n\n if ('string' === typeof path) {\n\n // TODO: this is a lame conditional, this should likely change\n // but something along these lines will likely need to be added\n // as deprecation warnings\n //\n if (options.types[0] === 'STRING' && LOWERCASE_A_Z.test(path) && !VIEW_PREFIX.test(path)) {\n Ember.assert(\"View requires a container\", !!data.view.container);\n newView = data.view.container.lookupFactory('view:' + path);\n } else {\n newView = handlebarsGet(thisContext, path, options);\n }\n\n Ember.assert(\"Unable to find view at path '\" + path + \"'\", !!newView);\n } else {\n newView = path;\n }\n\n Ember.assert(EmberString.fmt('You must pass a view to the #view helper, not %@ (%@)', [path, newView]), View.detect(newView) || View.detectInstance(newView));\n\n var viewOptions = this.propertiesFromHTMLOptions(options, thisContext);\n var currentView = data.view;\n viewOptions.templateData = data;\n var newViewProto = newView.proto ? newView.proto() : newView;\n\n if (fn) {\n Ember.assert(\"You cannot provide a template block if you also specified a templateName\", !get(viewOptions, 'templateName') && !get(newViewProto, 'templateName'));\n viewOptions.template = fn;\n }\n\n // We only want to override the `_context` computed property if there is\n // no specified controller. See View#_context for more information.\n if (!newViewProto.controller && !newViewProto.controllerBinding && !viewOptions.controller && !viewOptions.controllerBinding) {\n viewOptions._context = thisContext;\n }\n\n // for instrumentation\n if (options.helperName) {\n viewOptions.helperName = options.helperName;\n }\n\n currentView.appendChild(newView, viewOptions);\n }\n });\n\n /**\n `{{view}}` inserts a new instance of `Ember.View` into a template passing its\n options to the `Ember.View`'s `create` method and using the supplied block as\n the view's own template.\n\n An empty `<body>` and the following template:\n\n ```handlebars\n A span:\n {{#view tagName=\"span\"}}\n hello.\n {{/view}}\n ```\n\n Will result in HTML structure:\n\n ```html\n <body>\n <!-- Note: the handlebars template script\n also results in a rendered Ember.View\n which is the outer <div> here -->\n\n <div class=\"ember-view\">\n A span:\n <span id=\"ember1\" class=\"ember-view\">\n Hello.\n </span>\n </div>\n </body>\n ```\n\n ### `parentView` setting\n\n The `parentView` property of the new `Ember.View` instance created through\n `{{view}}` will be set to the `Ember.View` instance of the template where\n `{{view}}` was called.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile(\"{{#view}} my parent: {{parentView.elementId}} {{/view}}\")\n });\n\n aView.appendTo('body');\n ```\n\n Will result in HTML structure:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view\">\n my parent: ember1\n </div>\n </div>\n ```\n\n ### Setting CSS id and class attributes\n\n The HTML `id` attribute can be set on the `{{view}}`'s resulting element with\n the `id` option. This option will _not_ be passed to `Ember.View.create`.\n\n ```handlebars\n {{#view tagName=\"span\" id=\"a-custom-id\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"a-custom-id\" class=\"ember-view\">\n hello.\n </span>\n </div>\n ```\n\n The HTML `class` attribute can be set on the `{{view}}`'s resulting element\n with the `class` or `classNameBindings` options. The `class` option will\n directly set the CSS `class` attribute and will not be passed to\n `Ember.View.create`. `classNameBindings` will be passed to `create` and use\n `Ember.View`'s class name binding functionality:\n\n ```handlebars\n {{#view tagName=\"span\" class=\"a-custom-class\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"ember2\" class=\"ember-view a-custom-class\">\n hello.\n </span>\n </div>\n ```\n\n ### Supplying a different view class\n\n `{{view}}` can take an optional first argument before its supplied options to\n specify a path to a custom view class.\n\n ```handlebars\n {{#view \"MyApp.CustomView\"}}\n hello.\n {{/view}}\n ```\n\n The first argument can also be a relative path accessible from the current\n context.\n\n ```javascript\n MyApp = Ember.Application.create({});\n MyApp.OuterView = Ember.View.extend({\n innerViewClass: Ember.View.extend({\n classNames: ['a-custom-view-class-as-property']\n }),\n template: Ember.Handlebars.compile('{{#view \"view.innerViewClass\"}} hi {{/view}}')\n });\n\n MyApp.OuterView.create().appendTo('body');\n ```\n\n Will result in the following HTML:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view a-custom-view-class-as-property\">\n hi\n </div>\n </div>\n ```\n\n ### Blockless use\n\n If you supply a custom `Ember.View` subclass that specifies its own template\n or provide a `templateName` option to `{{view}}` it can be used without\n supplying a block. Attempts to use both a `templateName` option and supply a\n block will throw an error.\n\n ```handlebars\n {{view \"MyApp.ViewWithATemplateDefined\"}}\n ```\n\n ### `viewName` property\n\n You can supply a `viewName` option to `{{view}}`. The `Ember.View` instance\n will be referenced as a property of its parent view by this name.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile('{{#view viewName=\"aChildByName\"}} hi {{/view}}')\n });\n\n aView.appendTo('body');\n aView.get('aChildByName') // the instance of Ember.View created by {{view}} helper\n ```\n\n @method view\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n */\n function viewHelper(path, options) {\n Ember.assert(\"The view helper only takes a single argument\", arguments.length <= 2);\n\n // If no path is provided, treat path param as options.\n // ES6TODO: find a way to do this without global lookup\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = \"Ember.View\";\n }\n\n options.helperName = options.helperName || 'view';\n\n return ViewHelper.helper(this, path, options);\n }\n\n __exports__.ViewHelper = ViewHelper;\n __exports__.viewHelper = viewHelper;\n });\ndefine(\"ember-handlebars/helpers/yield\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Ember = __dependency1__[\"default\"];\n // var emberAssert = Ember.assert;\n\n var get = __dependency2__.get;\n\n /**\n `{{yield}}` denotes an area of a template that will be rendered inside\n of another template. It has two main uses:\n\n ### Use with `layout`\n When used in a Handlebars template that is assigned to an `Ember.View`\n instance's `layout` property Ember will render the layout template first,\n inserting the view's own rendered output at the `{{yield}}` location.\n\n An empty `<body>` and the following application code:\n\n ```javascript\n AView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n layout: Ember.Handlebars.compile('<div class=\"wrapper\">{{yield}}</div>'),\n template: Ember.Handlebars.compile('<span>I am wrapped</span>')\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will result in the following HTML output:\n\n ```html\n <body>\n <div class='ember-view a-view-with-layout'>\n <div class=\"wrapper\">\n <span>I am wrapped</span>\n </div>\n </div>\n </body>\n ```\n\n The `yield` helper cannot be used outside of a template assigned to an\n `Ember.View`'s `layout` property and will throw an error if attempted.\n\n ```javascript\n BView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n template: Ember.Handlebars.compile('{{yield}}')\n });\n\n bView = BView.create();\n bView.appendTo('body');\n\n // throws\n // Uncaught Error: assertion failed:\n // You called yield in a template that was not a layout\n ```\n\n ### Use with Ember.Component\n When designing components `{{yield}}` is used to denote where, inside the component's\n template, an optional block passed to the component should render:\n\n ```handlebars\n <!-- application.hbs -->\n {{#labeled-textfield value=someProperty}}\n First name:\n {{/labeled-textfield}}\n ```\n\n ```handlebars\n <!-- components/labeled-textfield.hbs -->\n <label>\n {{yield}} {{input value=value}}\n </label>\n ```\n\n Result:\n\n ```html\n <label>\n First name: <input type=\"text\" />\n </label>\n ```\n\n @method yield\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n */\n function yieldHelper(options) {\n var view = options.data.view;\n\n while (view && !get(view, 'layout')) {\n if (view._contextView) {\n view = view._contextView;\n } else {\n view = get(view, '_parentView');\n }\n }\n\n Ember.assert(\"You called yield in a template that was not a layout\", !!view);\n\n view._yield(this, options);\n }\n\n __exports__[\"default\"] = yieldHelper;\n });\ndefine(\"ember-handlebars/loader\",\n [\"ember-handlebars/component_lookup\",\"ember-views/system/jquery\",\"ember-metal/error\",\"ember-runtime/system/lazy_load\",\"ember-handlebars-compiler\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n /*globals Handlebars */\n\n var ComponentLookup = __dependency1__[\"default\"];\n var jQuery = __dependency2__[\"default\"];\n var EmberError = __dependency3__[\"default\"];\n var onLoad = __dependency4__.onLoad;\n\n var EmberHandlebars = __dependency5__[\"default\"];\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n /**\n Find templates stored in the head tag as script tags and make them available\n to `Ember.CoreView` in the global `Ember.TEMPLATES` object. This will be run\n as as jQuery DOM-ready callback.\n\n Script tags with `text/x-handlebars` will be compiled\n with Ember's Handlebars and are suitable for use as a view's template.\n Those with type `text/x-raw-handlebars` will be compiled with regular\n Handlebars and are suitable for use in views' computed properties.\n\n @private\n @method bootstrap\n @for Ember.Handlebars\n @static\n @param ctx\n */\n function bootstrap(ctx) {\n var selectors = 'script[type=\"text/x-handlebars\"], script[type=\"text/x-raw-handlebars\"]';\n\n jQuery(selectors, ctx)\n .each(function() {\n // Get a reference to the script tag\n var script = jQuery(this);\n\n var compile = (script.attr('type') === 'text/x-raw-handlebars') ?\n jQuery.proxy(Handlebars.compile, Handlebars) :\n jQuery.proxy(EmberHandlebars.compile, EmberHandlebars),\n // Get the name of the script, used by Ember.View's templateName property.\n // First look for data-template-name attribute, then fall back to its\n // id if no name is found.\n templateName = script.attr('data-template-name') || script.attr('id') || 'application',\n template = compile(script.html());\n\n // Check if template of same name already exists\n if (Ember.TEMPLATES[templateName] !== undefined) {\n throw new EmberError('Template named \"' + templateName + '\" already exists.');\n }\n\n // For templates which have a name, we save them and then remove them from the DOM\n Ember.TEMPLATES[templateName] = template;\n\n // Remove script tag from DOM\n script.remove();\n });\n };\n\n function _bootstrap() {\n bootstrap( jQuery(document) );\n }\n\n function registerComponentLookup(container) {\n container.register('component-lookup:main', ComponentLookup);\n }\n\n /*\n We tie this to application.load to ensure that we've at least\n attempted to bootstrap at the point that the application is loaded.\n\n We also tie this to document ready since we're guaranteed that all\n the inline templates are present at this point.\n\n There's no harm to running this twice, since we remove the templates\n from the DOM after processing.\n */\n\n onLoad('Ember.Application', function(Application) {\n Application.initializer({\n name: 'domTemplates',\n initialize: _bootstrap\n });\n\n Application.initializer({\n name: 'registerComponentLookup',\n after: 'domTemplates',\n initialize: registerComponentLookup\n });\n });\n\n __exports__[\"default\"] = bootstrap;\n });\ndefine(\"ember-handlebars\",\n [\"ember-handlebars-compiler\",\"ember-metal/core\",\"ember-runtime/system/lazy_load\",\"ember-handlebars/loader\",\"ember-handlebars/ext\",\"ember-handlebars/string\",\"ember-handlebars/helpers/shared\",\"ember-handlebars/helpers/binding\",\"ember-handlebars/helpers/collection\",\"ember-handlebars/helpers/view\",\"ember-handlebars/helpers/unbound\",\"ember-handlebars/helpers/debug\",\"ember-handlebars/helpers/each\",\"ember-handlebars/helpers/template\",\"ember-handlebars/helpers/partial\",\"ember-handlebars/helpers/yield\",\"ember-handlebars/helpers/loc\",\"ember-handlebars/controls/checkbox\",\"ember-handlebars/controls/select\",\"ember-handlebars/controls/text_area\",\"ember-handlebars/controls/text_field\",\"ember-handlebars/controls/text_support\",\"ember-handlebars/controls\",\"ember-handlebars/component_lookup\",\"ember-handlebars/views/handlebars_bound_view\",\"ember-handlebars/views/metamorph_view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __exports__) {\n \"use strict\";\n var EmberHandlebars = __dependency1__[\"default\"];\n var Ember = __dependency2__[\"default\"];\n // to add to globals\n\n var runLoadHooks = __dependency3__.runLoadHooks;\n var bootstrap = __dependency4__[\"default\"];\n\n var normalizePath = __dependency5__.normalizePath;\n var template = __dependency5__.template;\n var makeBoundHelper = __dependency5__.makeBoundHelper;\n var registerBoundHelper = __dependency5__.registerBoundHelper;\n var resolveHash = __dependency5__.resolveHash;\n var resolveParams = __dependency5__.resolveParams;\n var getEscaped = __dependency5__.getEscaped;\n var handlebarsGet = __dependency5__.handlebarsGet;\n var evaluateUnboundHelper = __dependency5__.evaluateUnboundHelper;\n var helperMissingHelper = __dependency5__.helperMissingHelper;\n var blockHelperMissingHelper = __dependency5__.blockHelperMissingHelper;\n\n\n // side effect of extending StringUtils of htmlSafe\n\n var resolvePaths = __dependency7__[\"default\"];\n var bind = __dependency8__.bind;\n var _triageMustacheHelper = __dependency8__._triageMustacheHelper;\n var resolveHelper = __dependency8__.resolveHelper;\n var bindHelper = __dependency8__.bindHelper;\n var boundIfHelper = __dependency8__.boundIfHelper;\n var unboundIfHelper = __dependency8__.unboundIfHelper;\n var withHelper = __dependency8__.withHelper;\n var ifHelper = __dependency8__.ifHelper;\n var unlessHelper = __dependency8__.unlessHelper;\n var bindAttrHelper = __dependency8__.bindAttrHelper;\n var bindAttrHelperDeprecated = __dependency8__.bindAttrHelperDeprecated;\n var bindClasses = __dependency8__.bindClasses;\n\n var collectionHelper = __dependency9__[\"default\"];\n var ViewHelper = __dependency10__.ViewHelper;\n var viewHelper = __dependency10__.viewHelper;\n var unboundHelper = __dependency11__[\"default\"];\n var logHelper = __dependency12__.logHelper;\n var debuggerHelper = __dependency12__.debuggerHelper;\n var EachView = __dependency13__.EachView;\n var GroupedEach = __dependency13__.GroupedEach;\n var eachHelper = __dependency13__.eachHelper;\n\n var templateHelper = __dependency14__[\"default\"];\n var partialHelper = __dependency15__[\"default\"];\n var yieldHelper = __dependency16__[\"default\"];\n var locHelper = __dependency17__[\"default\"];\n\n\n var Checkbox = __dependency18__[\"default\"];\n var Select = __dependency19__.Select;\n var SelectOption = __dependency19__.SelectOption;\n var SelectOptgroup = __dependency19__.SelectOptgroup;\n var TextArea = __dependency20__[\"default\"];\n var TextField = __dependency21__[\"default\"];\n var TextSupport = __dependency22__[\"default\"];\n var TextSupport = __dependency22__[\"default\"];\n var inputHelper = __dependency23__.inputHelper;\n var textareaHelper = __dependency23__.textareaHelper;var ComponentLookup = __dependency24__[\"default\"];\n var _HandlebarsBoundView = __dependency25__._HandlebarsBoundView;\n var SimpleHandlebarsView = __dependency25__.SimpleHandlebarsView;\n var _SimpleMetamorphView = __dependency26__._SimpleMetamorphView;\n var _MetamorphView = __dependency26__._MetamorphView;\n var _Metamorph = __dependency26__._Metamorph;\n\n /**\n Ember Handlebars\n\n @module ember\n @submodule ember-handlebars\n @requires ember-views\n */\n\n // Ember.Handlebars.Globals\n EmberHandlebars.bootstrap = bootstrap;\n EmberHandlebars.template = template;\n EmberHandlebars.makeBoundHelper = makeBoundHelper;\n EmberHandlebars.registerBoundHelper = registerBoundHelper;\n EmberHandlebars.resolveHash = resolveHash;\n EmberHandlebars.resolveParams = resolveParams;\n EmberHandlebars.resolveHelper = resolveHelper;\n EmberHandlebars.get = handlebarsGet;\n EmberHandlebars.getEscaped = getEscaped;\n EmberHandlebars.evaluateUnboundHelper = evaluateUnboundHelper;\n EmberHandlebars.bind = bind;\n EmberHandlebars.bindClasses = bindClasses;\n EmberHandlebars.EachView = EachView;\n EmberHandlebars.GroupedEach = GroupedEach;\n EmberHandlebars.resolvePaths = resolvePaths;\n EmberHandlebars.ViewHelper = ViewHelper;\n EmberHandlebars.normalizePath = normalizePath;\n\n\n // Ember Globals\n Ember.Handlebars = EmberHandlebars;\n Ember.ComponentLookup = ComponentLookup;\n Ember._SimpleHandlebarsView = SimpleHandlebarsView;\n Ember._HandlebarsBoundView = _HandlebarsBoundView;\n Ember._SimpleMetamorphView = _SimpleMetamorphView;\n Ember._MetamorphView = _MetamorphView;\n Ember._Metamorph = _Metamorph;\n Ember.TextSupport = TextSupport;\n Ember.Checkbox = Checkbox;\n Ember.Select = Select;\n Ember.SelectOption = SelectOption;\n Ember.SelectOptgroup = SelectOptgroup;\n Ember.TextArea = TextArea;\n Ember.TextField = TextField;\n Ember.TextSupport = TextSupport;\n\n // register helpers\n EmberHandlebars.registerHelper('helperMissing', helperMissingHelper);\n EmberHandlebars.registerHelper('blockHelperMissing', blockHelperMissingHelper);\n EmberHandlebars.registerHelper('bind', bindHelper);\n EmberHandlebars.registerHelper('boundIf', boundIfHelper);\n EmberHandlebars.registerHelper('_triageMustache', _triageMustacheHelper);\n EmberHandlebars.registerHelper('unboundIf', unboundIfHelper);\n EmberHandlebars.registerHelper('with', withHelper);\n EmberHandlebars.registerHelper('if', ifHelper);\n EmberHandlebars.registerHelper('unless', unlessHelper);\n EmberHandlebars.registerHelper('bind-attr', bindAttrHelper);\n EmberHandlebars.registerHelper('bindAttr', bindAttrHelperDeprecated);\n EmberHandlebars.registerHelper('collection', collectionHelper);\n EmberHandlebars.registerHelper(\"log\", logHelper);\n EmberHandlebars.registerHelper(\"debugger\", debuggerHelper);\n EmberHandlebars.registerHelper(\"each\", eachHelper);\n EmberHandlebars.registerHelper(\"loc\", locHelper);\n EmberHandlebars.registerHelper(\"partial\", partialHelper);\n EmberHandlebars.registerHelper(\"template\", templateHelper);\n EmberHandlebars.registerHelper(\"yield\", yieldHelper);\n EmberHandlebars.registerHelper(\"view\", viewHelper);\n EmberHandlebars.registerHelper(\"unbound\", unboundHelper);\n EmberHandlebars.registerHelper(\"input\", inputHelper);\n EmberHandlebars.registerHelper(\"textarea\", textareaHelper);\n\n // run load hooks\n runLoadHooks('Ember.Handlebars', EmberHandlebars);\n\n __exports__[\"default\"] = EmberHandlebars;\n });\ndefine(\"ember-handlebars/string\",\n [\"ember-runtime/system/string\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n // required so we can extend this object.\n var EmberStringUtils = __dependency1__[\"default\"];\n\n /**\n Mark a string as safe for unescaped output with Handlebars. If you\n return HTML from a Handlebars helper, use this function to\n ensure Handlebars does not escape the HTML.\n\n ```javascript\n Ember.String.htmlSafe('<div>someString</div>')\n ```\n\n @method htmlSafe\n @for Ember.String\n @static\n @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars\n */\n function htmlSafe(str) {\n return new Handlebars.SafeString(str);\n };\n\n EmberStringUtils.htmlSafe = htmlSafe;\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n Mark a string as being safe for unescaped output with Handlebars.\n\n ```javascript\n '<div>someString</div>'.htmlSafe()\n ```\n\n See [Ember.String.htmlSafe](/api/classes/Ember.String.html#method_htmlSafe).\n\n @method htmlSafe\n @for String\n @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars\n */\n String.prototype.htmlSafe = function() {\n return htmlSafe(this);\n };\n }\n\n __exports__[\"default\"] = htmlSafe;\n });\ndefine(\"ember-handlebars/views/handlebars_bound_view\",\n [\"ember-handlebars-compiler\",\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/merge\",\"ember-metal/run_loop\",\"ember-metal/computed\",\"ember-views/views/view\",\"ember-views/views/states\",\"ember-handlebars/views/metamorph_view\",\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n /*globals Handlebars */\n /*jshint newcap:false*/\n\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var EmberHandlebars = __dependency1__[\"default\"];\n // EmberHandlebars.SafeString;\n var SafeString = EmberHandlebars.SafeString;\n\n var Ember = __dependency2__[\"default\"];\n // Ember.K\n var K = Ember.K\n\n var Metamorph = requireModule('metamorph');\n\n var EmberError = __dependency3__[\"default\"];\n var get = __dependency4__.get;\n var set = __dependency5__.set;\n var merge = __dependency6__[\"default\"];\n var run = __dependency7__[\"default\"];\n var computed = __dependency8__.computed;\n var View = __dependency9__.View;\n var cloneStates = __dependency10__.cloneStates;\n var states = __dependency10__.states;\n var viewStates = states;\n\n var _MetamorphView = __dependency11__._MetamorphView;\n var handlebarsGet = __dependency12__.handlebarsGet;\n\n function SimpleHandlebarsView(path, pathRoot, isEscaped, templateData) {\n this.path = path;\n this.pathRoot = pathRoot;\n this.isEscaped = isEscaped;\n this.templateData = templateData;\n\n this.morph = Metamorph();\n this.state = 'preRender';\n this.updateId = null;\n this._parentView = null;\n this.buffer = null;\n }\n\n SimpleHandlebarsView.prototype = {\n isVirtual: true,\n isView: true,\n\n destroy: function () {\n if (this.updateId) {\n run.cancel(this.updateId);\n this.updateId = null;\n }\n if (this._parentView) {\n this._parentView.removeChild(this);\n }\n this.morph = null;\n this.state = 'destroyed';\n },\n\n propertyWillChange: K,\n\n propertyDidChange: K,\n\n normalizedValue: function() {\n var path = this.path,\n pathRoot = this.pathRoot,\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = this.templateData;\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return result;\n },\n\n renderToBuffer: function(buffer) {\n var string = '';\n\n string += this.morph.startTag();\n string += this.render();\n string += this.morph.endTag();\n\n buffer.push(string);\n },\n\n render: function() {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = this.isEscaped;\n var result = this.normalizedValue();\n\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n return result;\n },\n\n rerender: function() {\n switch(this.state) {\n case 'preRender':\n case 'destroyed':\n break;\n case 'inBuffer':\n throw new EmberError(\"Something you did tried to replace an {{expression}} before it was inserted into the DOM.\");\n case 'hasElement':\n case 'inDOM':\n this.updateId = run.scheduleOnce('render', this, 'update');\n break;\n }\n\n return this;\n },\n\n update: function () {\n this.updateId = null;\n this.morph.html(this.render());\n },\n\n transitionTo: function(state) {\n this.state = state;\n }\n };\n\n var states = cloneStates(viewStates);\n\n merge(states._default, {\n rerenderIfNeeded: K\n });\n\n merge(states.inDOM, {\n rerenderIfNeeded: function(view) {\n if (view.normalizedValue() !== view._lastNormalizedValue) {\n view.rerender();\n }\n }\n });\n\n /**\n `Ember._HandlebarsBoundView` is a private view created by the Handlebars\n `{{bind}}` helpers that is used to keep track of bound properties.\n\n Every time a property is bound using a `{{mustache}}`, an anonymous subclass\n of `Ember._HandlebarsBoundView` is created with the appropriate sub-template\n and context set up. When the associated property changes, just the template\n for this view will re-render.\n\n @class _HandlebarsBoundView\n @namespace Ember\n @extends Ember._MetamorphView\n @private\n */\n var _HandlebarsBoundView = _MetamorphView.extend({\n states: states,\n instrumentName: 'boundHandlebars',\n\n /**\n The function used to determine if the `displayTemplate` or\n `inverseTemplate` should be rendered. This should be a function that takes\n a value and returns a Boolean.\n\n @property shouldDisplayFunc\n @type Function\n @default null\n */\n shouldDisplayFunc: null,\n\n /**\n Whether the template rendered by this view gets passed the context object\n of its parent template, or gets passed the value of retrieving `path`\n from the `pathRoot`.\n\n For example, this is true when using the `{{#if}}` helper, because the\n template inside the helper should look up properties relative to the same\n object as outside the block. This would be `false` when used with `{{#with\n foo}}` because the template should receive the object found by evaluating\n `foo`.\n\n @property preserveContext\n @type Boolean\n @default false\n */\n preserveContext: false,\n\n /**\n If `preserveContext` is true, this is the object that will be used\n to render the template.\n\n @property previousContext\n @type Object\n */\n previousContext: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `true`.\n\n @property displayTemplate\n @type Function\n @default null\n */\n displayTemplate: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `false`.\n\n @property inverseTemplate\n @type Function\n @default null\n */\n inverseTemplate: null,\n\n\n /**\n The path to look up on `pathRoot` that is passed to\n `shouldDisplayFunc` to determine which template to render.\n\n In addition, if `preserveContext` is `false,` the object at this path will\n be passed to the template when rendering.\n\n @property path\n @type String\n @default null\n */\n path: null,\n\n /**\n The object from which the `path` will be looked up. Sometimes this is the\n same as the `previousContext`, but in cases where this view has been\n generated for paths that start with a keyword such as `view` or\n `controller`, the path root will be that resolved object.\n\n @property pathRoot\n @type Object\n */\n pathRoot: null,\n\n normalizedValue: function() {\n var path = get(this, 'path'),\n pathRoot = get(this, 'pathRoot'),\n valueNormalizer = get(this, 'valueNormalizerFunc'),\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = get(this, 'templateData');\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return valueNormalizer ? valueNormalizer(result) : result;\n },\n\n rerenderIfNeeded: function() {\n this.currentState.rerenderIfNeeded(this);\n },\n\n /**\n Determines which template to invoke, sets up the correct state based on\n that logic, then invokes the default `Ember.View` `render` implementation.\n\n This method will first look up the `path` key on `pathRoot`,\n then pass that value to the `shouldDisplayFunc` function. If that returns\n `true,` the `displayTemplate` function will be rendered to DOM. Otherwise,\n `inverseTemplate`, if specified, will be rendered.\n\n For example, if this `Ember._HandlebarsBoundView` represented the `{{#with\n foo}}` helper, it would look up the `foo` property of its context, and\n `shouldDisplayFunc` would always return true. The object found by looking\n up `foo` would be passed to `displayTemplate`.\n\n @method render\n @param {Ember.RenderBuffer} buffer\n */\n render: function(buffer) {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = get(this, 'isEscaped');\n\n var shouldDisplay = get(this, 'shouldDisplayFunc'),\n preserveContext = get(this, 'preserveContext'),\n context = get(this, 'previousContext');\n\n var inverseTemplate = get(this, 'inverseTemplate'),\n displayTemplate = get(this, 'displayTemplate');\n\n var result = this.normalizedValue();\n this._lastNormalizedValue = result;\n\n // First, test the conditional to see if we should\n // render the template or not.\n if (shouldDisplay(result)) {\n set(this, 'template', displayTemplate);\n\n // If we are preserving the context (for example, if this\n // is an #if block, call the template with the same object.\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n // Otherwise, determine if this is a block bind or not.\n // If so, pass the specified object to the template\n if (displayTemplate) {\n set(this, '_context', result);\n } else {\n // This is not a bind block, just push the result of the\n // expression to the render context and return.\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n buffer.push(result);\n return;\n }\n }\n } else if (inverseTemplate) {\n set(this, 'template', inverseTemplate);\n\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n set(this, '_context', result);\n }\n } else {\n set(this, 'template', function() { return ''; });\n }\n\n return this._super(buffer);\n }\n });\n\n __exports__._HandlebarsBoundView = _HandlebarsBoundView;\n __exports__.SimpleHandlebarsView = SimpleHandlebarsView;\n });\ndefine(\"ember-handlebars/views/metamorph_view\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/view\",\"ember-metal/mixin\",\"ember-metal/run_loop\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n /*jshint newcap:false*/\n var Ember = __dependency1__[\"default\"];\n // Ember.deprecate\n // var emberDeprecate = Ember.deprecate;\n\n var get = __dependency2__.get;\n var set = __dependency3__[\"default\"];\n\n var CoreView = __dependency4__.CoreView;\n var View = __dependency4__.View;\n var Mixin = __dependency5__.Mixin;\n var run = __dependency6__[\"default\"];\n\n /**\n @module ember\n @submodule ember-handlebars\n */\n\n var Metamorph = requireModule('metamorph');\n\n function notifyMutationListeners() {\n run.once(View, 'notifyMutationListeners');\n }\n\n // DOMManager should just abstract dom manipulation between jquery and metamorph\n var DOMManager = {\n remove: function(view) {\n view.morph.remove();\n notifyMutationListeners();\n },\n\n prepend: function(view, html) {\n view.morph.prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.morph.after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.morph.html(html);\n notifyMutationListeners();\n },\n\n // This is messed up.\n replace: function(view) {\n var morph = view.morph;\n\n view.transitionTo('preRender');\n\n run.schedule('render', this, function renderMetamorphView() {\n if (view.isDestroying) { return; }\n\n view.clearRenderedChildren();\n var buffer = view.renderToBuffer();\n\n view.invokeRecursively(function(view) {\n view.propertyWillChange('element');\n });\n view.triggerRecursively('willInsertElement');\n\n morph.replaceWith(buffer.string());\n view.transitionTo('inDOM');\n\n view.invokeRecursively(function(view) {\n view.propertyDidChange('element');\n });\n view.triggerRecursively('didInsertElement');\n\n notifyMutationListeners();\n });\n },\n\n empty: function(view) {\n view.morph.html(\"\");\n notifyMutationListeners();\n }\n };\n\n // The `morph` and `outerHTML` properties are internal only\n // and not observable.\n\n /**\n @class _Metamorph\n @namespace Ember\n @private\n */\n var _Metamorph = Mixin.create({\n isVirtual: true,\n tagName: '',\n\n instrumentName: 'metamorph',\n\n init: function() {\n this._super();\n this.morph = Metamorph();\n Ember.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated. You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName);\n },\n\n beforeRender: function(buffer) {\n buffer.push(this.morph.startTag());\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n buffer.push(this.morph.endTag());\n },\n\n createElement: function() {\n var buffer = this.renderToBuffer();\n this.outerHTML = buffer.string();\n this.clearBuffer();\n },\n\n domManager: DOMManager\n });\n\n /**\n @class _MetamorphView\n @namespace Ember\n @extends Ember.View\n @uses Ember._Metamorph\n @private\n */\n var _MetamorphView = View.extend(_Metamorph);\n\n /**\n @class _SimpleMetamorphView\n @namespace Ember\n @extends Ember.CoreView\n @uses Ember._Metamorph\n @private\n */\n var _SimpleMetamorphView = CoreView.extend(_Metamorph);\n\n __exports__._SimpleMetamorphView = _SimpleMetamorphView;\n __exports__._MetamorphView = _MetamorphView;\n __exports__._Metamorph = _Metamorph;\n });\n})();\n//@ sourceURL=ember-handlebars");minispade.register('ember-metal', "(function() {define(\"ember-metal/array\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /*jshint newcap:false*/\n /**\n @module ember-metal\n */\n\n var ArrayPrototype = Array.prototype;\n\n // NOTE: There is a bug in jshint that doesn't recognize `Object()` without `new`\n // as being ok unless both `newcap:false` and not `use strict`.\n // https://github.com/jshint/jshint/issues/392\n\n // Testing this is not ideal, but we want to use native functions\n // if available, but not to use versions created by libraries like Prototype\n var isNativeFunc = function(func) {\n // This should probably work in all browsers likely to have ES5 array methods\n return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1;\n };\n\n // From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/map\n var map = isNativeFunc(ArrayPrototype.map) ? ArrayPrototype.map : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var res = new Array(len);\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n res[i] = fun.call(thisp, t[i], i, t);\n }\n }\n\n return res;\n };\n\n // From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach\n var forEach = isNativeFunc(ArrayPrototype.forEach) ? ArrayPrototype.forEach : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n fun.call(thisp, t[i], i, t);\n }\n }\n };\n\n var indexOf = isNativeFunc(ArrayPrototype.indexOf) ? ArrayPrototype.indexOf : function (obj, fromIndex) {\n if (fromIndex === null || fromIndex === undefined) { fromIndex = 0; }\n else if (fromIndex < 0) { fromIndex = Math.max(0, this.length + fromIndex); }\n for (var i = fromIndex, j = this.length; i < j; i++) {\n if (this[i] === obj) { return i; }\n }\n return -1;\n };\n\n var filter = isNativeFunc(ArrayPrototype.filter) ? ArrayPrototype.filter : function (fn, context) {\n var i,\n value,\n result = [],\n length = this.length;\n\n for (i = 0; i < length; i++) {\n if (this.hasOwnProperty(i)) {\n value = this[i];\n if (fn.call(context, value, i, this)) {\n result.push(value);\n }\n }\n }\n return result;\n };\n\n\n if (Ember.SHIM_ES5) {\n if (!ArrayPrototype.map) {\n ArrayPrototype.map = map;\n }\n\n if (!ArrayPrototype.forEach) {\n ArrayPrototype.forEach = forEach;\n }\n\n if (!ArrayPrototype.filter) {\n ArrayPrototype.filter = filter;\n }\n\n if (!ArrayPrototype.indexOf) {\n ArrayPrototype.indexOf = indexOf;\n }\n }\n\n /**\n Array polyfills to support ES5 features in older browsers.\n\n @namespace Ember\n @property ArrayPolyfills\n */\n __exports__.map = map;\n __exports__.forEach = forEach;\n __exports__.filter = filter;\n __exports__.indexOf = indexOf;\n });\ndefine(\"ember-metal/binding\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/map\",\"ember-metal/observer\",\"ember-metal/run_loop\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.Logger, Ember.LOG_BINDINGS, assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var trySet = __dependency3__.trySet;\n var guidFor = __dependency4__.guidFor;\n var Map = __dependency5__.Map;\n var addObserver = __dependency6__.addObserver;\n var removeObserver = __dependency6__.removeObserver;\n var _suspendObserver = __dependency6__._suspendObserver;\n var run = __dependency7__[\"default\"];\n\n // ES6TODO: where is Ember.lookup defined?\n /**\n @module ember-metal\n */\n\n // ..........................................................\n // CONSTANTS\n //\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 Ember\n @type Boolean\n @default false\n */\n Ember.LOG_BINDINGS = false || !!Ember.ENV.LOG_BINDINGS;\n\n var IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;\n\n /**\n Returns true if the provided path is global (e.g., `MyApp.fooController.bar`)\n instead of local (`foo.bar.baz`).\n\n @method isGlobalPath\n @for Ember\n @private\n @param {String} path\n @return Boolean\n */\n function isGlobalPath(path) {\n return IS_GLOBAL.test(path);\n };\n\n function getWithGlobals(obj, path) {\n return get(isGlobalPath(path) ? Ember.lookup : obj, path);\n }\n\n // ..........................................................\n // BINDING\n //\n\n var Binding = function(toPath, fromPath) {\n this._direction = 'fwd';\n this._from = fromPath;\n this._to = toPath;\n this._directionMap = Map.create();\n };\n\n /**\n @class Binding\n @namespace Ember\n */\n\n Binding.prototype = {\n /**\n This copies the Binding so it can be connected to another object.\n\n @method copy\n @return {Ember.Binding} `this`\n */\n copy: function () {\n var copy = new Binding(this._to, this._from);\n if (this._oneWay) { copy._oneWay = true; }\n return copy;\n },\n\n // ..........................................................\n // CONFIG\n //\n\n /**\n This will set `from` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method from\n @param {String} path the property path to connect to\n @return {Ember.Binding} `this`\n */\n from: function(path) {\n this._from = path;\n return this;\n },\n\n /**\n This will set the `to` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method to\n @param {String|Tuple} path A property path or tuple\n @return {Ember.Binding} `this`\n */\n to: function(path) {\n this._to = path;\n return this;\n },\n\n /**\n Configures the binding as one way. A one-way binding will relay changes\n on the `from` side to the `to` side, but not the other way around. This\n means that if you change the `to` side directly, the `from` side may have\n a different value.\n\n @method oneWay\n @return {Ember.Binding} `this`\n */\n oneWay: function() {\n this._oneWay = true;\n return this;\n },\n\n /**\n @method toString\n @return {String} string representation of binding\n */\n toString: function() {\n var oneWay = this._oneWay ? '[oneWay]' : '';\n return \"Ember.Binding<\" + guidFor(this) + \">(\" + this._from + \" -> \" + this._to + \")\" + oneWay;\n },\n\n // ..........................................................\n // CONNECT AND SYNC\n //\n\n /**\n Attempts to connect this binding instance so that it can receive and relay\n changes. This method will raise an exception if you have not set the\n from/to properties yet.\n\n @method connect\n @param {Object} obj The root object for this binding.\n @return {Ember.Binding} `this`\n */\n connect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);\n\n var fromPath = this._from, toPath = this._to;\n trySet(obj, toPath, getWithGlobals(obj, fromPath));\n\n // add an observer on the object to be notified when the binding should be updated\n addObserver(obj, fromPath, this, this.fromDidChange);\n\n // if the binding is a two-way binding, also set up an observer on the target\n if (!this._oneWay) { addObserver(obj, toPath, this, this.toDidChange); }\n\n this._readyToSync = true;\n\n return this;\n },\n\n /**\n Disconnects the binding instance. Changes will no longer be relayed. You\n will not usually need to call this method.\n\n @method disconnect\n @param {Object} obj The root object you passed when connecting the binding.\n @return {Ember.Binding} `this`\n */\n disconnect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);\n\n var twoWay = !this._oneWay;\n\n // remove an observer on the object so we're no longer notified of\n // changes that should update bindings.\n removeObserver(obj, this._from, this, this.fromDidChange);\n\n // if the binding is two-way, remove the observer from the target as well\n if (twoWay) { removeObserver(obj, this._to, this, this.toDidChange); }\n\n this._readyToSync = false; // disable scheduled syncs...\n return this;\n },\n\n // ..........................................................\n // PRIVATE\n //\n\n /* called when the from side changes */\n fromDidChange: function(target) {\n this._scheduleSync(target, 'fwd');\n },\n\n /* called when the to side changes */\n toDidChange: function(target) {\n this._scheduleSync(target, 'back');\n },\n\n _scheduleSync: function(obj, dir) {\n var directionMap = this._directionMap;\n var existingDir = directionMap.get(obj);\n\n // if we haven't scheduled the binding yet, schedule it\n if (!existingDir) {\n run.schedule('sync', this, this._sync, obj);\n directionMap.set(obj, dir);\n }\n\n // If both a 'back' and 'fwd' sync have been scheduled on the same object,\n // default to a 'fwd' sync so that it remains deterministic.\n if (existingDir === 'back' && dir === 'fwd') {\n directionMap.set(obj, 'fwd');\n }\n },\n\n _sync: function(obj) {\n var log = Ember.LOG_BINDINGS;\n\n // don't synchronize destroyed objects or disconnected bindings\n if (obj.isDestroyed || !this._readyToSync) { return; }\n\n // get the direction of the binding for the object we are\n // synchronizing from\n var directionMap = this._directionMap;\n var direction = directionMap.get(obj);\n\n var fromPath = this._from, toPath = this._to;\n\n directionMap.remove(obj);\n\n // if we're synchronizing from the remote object...\n if (direction === 'fwd') {\n var fromValue = getWithGlobals(obj, this._from);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '->', fromValue, obj);\n }\n if (this._oneWay) {\n trySet(obj, toPath, fromValue);\n } else {\n _suspendObserver(obj, toPath, this, this.toDidChange, function () {\n trySet(obj, toPath, fromValue);\n });\n }\n // if we're synchronizing *to* the remote object\n } else if (direction === 'back') {\n var toValue = get(obj, this._to);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '<-', toValue, obj);\n }\n _suspendObserver(obj, fromPath, this, this.fromDidChange, function () {\n trySet(isGlobalPath(fromPath) ? Ember.lookup : obj, fromPath, toValue);\n });\n }\n }\n\n };\n\n function mixinProperties(to, from) {\n for (var key in from) {\n if (from.hasOwnProperty(key)) {\n to[key] = from[key];\n }\n }\n }\n\n mixinProperties(Binding, {\n\n /*\n See `Ember.Binding.from`.\n\n @method from\n @static\n */\n from: function() {\n var C = this, binding = new C();\n return binding.from.apply(binding, arguments);\n },\n\n /*\n See `Ember.Binding.to`.\n\n @method to\n @static\n */\n to: function() {\n var C = this, binding = new C();\n return binding.to.apply(binding, arguments);\n },\n\n /**\n Creates a new Binding instance and makes it apply in a single direction.\n A one-way binding will relay changes on the `from` side object (supplied\n as the `from` argument) the `to` side, but not the other way around.\n This means that if you change the \"to\" side directly, the \"from\" side may have\n a different value.\n\n See `Binding.oneWay`.\n\n @method oneWay\n @param {String} from from path.\n @param {Boolean} [flag] (Optional) passing nothing here will make the\n binding `oneWay`. You can instead pass `false` to disable `oneWay`, making the\n binding two way again.\n @return {Ember.Binding} `this`\n */\n oneWay: function(from, flag) {\n var C = this, binding = new C(null, from);\n return binding.oneWay(flag);\n }\n\n });\n\n /**\n An `Ember.Binding` connects the properties of two objects so that whenever\n the value of one property changes, the other property will be changed also.\n\n ## Automatic Creation of Bindings with `/^*Binding/`-named Properties\n\n You do not usually create Binding objects directly but instead describe\n bindings in your class or object definition using automatic binding\n detection.\n\n Properties ending in a `Binding` suffix will be converted to `Ember.Binding`\n instances. The value of this property should be a string representing a path\n to another object or a custom binding instanced created using Binding helpers\n (see \"One Way Bindings\"):\n\n ```\n valueBinding: \"MyApp.someController.title\"\n ```\n\n This will create a binding from `MyApp.someController.title` to the `value`\n property of your object instance automatically. Now the two values will be\n kept in sync.\n\n ## One Way Bindings\n\n One especially useful binding customization you can use is the `oneWay()`\n helper. This helper tells Ember that you are only interested in\n receiving changes on the object you are binding from. For example, if you\n are binding to a preference and you want to be notified if the preference\n has changed, but your object will not be changing the preference itself, you\n could do:\n\n ```\n bigTitlesBinding: Ember.Binding.oneWay(\"MyApp.preferencesController.bigTitles\")\n ```\n\n This way if the value of `MyApp.preferencesController.bigTitles` changes the\n `bigTitles` property of your object will change also. However, if you\n change the value of your `bigTitles` property, it will not update the\n `preferencesController`.\n\n One way bindings are almost twice as fast to setup and twice as fast to\n execute because the binding only has to worry about changes to one side.\n\n You should consider using one way bindings anytime you have an object that\n may be created frequently and you do not intend to change a property; only\n to monitor it for changes (such as in the example above).\n\n ## Adding Bindings Manually\n\n All of the examples above show you how to configure a custom binding, but the\n result of these customizations will be a binding template, not a fully active\n Binding instance. The binding will actually become active only when you\n instantiate the object the binding belongs to. It is useful however, to\n understand what actually happens when the binding is activated.\n\n For a binding to function it must have at least a `from` property and a `to`\n property. The `from` property path points to the object/key that you want to\n bind from while the `to` path points to the object/key you want to bind to.\n\n When you define a custom binding, you are usually describing the property\n you want to bind from (such as `MyApp.someController.value` in the examples\n above). When your object is created, it will automatically assign the value\n you want to bind `to` based on the name of your binding key. In the\n examples above, during init, Ember objects will effectively call\n something like this on your binding:\n\n ```javascript\n binding = Ember.Binding.from(this.valueBinding).to(\"value\");\n ```\n\n This creates a new binding instance based on the template you provide, and\n sets the to path to the `value` property of the new object. Now that the\n binding is fully configured with a `from` and a `to`, it simply needs to be\n connected to become active. This is done through the `connect()` method:\n\n ```javascript\n binding.connect(this);\n ```\n\n Note that when you connect a binding you pass the object you want it to be\n connected to. This object will be used as the root for both the from and\n to side of the binding when inspecting relative paths. This allows the\n binding to be automatically inherited by subclassed objects as well.\n\n Now that the binding is connected, it will observe both the from and to side\n and relay changes.\n\n If you ever needed to do so (you almost never will, but it is useful to\n understand this anyway), you could manually create an active binding by\n using the `Ember.bind()` helper method. (This is the same method used by\n to setup your bindings on objects):\n\n ```javascript\n Ember.bind(MyApp.anotherObject, \"value\", \"MyApp.someController.value\");\n ```\n\n Both of these code fragments have the same effect as doing the most friendly\n form of binding creation like so:\n\n ```javascript\n MyApp.anotherObject = Ember.Object.create({\n valueBinding: \"MyApp.someController.value\",\n\n // OTHER CODE FOR THIS OBJECT...\n });\n ```\n\n Ember's built in binding creation method makes it easy to automatically\n create bindings for you. You should always use the highest-level APIs\n available, even if you understand how it works underneath.\n\n @class Binding\n @namespace Ember\n @since Ember 0.9\n */\n // Ember.Binding = Binding; ES6TODO: where to put this?\n\n\n /**\n Global helper method to create a new binding. Just pass the root object\n along with a `to` and `from` path to create and connect the binding.\n\n @method bind\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n */\n function bind(obj, to, from) {\n return new Binding(to, from).connect(obj);\n };\n\n /**\n @method oneWay\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n */\n function oneWay(obj, to, from) {\n return new Binding(to, from).oneWay().connect(obj);\n };\n\n __exports__.Binding = Binding;\n __exports__.bind = bind;\n __exports__.oneWay = oneWay;\n __exports__.isGlobalPath = isGlobalPath;\n });\ndefine(\"ember-metal/chains\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/utils\",\"ember-metal/array\",\"ember-metal/watch_key\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // warn, assert, etc;\n var get = __dependency2__.get;\n var normalizeTuple = __dependency2__.normalizeTuple;\n var meta = __dependency3__.meta;\n var META_KEY = __dependency3__.META_KEY;\n var forEach = __dependency4__.forEach;\n var watchKey = __dependency5__.watchKey;\n var unwatchKey = __dependency5__.unwatchKey;\n\n var metaFor = meta,\n warn = Ember.warn,\n FIRST_KEY = /^([^\\.]+)/;\n\n function firstKey(path) {\n return path.match(FIRST_KEY)[0];\n }\n\n var pendingQueue = [];\n\n // attempts to add the pendingQueue chains again. If some of them end up\n // back in the queue and reschedule is true, schedules a timeout to try\n // again.\n function flushPendingChains() {\n if (pendingQueue.length === 0) { return; } // nothing to do\n\n var queue = pendingQueue;\n pendingQueue = [];\n\n forEach.call(queue, function(q) { q[0].add(q[1]); });\n\n warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);\n };\n\n\n function addChainWatcher(obj, keyName, node) {\n if (!obj || ('object' !== typeof obj)) { return; } // nothing to do\n\n var m = metaFor(obj), nodes = m.chainWatchers;\n\n if (!m.hasOwnProperty('chainWatchers')) {\n nodes = m.chainWatchers = {};\n }\n\n if (!nodes[keyName]) { nodes[keyName] = []; }\n nodes[keyName].push(node);\n watchKey(obj, keyName, m);\n }\n\n function removeChainWatcher(obj, keyName, node) {\n if (!obj || 'object' !== typeof obj) { return; } // nothing to do\n\n var m = obj[META_KEY];\n if (m && !m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m && m.chainWatchers;\n\n if (nodes && nodes[keyName]) {\n nodes = nodes[keyName];\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i] === node) { nodes.splice(i, 1); }\n }\n }\n unwatchKey(obj, keyName, m);\n };\n\n // A ChainNode watches a single key on an object. If you provide a starting\n // value for the key then the node won't actually watch it. For a root node\n // pass null for parent and key and object for value.\n function ChainNode(parent, key, value) {\n this._parent = parent;\n this._key = key;\n\n // _watching is true when calling get(this._parent, this._key) will\n // return the value of this node.\n //\n // It is false for the root of a chain (because we have no parent)\n // and for global paths (because the parent node is the object with\n // the observer on it)\n this._watching = value===undefined;\n\n this._value = value;\n this._paths = {};\n if (this._watching) {\n this._object = parent.value();\n if (this._object) { addChainWatcher(this._object, this._key, this); }\n }\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n //\n // TODO: Replace this with an efficient callback that the EachProxy\n // can implement.\n if (this._parent && this._parent._key === '@each') {\n this.value();\n }\n };\n\n var ChainNodePrototype = ChainNode.prototype;\n\n function lazyGet(obj, key) {\n if (!obj) return undefined;\n\n var meta = obj[META_KEY];\n // check if object meant only to be a prototype\n if (meta && meta.proto === obj) return undefined;\n\n if (key === \"@each\") return get(obj, key);\n\n // if a CP only return cached value\n var desc = meta && meta.descs[key];\n if (desc && desc._cacheable) {\n if (key in meta.cache) {\n return meta.cache[key];\n } else {\n return undefined;\n }\n }\n\n return get(obj, key);\n }\n\n ChainNodePrototype.value = function() {\n if (this._value === undefined && this._watching) {\n var obj = this._parent.value();\n this._value = lazyGet(obj, this._key);\n }\n return this._value;\n };\n\n ChainNodePrototype.destroy = function() {\n if (this._watching) {\n var obj = this._object;\n if (obj) { removeChainWatcher(obj, this._key, this); }\n this._watching = false; // so future calls do nothing\n }\n };\n\n // copies a top level object only\n ChainNodePrototype.copy = function(obj) {\n var ret = new ChainNode(null, null, obj),\n paths = this._paths, path;\n for (path in paths) {\n if (paths[path] <= 0) { continue; } // this check will also catch non-number vals.\n ret.add(path);\n }\n return ret;\n };\n\n // called on the root node of a chain to setup watchers on the specified\n // path.\n ChainNodePrototype.add = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n paths[path] = (paths[path] || 0) + 1;\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n\n // the path was a local path\n if (tuple[0] && tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n\n // global path, but object does not exist yet.\n // put into a queue and try to connect later.\n } else if (!tuple[0]) {\n pendingQueue.push([this, path]);\n tuple.length = 0;\n return;\n\n // global path, and object already exists\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.chain(key, path, src);\n };\n\n // called on the root node of a chain to teardown watcher on the specified\n // path\n ChainNodePrototype.remove = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n if (paths[path] > 0) { paths[path]--; }\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n if (tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.unchain(key, path);\n };\n\n ChainNodePrototype.count = 0;\n\n ChainNodePrototype.chain = function(key, path, src) {\n var chains = this._chains, node;\n if (!chains) { chains = this._chains = {}; }\n\n node = chains[key];\n if (!node) { node = chains[key] = new ChainNode(this, key, src); }\n node.count++; // count chains...\n\n // chain rest of path if there is one\n if (path && path.length>0) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.chain(key, path); // NOTE: no src means it will observe changes...\n }\n };\n\n ChainNodePrototype.unchain = function(key, path) {\n var chains = this._chains, node = chains[key];\n\n // unchain rest of path first...\n if (path && path.length>1) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.unchain(key, path);\n }\n\n // delete node if needed.\n node.count--;\n if (node.count<=0) {\n delete chains[node._key];\n node.destroy();\n }\n\n };\n\n ChainNodePrototype.willChange = function(events) {\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].willChange(events);\n }\n }\n\n if (this._parent) { this._parent.chainWillChange(this, this._key, 1, events); }\n };\n\n ChainNodePrototype.chainWillChange = function(chain, path, depth, events) {\n if (this._key) { path = this._key + '.' + path; }\n\n if (this._parent) {\n this._parent.chainWillChange(this, path, depth+1, events);\n } else {\n if (depth > 1) {\n events.push(this.value(), path);\n }\n path = 'this.' + path;\n if (this._paths[path] > 0) {\n events.push(this.value(), path);\n }\n }\n };\n\n ChainNodePrototype.chainDidChange = function(chain, path, depth, events) {\n if (this._key) { path = this._key + '.' + path; }\n if (this._parent) {\n this._parent.chainDidChange(this, path, depth+1, events);\n } else {\n if (depth > 1) {\n events.push(this.value(), path);\n }\n path = 'this.' + path;\n if (this._paths[path] > 0) {\n events.push(this.value(), path);\n }\n }\n };\n\n ChainNodePrototype.didChange = function(events) {\n // invalidate my own value first.\n if (this._watching) {\n var obj = this._parent.value();\n if (obj !== this._object) {\n removeChainWatcher(this._object, this._key, this);\n this._object = obj;\n addChainWatcher(obj, this._key, this);\n }\n this._value = undefined;\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n if (this._parent && this._parent._key === '@each')\n this.value();\n }\n\n // then notify chains...\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].didChange(events);\n }\n }\n\n // if no events are passed in then we only care about the above wiring update\n if (events === null) { return; }\n\n // and finally tell parent about my path changing...\n if (this._parent) { this._parent.chainDidChange(this, this._key, 1, events); }\n };\n\n function finishChains(obj) {\n // We only create meta if we really have to\n var m = obj[META_KEY], chains = m && m.chains;\n if (chains) {\n if (chains.value() !== obj) {\n metaFor(obj).chains = chains = chains.copy(obj);\n } else {\n chains.didChange(null);\n }\n }\n };\n\n __exports__.flushPendingChains = flushPendingChains;\n __exports__.removeChainWatcher = removeChainWatcher;\n __exports__.ChainNode = ChainNode;\n __exports__.finishChains = finishChains;\n });\ndefine(\"ember-metal/computed\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/enumerable_utils\",\"ember-metal/platform\",\"ember-metal/watching\",\"ember-metal/expand_properties\",\"ember-metal/error\",\"ember-metal/properties\",\"ember-metal/property_events\",\"ember-metal/is_empty\",\"ember-metal/is_none\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var meta = __dependency4__.meta;\n var META_KEY = __dependency4__.META_KEY;\n var guidFor = __dependency4__.guidFor;\n var typeOf = __dependency4__.typeOf;\n var inspect = __dependency4__.inspect;\n var EnumerableUtils = __dependency5__[\"default\"];\n var create = __dependency6__.create;\n var watch = __dependency7__.watch;\n var unwatch = __dependency7__.unwatch;\n var expandProperties = __dependency8__[\"default\"];\n var EmberError = __dependency9__[\"default\"];\n var Descriptor = __dependency10__.Descriptor;\n var defineProperty = __dependency10__.defineProperty;\n var propertyWillChange = __dependency11__.propertyWillChange;\n var propertyDidChange = __dependency11__.propertyDidChange;\n var isEmpty = __dependency12__[\"default\"];\n var isNone = __dependency13__.isNone;\n\n /**\n @module ember-metal\n */\n\n Ember.warn(\"The CP_DEFAULT_CACHEABLE flag has been removed and computed properties are always cached by default. Use `volatile` if you don't want caching.\", Ember.ENV.CP_DEFAULT_CACHEABLE !== false);\n\n\n var metaFor = meta,\n a_slice = [].slice,\n o_create = create;\n\n function UNDEFINED() { }\n\n var lengthPattern = /\\.(length|\\[\\])$/;\n\n // ..........................................................\n // DEPENDENT KEYS\n //\n\n // data structure:\n // meta.deps = {\n // 'depKey': {\n // 'keyName': count,\n // }\n // }\n\n /*\n This function returns a map of unique dependencies for a\n given object and key.\n */\n function keysForDep(depsMeta, depKey) {\n var keys = depsMeta[depKey];\n if (!keys) {\n // if there are no dependencies yet for a the given key\n // create a new empty list of dependencies for the key\n keys = depsMeta[depKey] = {};\n } else if (!depsMeta.hasOwnProperty(depKey)) {\n // otherwise if the dependency list is inherited from\n // a superclass, clone the hash\n keys = depsMeta[depKey] = o_create(keys);\n }\n return keys;\n }\n\n function metaForDeps(meta) {\n return keysForDep(meta, 'deps');\n }\n\n function addDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) + 1;\n // Watch the depKey\n watch(obj, depKey, meta);\n }\n }\n\n function removeDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) - 1;\n // Watch the depKey\n unwatch(obj, depKey, meta);\n }\n }\n\n // ..........................................................\n // COMPUTED PROPERTY\n //\n\n /**\n A computed property transforms an objects function into a property.\n\n By default the function backing the computed property will only be called\n once and the result will be cached. You can specify various properties\n that your computed property is dependent on. This will force the cached\n result to be recomputed if the dependencies are modified.\n\n In the following example we declare a computed property (by calling\n `.property()` on the fullName function) and setup the properties\n dependencies (depending on firstName and lastName). The fullName function\n will be called once (regardless of how many times it is accessed) as long\n as it's dependencies have not been changed. Once firstName or lastName are updated\n any future calls (or anything bound) to fullName will incorporate the new\n values.\n\n ```javascript\n var Person = Ember.Object.extend({\n // these will be supplied by `create`\n firstName: null,\n lastName: null,\n\n fullName: function() {\n var firstName = this.get('firstName');\n var lastName = this.get('lastName');\n\n return firstName + ' ' + lastName;\n }.property('firstName', 'lastName')\n });\n\n var tom = Person.create({\n firstName: 'Tom',\n lastName: 'Dale'\n });\n\n tom.get('fullName') // 'Tom Dale'\n ```\n\n You can also define what Ember should do when setting a computed property.\n If you try to set a computed property, it will be invoked with the key and\n value you want to set it to. You can also accept the previous value as the\n third parameter.\n\n ```javascript\n var Person = Ember.Object.extend({\n // these will be supplied by `create`\n firstName: null,\n lastName: null,\n\n fullName: function(key, value, oldValue) {\n // getter\n if (arguments.length === 1) {\n var firstName = this.get('firstName');\n var lastName = this.get('lastName');\n\n return firstName + ' ' + lastName;\n\n // setter\n } else {\n var name = value.split(' ');\n\n this.set('firstName', name[0]);\n this.set('lastName', name[1]);\n\n return value;\n }\n }.property('firstName', 'lastName')\n });\n\n var person = Person.create();\n\n person.set('fullName', 'Peter Wagenet');\n person.get('firstName'); // 'Peter'\n person.get('lastName'); // 'Wagenet'\n ```\n\n @class ComputedProperty\n @namespace Ember\n @extends Ember.Descriptor\n @constructor\n */\n function ComputedProperty(func, opts) {\n func.__ember_arity__ = func.length;\n this.func = func;\n\n this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;\n this._dependentKeys = opts && opts.dependentKeys;\n this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly) || false;\n }\n\n ComputedProperty.prototype = new Descriptor();\n\n var ComputedPropertyPrototype = ComputedProperty.prototype;\n ComputedPropertyPrototype._dependentKeys = undefined;\n ComputedPropertyPrototype._suspended = undefined;\n ComputedPropertyPrototype._meta = undefined;\n\n /**\n Properties are cacheable by default. Computed property will automatically\n cache the return value of your function until one of the dependent keys changes.\n\n Call `volatile()` to set it into non-cached mode. When in this mode\n the computed property will not automatically cache the return value.\n\n However, if a property is properly observable, there is no reason to disable\n caching.\n\n @method cacheable\n @param {Boolean} aFlag optional set to `false` to disable caching\n @return {Ember.ComputedProperty} this\n @chainable\n */\n ComputedPropertyPrototype.cacheable = function(aFlag) {\n this._cacheable = aFlag !== false;\n return this;\n };\n\n /**\n Call on a computed property to set it into non-cached mode. When in this\n mode the computed property will not automatically cache the return value.\n\n ```javascript\n var outsideService = Ember.Object.extend({\n value: function() {\n return OutsideService.getValue();\n }.property().volatile()\n }).create();\n ```\n\n @method volatile\n @return {Ember.ComputedProperty} this\n @chainable\n */\n ComputedPropertyPrototype.volatile = function() {\n return this.cacheable(false);\n };\n\n /**\n Call on a computed property to set it into read-only mode. When in this\n mode the computed property will throw an error when set.\n\n ```javascript\n var Person = Ember.Object.extend({\n guid: function() {\n return 'guid-guid-guid';\n }.property().readOnly()\n });\n\n var person = Person.create();\n\n person.set('guid', 'new-guid'); // will throw an exception\n ```\n\n @method readOnly\n @return {Ember.ComputedProperty} this\n @chainable\n */\n ComputedPropertyPrototype.readOnly = function(readOnly) {\n this._readOnly = readOnly === undefined || !!readOnly;\n return this;\n };\n\n /**\n Sets the dependent keys on this computed property. Pass any number of\n arguments containing key paths that this computed property depends on.\n\n ```javascript\n var President = Ember.Object.extend({\n fullName: computed(function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember that this computed property depends on firstName\n // and lastName\n }).property('firstName', 'lastName')\n });\n\n var president = President.create({\n firstName: 'Barack',\n lastName: 'Obama',\n });\n\n president.get('fullName'); // 'Barack Obama'\n ```\n\n @method property\n @param {String} path* zero or more property paths\n @return {Ember.ComputedProperty} this\n @chainable\n */\n ComputedPropertyPrototype.property = function() {\n var args;\n\n var addArg = function (property) {\n args.push(property);\n };\n\n args = [];\n for (var i = 0, l = arguments.length; i < l; i++) {\n expandProperties(arguments[i], addArg);\n }\n\n this._dependentKeys = args;\n return this;\n };\n\n /**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For example,\n computed property functions may close over variables that are then no longer\n available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n The hash that you pass to the `meta()` function will be saved on the\n computed property descriptor under the `_meta` key. Ember runtime\n exposes a public API for retrieving these values from classes,\n via the `metaForProperty()` function.\n\n @method meta\n @param {Hash} meta\n @chainable\n */\n\n ComputedPropertyPrototype.meta = function(meta) {\n if (arguments.length === 0) {\n return this._meta || {};\n } else {\n this._meta = meta;\n return this;\n }\n };\n\n /* impl descriptor API */\n ComputedPropertyPrototype.didChange = function(obj, keyName) {\n // _suspended is set via a CP.set to ensure we don't clear\n // the cached value set by the setter\n if (this._cacheable && this._suspended !== obj) {\n var meta = metaFor(obj);\n if (meta.cache[keyName] !== undefined) {\n meta.cache[keyName] = undefined;\n removeDependentKeys(this, obj, keyName, meta);\n }\n }\n };\n\n function finishChains(chainNodes)\n {\n for (var i=0, l=chainNodes.length; i<l; i++) {\n chainNodes[i].didChange(null);\n }\n }\n\n /**\n Access the value of the function backing the computed property.\n If this property has already been cached, return the cached result.\n Otherwise, call the function passing the property name as an argument.\n\n ```javascript\n var Person = Ember.Object.extend({\n fullName: function(keyName) {\n // the keyName parameter is 'fullName' in this case.\n return this.get('firstName') + ' ' + this.get('lastName');\n }.property('firstName', 'lastName')\n });\n\n\n var tom = Person.create({\n firstName: 'Tom',\n lastName: 'Dale'\n });\n\n tom.get('fullName') // 'Tom Dale'\n ```\n\n @method get\n @param {String} keyName The key being accessed.\n @return {Object} The return value of the function backing the CP.\n */\n ComputedPropertyPrototype.get = function(obj, keyName) {\n var ret, cache, meta, chainNodes;\n if (this._cacheable) {\n meta = metaFor(obj);\n cache = meta.cache;\n\n var result = cache[keyName];\n\n if (result === UNDEFINED) {\n return undefined;\n } else if (result !== undefined) {\n return result;\n }\n\n ret = this.func.call(obj, keyName);\n if (ret === undefined) {\n cache[keyName] = UNDEFINED;\n } else {\n cache[keyName] = ret;\n }\n\n chainNodes = meta.chainWatchers && meta.chainWatchers[keyName];\n if (chainNodes) { finishChains(chainNodes); }\n addDependentKeys(this, obj, keyName, meta);\n } else {\n ret = this.func.call(obj, keyName);\n }\n return ret;\n };\n\n /**\n Set the value of a computed property. If the function that backs your\n computed property does not accept arguments then the default action for\n setting would be to define the property on the current object, and set\n the value of the property to the value being set.\n\n Generally speaking if you intend for your computed property to be set\n your backing function should accept either two or three arguments.\n\n @method set\n @param {String} keyName The key being accessed.\n @param {Object} newValue The new value being assigned.\n @param {String} oldValue The old value being replaced.\n @return {Object} The return value of the function backing the CP.\n */\n ComputedPropertyPrototype.set = function(obj, keyName, value) {\n var cacheable = this._cacheable,\n func = this.func,\n meta = metaFor(obj, cacheable),\n oldSuspended = this._suspended,\n hadCachedValue = false,\n cache = meta.cache,\n funcArgLength, cachedValue, ret;\n\n if (this._readOnly) {\n throw new EmberError('Cannot set read-only property \"' + keyName + '\" on object: ' + inspect(obj));\n }\n\n this._suspended = obj;\n\n try {\n\n if (cacheable && cache[keyName] !== undefined) {\n cachedValue = cache[keyName];\n hadCachedValue = true;\n }\n\n // Check if the CP has been wrapped. If it has, use the\n // length from the wrapped function.\n\n funcArgLength = func.wrappedFunction ? func.wrappedFunction.__ember_arity__ : func.__ember_arity__;\n\n // For backwards-compatibility with computed properties\n // that check for arguments.length === 2 to determine if\n // they are being get or set, only pass the old cached\n // value if the computed property opts into a third\n // argument.\n if (funcArgLength === 3) {\n ret = func.call(obj, keyName, value, cachedValue);\n } else if (funcArgLength === 2) {\n ret = func.call(obj, keyName, value);\n } else {\n defineProperty(obj, keyName, null, cachedValue);\n set(obj, keyName, value);\n return;\n }\n\n if (hadCachedValue && cachedValue === ret) { return; }\n\n var watched = meta.watching[keyName];\n if (watched) { propertyWillChange(obj, keyName); }\n\n if (hadCachedValue) {\n cache[keyName] = undefined;\n }\n\n if (cacheable) {\n if (!hadCachedValue) {\n addDependentKeys(this, obj, keyName, meta);\n }\n if (ret === undefined) {\n cache[keyName] = UNDEFINED;\n } else {\n cache[keyName] = ret;\n }\n }\n\n if (watched) { propertyDidChange(obj, keyName); }\n } finally {\n this._suspended = oldSuspended;\n }\n return ret;\n };\n\n /* called before property is overridden */\n ComputedPropertyPrototype.teardown = function(obj, keyName) {\n var meta = metaFor(obj);\n\n if (keyName in meta.cache) {\n removeDependentKeys(this, obj, keyName, meta);\n }\n\n if (this._cacheable) { delete meta.cache[keyName]; }\n\n return null; // no value to restore\n };\n\n\n /**\n This helper returns a new property descriptor that wraps the passed\n computed property function. You can use this helper to define properties\n with mixins or via `Ember.defineProperty()`.\n\n The function you pass will be used to both get and set property values.\n The function should accept two parameters, key and value. If value is not\n undefined you should set the value first. In either case return the\n current value of the property.\n\n @method computed\n @for Ember\n @param {Function} func The computed property function.\n @return {Ember.ComputedProperty} property descriptor instance\n */\n function computed(func) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n func = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof func !== \"function\") {\n throw new EmberError(\"Computed Property declared without a property function\");\n }\n\n var cp = new ComputedProperty(func);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n };\n\n /**\n Returns the cached value for a property, if one exists.\n This can be useful for peeking at the value of a computed\n property that is generated lazily, without accidentally causing\n it to be created.\n\n @method cacheFor\n @for Ember\n @param {Object} obj the object whose property you want to check\n @param {String} key the name of the property whose cached value you want\n to return\n @return {Object} the cached value\n */\n function cacheFor(obj, key) {\n var meta = obj[META_KEY],\n cache = meta && meta.cache,\n ret = cache && cache[key];\n\n if (ret === UNDEFINED) { return undefined; }\n return ret;\n };\n\n cacheFor.set = function(cache, key, value) {\n if (value === undefined) {\n cache[key] = UNDEFINED;\n } else {\n cache[key] = value;\n }\n };\n\n cacheFor.get = function(cache, key) {\n var ret = cache[key];\n if (ret === UNDEFINED) { return undefined; }\n return ret;\n };\n\n cacheFor.remove = function(cache, key) {\n cache[key] = undefined;\n };\n\n function getProperties(self, propertyNames) {\n var ret = {};\n for(var i = 0; i < propertyNames.length; i++) {\n ret[propertyNames[i]] = get(self, propertyNames[i]);\n }\n return ret;\n }\n\n function registerComputed(name, macro) {\n computed[name] = function(dependentKey) {\n var args = a_slice.call(arguments);\n return computed(dependentKey, function() {\n return macro.apply(this, args);\n });\n };\n };\n\n function registerComputedWithProperties(name, macro) {\n computed[name] = function() {\n var properties = a_slice.call(arguments);\n\n var computedFunc = computed(function() {\n return macro.apply(this, [getProperties(this, properties)]);\n });\n\n return computedFunc.property.apply(computedFunc, properties);\n };\n };\n\n /**\n A computed property that returns true if the value of the dependent\n property is null, an empty string, empty array, or empty function.\n\n Example\n\n ```javascript\n var ToDoList = Ember.Object.extend({\n done: Ember.computed.empty('todos')\n });\n\n var todoList = ToDoList.create({\n todos: ['Unit Test', 'Documentation', 'Release']\n });\n\n todoList.get('done'); // false\n todoList.get('todos').clear();\n todoList.get('done'); // true\n ```\n\n @since 1.6.0\n @method computed.empty\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which negate\n the original value for property\n */\n computed.empty = function (dependentKey) {\n return computed(dependentKey + '.length', function () {\n return isEmpty(get(this, dependentKey));\n });\n };\n\n /**\n A computed property that returns true if the value of the dependent\n property is NOT null, an empty string, empty array, or empty function.\n\n Note: When using `computed.notEmpty` to watch an array make sure to\n use the `array.[]` syntax so the computed can subscribe to transitions\n from empty to non-empty states.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasStuff: Ember.computed.notEmpty('backpack.[]')\n });\n\n var hamster = Hamster.create({ backpack: ['Food', 'Sleeping Bag', 'Tent'] });\n\n hamster.get('hasStuff'); // true\n hamster.get('backpack').clear(); // []\n hamster.get('hasStuff'); // false\n ```\n\n @method computed.notEmpty\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which returns true if\n original value for property is not empty.\n */\n registerComputed('notEmpty', function(dependentKey) {\n return !isEmpty(get(this, dependentKey));\n });\n\n /**\n A computed property that returns true if the value of the dependent\n property is null or undefined. This avoids errors from JSLint complaining\n about use of ==, which can be technically confusing.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n isHungry: Ember.computed.none('food')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('isHungry'); // true\n hamster.set('food', 'Banana');\n hamster.get('isHungry'); // false\n hamster.set('food', null);\n hamster.get('isHungry'); // true\n ```\n\n @method computed.none\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which\n returns true if original value for property is null or undefined.\n */\n registerComputed('none', function(dependentKey) {\n return isNone(get(this, dependentKey));\n });\n\n /**\n A computed property that returns the inverse boolean value\n of the original value for the dependent property.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n isAnonymous: Ember.computed.not('loggedIn')\n });\n\n var user = User.create({loggedIn: false});\n\n user.get('isAnonymous'); // true\n user.set('loggedIn', true);\n user.get('isAnonymous'); // false\n ```\n\n @method computed.not\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which returns\n inverse of the original value for property\n */\n registerComputed('not', function(dependentKey) {\n return !get(this, dependentKey);\n });\n\n /**\n A computed property that converts the provided dependent property\n into a boolean value.\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasBananas: Ember.computed.bool('numBananas')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('hasBananas'); // false\n hamster.set('numBananas', 0);\n hamster.get('hasBananas'); // false\n hamster.set('numBananas', 1);\n hamster.get('hasBananas'); // true\n hamster.set('numBananas', null);\n hamster.get('hasBananas'); // false\n ```\n\n @method computed.bool\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which converts\n to boolean the original value for property\n */\n registerComputed('bool', function(dependentKey) {\n return !!get(this, dependentKey);\n });\n\n /**\n A computed property which matches the original value for the\n dependent property against a given RegExp, returning `true`\n if they values matches the RegExp and `false` if it does not.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n hasValidEmail: Ember.computed.match('email', /^.+@.+\\..+$/)\n });\n\n var user = User.create({loggedIn: false});\n\n user.get('hasValidEmail'); // false\n user.set('email', '');\n user.get('hasValidEmail'); // false\n user.set('email', 'ember_hamster@example.com');\n user.get('hasValidEmail'); // true\n ```\n\n @method computed.match\n @for Ember\n @param {String} dependentKey\n @param {RegExp} regexp\n @return {Ember.ComputedProperty} computed property which match\n the original value for property against a given RegExp\n */\n registerComputed('match', function(dependentKey, regexp) {\n var value = get(this, dependentKey);\n return typeof value === 'string' ? regexp.test(value) : false;\n });\n\n /**\n A computed property that returns true if the provided dependent property\n is equal to the given value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n napTime: Ember.computed.equal('state', 'sleepy')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('napTime'); // false\n hamster.set('state', 'sleepy');\n hamster.get('napTime'); // true\n hamster.set('state', 'hungry');\n hamster.get('napTime'); // false\n ```\n\n @method computed.equal\n @for Ember\n @param {String} dependentKey\n @param {String|Number|Object} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is equal to the given value.\n */\n registerComputed('equal', function(dependentKey, value) {\n return get(this, dependentKey) === value;\n });\n\n /**\n A computed property that returns true if the provied dependent property\n is greater than the provided value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasTooManyBananas: Ember.computed.gt('numBananas', 10)\n });\n\n var hamster = Hamster.create();\n\n hamster.get('hasTooManyBananas'); // false\n hamster.set('numBananas', 3);\n hamster.get('hasTooManyBananas'); // false\n hamster.set('numBananas', 11);\n hamster.get('hasTooManyBananas'); // true\n ```\n\n @method computed.gt\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is greater then given value.\n */\n registerComputed('gt', function(dependentKey, value) {\n return get(this, dependentKey) > value;\n });\n\n /**\n A computed property that returns true if the provided dependent property\n is greater than or equal to the provided value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasTooManyBananas: Ember.computed.gte('numBananas', 10)\n });\n\n var hamster = Hamster.create();\n\n hamster.get('hasTooManyBananas'); // false\n hamster.set('numBananas', 3);\n hamster.get('hasTooManyBananas'); // false\n hamster.set('numBananas', 10);\n hamster.get('hasTooManyBananas'); // true\n ```\n\n @method computed.gte\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is greater or equal then given value.\n */\n registerComputed('gte', function(dependentKey, value) {\n return get(this, dependentKey) >= value;\n });\n\n /**\n A computed property that returns true if the provided dependent property\n is less than the provided value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n needsMoreBananas: Ember.computed.lt('numBananas', 3)\n });\n\n var hamster = Hamster.create();\n\n hamster.get('needsMoreBananas'); // true\n hamster.set('numBananas', 3);\n hamster.get('needsMoreBananas'); // false\n hamster.set('numBananas', 2);\n hamster.get('needsMoreBananas'); // true\n ```\n\n @method computed.lt\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is less then given value.\n */\n registerComputed('lt', function(dependentKey, value) {\n return get(this, dependentKey) < value;\n });\n\n /**\n A computed property that returns true if the provided dependent property\n is less than or equal to the provided value.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n needsMoreBananas: Ember.computed.lte('numBananas', 3)\n });\n\n var hamster = Hamster.create();\n\n hamster.get('needsMoreBananas'); // true\n hamster.set('numBananas', 5);\n hamster.get('needsMoreBananas'); // false\n hamster.set('numBananas', 3);\n hamster.get('needsMoreBananas'); // true\n ```\n\n @method computed.lte\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is less or equal then given value.\n */\n registerComputed('lte', function(dependentKey, value) {\n return get(this, dependentKey) <= value;\n });\n\n /**\n A computed property that performs a logical `and` on the\n original values for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n readyForCamp: Ember.computed.and('hasTent', 'hasBackpack')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('readyForCamp'); // false\n hamster.set('hasTent', true);\n hamster.get('readyForCamp'); // false\n hamster.set('hasBackpack', true);\n hamster.get('readyForCamp'); // true\n ```\n\n @method computed.and\n @for Ember\n @param {String} dependentKey*\n @return {Ember.ComputedProperty} computed property which performs\n a logical `and` on the values of all the original values for properties.\n */\n registerComputedWithProperties('and', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && !properties[key]) {\n return false;\n }\n }\n return true;\n });\n\n /**\n A computed property which performs a logical `or` on the\n original values for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('readyForRain'); // false\n hamster.set('hasJacket', true);\n hamster.get('readyForRain'); // true\n ```\n\n @method computed.or\n @for Ember\n @param {String} dependentKey*\n @return {Ember.ComputedProperty} computed property which performs\n a logical `or` on the values of all the original values for properties.\n */\n registerComputedWithProperties('or', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n return true;\n }\n }\n return false;\n });\n\n /**\n A computed property that returns the first truthy value\n from a list of dependent properties.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n hasClothes: Ember.computed.any('hat', 'shirt')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('hasClothes'); // null\n hamster.set('shirt', 'Hawaiian Shirt');\n hamster.get('hasClothes'); // 'Hawaiian Shirt'\n ```\n\n @method computed.any\n @for Ember\n @param {String} dependentKey*\n @return {Ember.ComputedProperty} computed property which returns\n the first truthy value of given list of properties.\n */\n registerComputedWithProperties('any', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n return properties[key];\n }\n }\n return null;\n });\n\n /**\n A computed property that returns the array of values\n for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n clothes: Ember.computed.collect('hat', 'shirt')\n });\n\n var hamster = Hamster.create();\n\n hamster.get('clothes'); // [null, null]\n hamster.set('hat', 'Camp Hat');\n hamster.set('shirt', 'Camp Shirt');\n hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt']\n ```\n\n @method computed.collect\n @for Ember\n @param {String} dependentKey*\n @return {Ember.ComputedProperty} computed property which maps\n values of all passed properties in to an array.\n */\n registerComputedWithProperties('collect', function(properties) {\n var res = [];\n for (var key in properties) {\n if (properties.hasOwnProperty(key)) {\n if (isNone(properties[key])) {\n res.push(null);\n } else {\n res.push(properties[key]);\n }\n }\n }\n return res;\n });\n\n /**\n Creates a new property that is an alias for another property\n on an object. Calls to `get` or `set` this property behave as\n though they were called on the original property.\n\n ```javascript\n var Person = Ember.Object.extend({\n name: 'Alex Matchneer',\n nomen: Ember.computed.alias('name')\n });\n\n var alex = Person.create();\n\n alex.get('nomen'); // 'Alex Matchneer'\n alex.get('name'); // 'Alex Matchneer'\n\n alex.set('nomen', '@machty');\n alex.get('name'); // '@machty'\n ```\n\n @method computed.alias\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates an\n alias to the original value for property.\n */\n computed.alias = function(dependentKey) {\n return computed(dependentKey, function(key, value) {\n if (arguments.length > 1) {\n set(this, dependentKey, value);\n return get(this, dependentKey);\n } else {\n return get(this, dependentKey);\n }\n });\n };\n\n /**\n Where `computed.alias` aliases `get` and `set`, and allows for bidirectional\n data flow, `computed.oneWay` only provides an aliased `get`. The `set` will\n not mutate the upstream property, rather causes the current property to\n become the value set. This causes the downstream property to permanently\n diverge from the upstream property.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n firstName: null,\n lastName: null,\n nickName: Ember.computed.oneWay('firstName')\n });\n\n var teddy = User.create({\n firstName: 'Teddy',\n lastName: 'Zeenny'\n });\n\n teddy.get('nickName'); // 'Teddy'\n teddy.set('nickName', 'TeddyBear'); // 'TeddyBear'\n teddy.get('firstName'); // 'Teddy'\n ```\n\n @method computed.oneWay\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates a\n one way computed property to the original value for property.\n */\n computed.oneWay = function(dependentKey) {\n return computed(dependentKey, function() {\n return get(this, dependentKey);\n });\n };\n\n if (Ember.FEATURES.isEnabled('query-params-new')) {\n /**\n This is a more semantically meaningful alias of `computed.oneWay`,\n whose name is somewhat ambiguous as to which direction the data flows.\n\n @method computed.reads\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates a\n one way computed property to the original value for property.\n */\n computed.reads = computed.oneWay;\n }\n\n /**\n Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides\n a readOnly one way binding. Very often when using `computed.oneWay` one does\n not also want changes to propogate back up, as they will replace the value.\n\n This prevents the reverse flow, and also throws an exception when it occurs.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n firstName: null,\n lastName: null,\n nickName: Ember.computed.readOnly('firstName')\n });\n\n var teddy = User.create({\n firstName: 'Teddy',\n lastName: 'Zeenny'\n });\n\n teddy.get('nickName'); // 'Teddy'\n teddy.set('nickName', 'TeddyBear'); // throws Exception\n // throw new Ember.Error('Cannot Set: nickName on: <User:ember27288>' );`\n teddy.get('firstName'); // 'Teddy'\n ```\n\n @method computed.readOnly\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates a\n one way computed property to the original value for property.\n @since 1.5.0\n */\n computed.readOnly = function(dependentKey) {\n return computed(dependentKey, function() {\n return get(this, dependentKey);\n }).readOnly();\n };\n /**\n A computed property that acts like a standard getter and setter,\n but returns the value at the provided `defaultPath` if the\n property itself has not been set to a value\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n wishList: Ember.computed.defaultTo('favoriteFood')\n });\n\n var hamster = Hamster.create({ favoriteFood: 'Banana' });\n\n hamster.get('wishList'); // 'Banana'\n hamster.set('wishList', 'More Unit Tests');\n hamster.get('wishList'); // 'More Unit Tests'\n hamster.get('favoriteFood'); // 'Banana'\n ```\n\n @method computed.defaultTo\n @for Ember\n @param {String} defaultPath\n @return {Ember.ComputedProperty} computed property which acts like\n a standard getter and setter, but defaults to the value from `defaultPath`.\n */\n // ES6TODO: computed should have its own export path so you can do import {defaultTo} from computed\n computed.defaultTo = function(defaultPath) {\n return computed(function(key, newValue, cachedValue) {\n if (arguments.length === 1) {\n return get(this, defaultPath);\n }\n return newValue != null ? newValue : get(this, defaultPath);\n });\n };\n\n __exports__.ComputedProperty = ComputedProperty;\n __exports__.computed = computed;\n __exports__.cacheFor = cacheFor;\n });\ndefine(\"ember-metal/core\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /*globals Em:true ENV EmberENV MetamorphENV:true */\n\n /**\n @module ember\n @submodule ember-metal\n */\n\n /**\n All Ember methods and functions are defined inside of this namespace. You\n generally should not add new properties to this namespace as it may be\n overwritten by future versions of Ember.\n\n You can also use the shorthand `Em` instead of `Ember`.\n\n Ember-Runtime is a framework that provides core functions for Ember including\n cross-platform functions, support for property observing and objects. Its\n focus is on small size and performance. You can use this in place of or\n along-side other cross-platform libraries such as jQuery.\n\n The core Runtime framework is based on the jQuery API with a number of\n performance optimizations.\n\n @class Ember\n @static\n @version 1.6.1\n */\n\n if ('undefined' === typeof Ember) {\n // Create core object. Make it act like an instance of Ember.Namespace so that\n // objects assigned to it are given a sane string representation.\n Ember = {};\n }\n\n // Default imports, exports and lookup to the global object;\n var imports = Ember.imports = Ember.imports || this;\n var exports = Ember.exports = Ember.exports || this;\n var lookup = Ember.lookup = Ember.lookup || this;\n\n // aliases needed to keep minifiers from removing the global context\n exports.Em = exports.Ember = Ember;\n\n // Make sure these are set whether Ember was already defined or not\n\n Ember.isNamespace = true;\n\n Ember.toString = function() { return \"Ember\"; };\n\n\n /**\n @property VERSION\n @type String\n @default '1.6.1'\n @static\n */\n Ember.VERSION = '1.6.1';\n\n /**\n Standard environmental variables. You can define these in a global `EmberENV`\n variable before loading Ember to control various configuration settings.\n\n For backwards compatibility with earlier versions of Ember the global `ENV`\n variable will be used if `EmberENV` is not defined.\n\n @property ENV\n @type Hash\n */\n\n if (Ember.ENV) {\n // do nothing if Ember.ENV is already setup\n } else if ('undefined' !== typeof EmberENV) {\n Ember.ENV = EmberENV;\n } else if('undefined' !== typeof ENV) {\n Ember.ENV = ENV;\n } else {\n Ember.ENV = {};\n }\n\n Ember.config = Ember.config || {};\n\n // We disable the RANGE API by default for performance reasons\n if ('undefined' === typeof Ember.ENV.DISABLE_RANGE_API) {\n Ember.ENV.DISABLE_RANGE_API = true;\n }\n\n if (\"undefined\" === typeof MetamorphENV) {\n exports.MetamorphENV = {};\n }\n\n MetamorphENV.DISABLE_RANGE_API = Ember.ENV.DISABLE_RANGE_API;\n\n /**\n Hash of enabled Canary features. Add to before creating your application.\n\n You can also define `ENV.FEATURES` if you need to enable features flagged at runtime.\n\n @class FEATURES\n @namespace Ember\n @static\n @since 1.1.0\n */\n\n Ember.FEATURES = Ember.ENV.FEATURES || {};\n\n /**\n Test that a feature is enabled. Parsed by Ember's build tools to leave\n experimental features out of beta/stable builds.\n\n You can define the following configuration options:\n\n * `ENV.ENABLE_ALL_FEATURES` - force all features to be enabled.\n * `ENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly\n enabled/disabled.\n\n @method isEnabled\n @param {String} feature\n @return {Boolean}\n @for Ember.FEATURES\n @since 1.1.0\n */\n\n Ember.FEATURES.isEnabled = function(feature) {\n var featureValue = Ember.FEATURES[feature];\n\n if (Ember.ENV.ENABLE_ALL_FEATURES) {\n return true;\n } else if (featureValue === true || featureValue === false || featureValue === undefined) {\n return featureValue;\n } else if (Ember.ENV.ENABLE_OPTIONAL_FEATURES) {\n return true;\n } else {\n return false;\n }\n };\n\n // ..........................................................\n // BOOTSTRAP\n //\n\n /**\n Determines whether Ember should enhance some built-in object prototypes to\n provide a more friendly API. If enabled, a few methods will be added to\n `Function`, `String`, and `Array`. `Object.prototype` will not be enhanced,\n which is the one that causes most trouble for people.\n\n In general we recommend leaving this option set to true since it rarely\n conflicts with other code. If you need to turn it off however, you can\n define an `ENV.EXTEND_PROTOTYPES` config to disable it.\n\n @property EXTEND_PROTOTYPES\n @type Boolean\n @default true\n @for Ember\n */\n Ember.EXTEND_PROTOTYPES = Ember.ENV.EXTEND_PROTOTYPES;\n\n if (typeof Ember.EXTEND_PROTOTYPES === 'undefined') {\n Ember.EXTEND_PROTOTYPES = true;\n }\n\n /**\n Determines whether Ember logs a full stack trace during deprecation warnings\n\n @property LOG_STACKTRACE_ON_DEPRECATION\n @type Boolean\n @default true\n */\n Ember.LOG_STACKTRACE_ON_DEPRECATION = (Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== false);\n\n /**\n Determines whether Ember should add ECMAScript 5 shims to older browsers.\n\n @property SHIM_ES5\n @type Boolean\n @default Ember.EXTEND_PROTOTYPES\n */\n Ember.SHIM_ES5 = (Ember.ENV.SHIM_ES5 === false) ? false : Ember.EXTEND_PROTOTYPES;\n\n /**\n Determines whether Ember logs info about version of used libraries\n\n @property LOG_VERSION\n @type Boolean\n @default true\n */\n Ember.LOG_VERSION = (Ember.ENV.LOG_VERSION === false) ? false : true;\n\n /**\n Empty function. Useful for some operations. Always returns `this`.\n\n @method K\n @private\n @return {Object}\n */\n Ember.K = function() { return this; };\n\n\n // Stub out the methods defined by the ember-debug package in case it's not loaded\n\n if ('undefined' === typeof Ember.assert) { Ember.assert = Ember.K; }\n if ('undefined' === typeof Ember.warn) { Ember.warn = Ember.K; }\n if ('undefined' === typeof Ember.debug) { Ember.debug = Ember.K; }\n if ('undefined' === typeof Ember.runInDebug) { Ember.runInDebug = Ember.K; }\n if ('undefined' === typeof Ember.deprecate) { Ember.deprecate = Ember.K; }\n if ('undefined' === typeof Ember.deprecateFunc) {\n Ember.deprecateFunc = function(_, func) { return func; };\n }\n\n /**\n Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from\n jQuery master. We'll just bootstrap our own uuid now.\n\n @property uuid\n @type Number\n @private\n */\n Ember.uuid = 0;\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-metal/enumerable_utils\",\n [\"ember-metal/array\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var map, forEach, indexOf, splice, filter;\n\n var map = __dependency1__.map;\n var forEach = __dependency1__.forEach;\n var indexOf = __dependency1__.indexOf;\n var filter = __dependency1__.filter;\n\n // ES6TODO: doesn't array polyfills already do this?\n map = Array.prototype.map || map;\n forEach = Array.prototype.forEach || forEach;\n indexOf = Array.prototype.indexOf || indexOf;\n filter = Array.prototype.filter || filter;\n splice = Array.prototype.splice;\n\n /**\n * Defines some convenience methods for working with Enumerables.\n * `Ember.EnumerableUtils` uses `Ember.ArrayPolyfills` when necessary.\n *\n * @class EnumerableUtils\n * @namespace Ember\n * @static\n * */\n var utils = {\n /**\n * Calls the map function on the passed object with a specified callback. This\n * uses `Ember.ArrayPolyfill`'s-map method when necessary.\n *\n * @method map\n * @param {Object} obj The object that should be mapped\n * @param {Function} callback The callback to execute\n * @param {Object} thisArg Value to use as this when executing *callback*\n *\n * @return {Array} An array of mapped values.\n */\n map: function(obj, callback, thisArg) {\n return obj.map ? obj.map.call(obj, callback, thisArg) : map.call(obj, callback, thisArg);\n },\n\n /**\n * Calls the forEach function on the passed object with a specified callback. This\n * uses `Ember.ArrayPolyfill`'s-forEach method when necessary.\n *\n * @method forEach\n * @param {Object} obj The object to call forEach on\n * @param {Function} callback The callback to execute\n * @param {Object} thisArg Value to use as this when executing *callback*\n *\n */\n forEach: function(obj, callback, thisArg) {\n return obj.forEach ? obj.forEach.call(obj, callback, thisArg) : forEach.call(obj, callback, thisArg);\n },\n\n /**\n * Calls the filter function on the passed object with a specified callback. This\n * uses `Ember.ArrayPolyfill`'s-filter method when necessary.\n *\n * @method filter\n * @param {Object} obj The object to call filter on\n * @param {Function} callback The callback to execute\n * @param {Object} thisArg Value to use as this when executing *callback*\n *\n * @return {Array} An array containing the filtered values\n * @since 1.4.0\n */\n filter: function(obj, callback, thisArg) {\n return obj.filter ? obj.filter.call(obj, callback, thisArg) : filter.call(obj, callback, thisArg);\n },\n\n /**\n * Calls the indexOf function on the passed object with a specified callback. This\n * uses `Ember.ArrayPolyfill`'s-indexOf method when necessary.\n *\n * @method indexOf\n * @param {Object} obj The object to call indexOn on\n * @param {Function} callback The callback to execute\n * @param {Object} index The index to start searching from\n *\n */\n indexOf: function(obj, element, index) {\n return obj.indexOf ? obj.indexOf.call(obj, element, index) : indexOf.call(obj, element, index);\n },\n\n /**\n * Returns an array of indexes of the first occurrences of the passed elements\n * on the passed object.\n *\n * ```javascript\n * var array = [1, 2, 3, 4, 5];\n * Ember.EnumerableUtils.indexesOf(array, [2, 5]); // [1, 4]\n *\n * var fubar = \"Fubarr\";\n * Ember.EnumerableUtils.indexesOf(fubar, ['b', 'r']); // [2, 4]\n * ```\n *\n * @method indexesOf\n * @param {Object} obj The object to check for element indexes\n * @param {Array} elements The elements to search for on *obj*\n *\n * @return {Array} An array of indexes.\n *\n */\n indexesOf: function(obj, elements) {\n return elements === undefined ? [] : utils.map(elements, function(item) {\n return utils.indexOf(obj, item);\n });\n },\n\n /**\n * Adds an object to an array. If the array already includes the object this\n * method has no effect.\n *\n * @method addObject\n * @param {Array} array The array the passed item should be added to\n * @param {Object} item The item to add to the passed array\n *\n * @return 'undefined'\n */\n addObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index === -1) { array.push(item); }\n },\n\n /**\n * Removes an object from an array. If the array does not contain the passed\n * object this method has no effect.\n *\n * @method removeObject\n * @param {Array} array The array to remove the item from.\n * @param {Object} item The item to remove from the passed array.\n *\n * @return 'undefined'\n */\n removeObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index !== -1) { array.splice(index, 1); }\n },\n\n _replace: function(array, idx, amt, objects) {\n var args = [].concat(objects), chunk, ret = [],\n // https://code.google.com/p/chromium/issues/detail?id=56588\n size = 60000, start = idx, ends = amt, count;\n\n while (args.length) {\n count = ends > size ? size : ends;\n if (count <= 0) { count = 0; }\n\n chunk = args.splice(0, size);\n chunk = [start, count].concat(chunk);\n\n start += size;\n ends -= count;\n\n ret = ret.concat(splice.apply(array, chunk));\n }\n return ret;\n },\n\n /**\n * Replaces objects in an array with the passed objects.\n *\n * ```javascript\n * var array = [1,2,3];\n * Ember.EnumerableUtils.replace(array, 1, 2, [4, 5]); // [1, 4, 5]\n *\n * var array = [1,2,3];\n * Ember.EnumerableUtils.replace(array, 1, 1, [4, 5]); // [1, 4, 5, 3]\n *\n * var array = [1,2,3];\n * Ember.EnumerableUtils.replace(array, 10, 1, [4, 5]); // [1, 2, 3, 4, 5]\n * ```\n *\n * @method replace\n * @param {Array} array The array the objects should be inserted into.\n * @param {Number} idx Starting index in the array to replace. If *idx* >=\n * length, then append to the end of the array.\n * @param {Number} amt Number of elements that should be removed from the array,\n * starting at *idx*\n * @param {Array} objects An array of zero or more objects that should be\n * inserted into the array at *idx*\n *\n * @return {Array} The modified array.\n */\n replace: function(array, idx, amt, objects) {\n if (array.replace) {\n return array.replace(idx, amt, objects);\n } else {\n return utils._replace(array, idx, amt, objects);\n }\n },\n\n /**\n * Calculates the intersection of two arrays. This method returns a new array\n * filled with the records that the two passed arrays share with each other.\n * If there is no intersection, an empty array will be returned.\n *\n * ```javascript\n * var array1 = [1, 2, 3, 4, 5];\n * var array2 = [1, 3, 5, 6, 7];\n *\n * Ember.EnumerableUtils.intersection(array1, array2); // [1, 3, 5]\n *\n * var array1 = [1, 2, 3];\n * var array2 = [4, 5, 6];\n *\n * Ember.EnumerableUtils.intersection(array1, array2); // []\n * ```\n *\n * @method intersection\n * @param {Array} array1 The first array\n * @param {Array} array2 The second array\n *\n * @return {Array} The intersection of the two passed arrays.\n */\n intersection: function(array1, array2) {\n var intersection = [];\n\n utils.forEach(array1, function(element) {\n if (utils.indexOf(array2, element) >= 0) {\n intersection.push(element);\n }\n });\n\n return intersection;\n }\n };\n\n __exports__[\"default\"] = utils;\n });\ndefine(\"ember-metal/error\",\n [\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var create = __dependency1__.create;\n\n var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];\n\n /**\n A subclass of the JavaScript Error object for use in Ember.\n\n @class Error\n @namespace Ember\n @extends Error\n @constructor\n */\n var EmberError = function() {\n var tmp = Error.apply(this, arguments);\n\n // Adds a `stack` property to the given error object that will yield the\n // stack trace at the time captureStackTrace was called.\n // When collecting the stack trace all frames above the topmost call\n // to this function, including that call, will be left out of the\n // stack trace.\n // This is useful because we can hide Ember implementation details\n // that are not very helpful for the user.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, Ember.Error);\n }\n // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n for (var idx = 0; idx < errorProps.length; idx++) {\n this[errorProps[idx]] = tmp[errorProps[idx]];\n }\n };\n\n EmberError.prototype = create(Error.prototype);\n\n __exports__[\"default\"] = EmberError;\n });\ndefine(\"ember-metal/events\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n var Ember = __dependency1__[\"default\"];\n var meta = __dependency2__.meta;\n var META_KEY = __dependency2__.META_KEY;\n var tryFinally = __dependency2__.tryFinally;\n var apply = __dependency2__.apply;\n var applyStr = __dependency2__.applyStr;\n var create = __dependency3__.create;\n\n var a_slice = [].slice,\n metaFor = meta,\n /* listener flags */\n ONCE = 1, SUSPENDED = 2;\n\n\n /*\n The event system uses a series of nested hashes to store listeners on an\n object. When a listener is registered, or when an event arrives, these\n hashes are consulted to determine which target and action pair to invoke.\n\n The hashes are stored in the object's meta hash, and look like this:\n\n // Object's meta hash\n {\n listeners: { // variable name: `listenerSet`\n \"foo:changed\": [ // variable name: `actions`\n target, method, flags\n ]\n }\n }\n\n */\n\n function indexOf(array, target, method) {\n var index = -1;\n // hashes are added to the end of the event array\n // so it makes sense to start searching at the end\n // of the array and search in reverse\n for (var i = array.length - 3 ; i >=0; i -= 3) {\n if (target === array[i] && method === array[i + 1]) {\n index = i; break;\n }\n }\n return index;\n }\n\n function actionsFor(obj, eventName) {\n var meta = metaFor(obj, true),\n actions;\n\n if (!meta.listeners) { meta.listeners = {}; }\n\n if (!meta.hasOwnProperty('listeners')) {\n // setup inherited copy of the listeners object\n meta.listeners = create(meta.listeners);\n }\n\n actions = meta.listeners[eventName];\n\n // if there are actions, but the eventName doesn't exist in our listeners, then copy them from the prototype\n if (actions && !meta.listeners.hasOwnProperty(eventName)) {\n actions = meta.listeners[eventName] = meta.listeners[eventName].slice();\n } else if (!actions) {\n actions = meta.listeners[eventName] = [];\n }\n\n return actions;\n }\n\n function listenersUnion(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n var target = actions[i],\n method = actions[i+1],\n flags = actions[i+2],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex === -1) {\n otherActions.push(target, method, flags);\n }\n }\n }\n\n function listenersDiff(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName],\n diffActions = [];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n var target = actions[i],\n method = actions[i+1],\n flags = actions[i+2],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex !== -1) { continue; }\n\n otherActions.push(target, method, flags);\n diffActions.push(target, method, flags);\n }\n\n return diffActions;\n }\n\n /**\n Add an event listener\n\n @method addListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Boolean} once A flag whether a function should only be called once\n */\n function addListener(obj, eventName, target, method, once) {\n Ember.assert(\"You must pass at least an object and event name to Ember.addListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method),\n flags = 0;\n\n if (once) flags |= ONCE;\n\n if (actionIndex !== -1) { return; }\n\n actions.push(target, method, flags);\n\n if ('function' === typeof obj.didAddListener) {\n obj.didAddListener(eventName, target, method);\n }\n }\n\n /**\n Remove an event listener\n\n Arguments should match those passed to `Ember.addListener`.\n\n @method removeListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n */\n function removeListener(obj, eventName, target, method) {\n Ember.assert(\"You must pass at least an object and event name to Ember.removeListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n function _removeListener(target, method) {\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n // action doesn't exist, give up silently\n if (actionIndex === -1) { return; }\n\n actions.splice(actionIndex, 3);\n\n if ('function' === typeof obj.didRemoveListener) {\n obj.didRemoveListener(eventName, target, method);\n }\n }\n\n if (method) {\n _removeListener(target, method);\n } else {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n _removeListener(actions[i], actions[i+1]);\n }\n }\n }\n\n /**\n Suspend listener during callback.\n\n This should only be used by the target of the event listener\n when it is taking an action that would cause the event, e.g.\n an object might suspend its property change listener while it is\n setting that property.\n\n @method suspendListener\n @for Ember\n\n @private\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n */\n function suspendListener(obj, eventName, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n actions[actionIndex+2] |= SUSPENDED; // mark the action as suspended\n }\n\n function tryable() { return callback.call(target); }\n function finalizer() { if (actionIndex !== -1) { actions[actionIndex+2] &= ~SUSPENDED; } }\n\n return tryFinally(tryable, finalizer);\n }\n\n /**\n Suspends multiple listeners during a callback.\n\n @method suspendListeners\n @for Ember\n\n @private\n @param obj\n @param {Array} eventName Array of event names\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n */\n function suspendListeners(obj, eventNames, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var suspendedActions = [],\n actionsList = [],\n eventName, actions, i, l;\n\n for (i=0, l=eventNames.length; i<l; i++) {\n eventName = eventNames[i];\n actions = actionsFor(obj, eventName);\n var actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n actions[actionIndex+2] |= SUSPENDED;\n suspendedActions.push(actionIndex);\n actionsList.push(actions);\n }\n }\n\n function tryable() { return callback.call(target); }\n\n function finalizer() {\n for (var i = 0, l = suspendedActions.length; i < l; i++) {\n var actionIndex = suspendedActions[i];\n actionsList[i][actionIndex+2] &= ~SUSPENDED;\n }\n }\n\n return tryFinally(tryable, finalizer);\n }\n\n /**\n Return a list of currently watched events\n\n @private\n @method watchedEvents\n @for Ember\n @param obj\n */\n function watchedEvents(obj) {\n var listeners = obj[META_KEY].listeners, ret = [];\n\n if (listeners) {\n for(var eventName in listeners) {\n if (listeners[eventName]) { ret.push(eventName); }\n }\n }\n return ret;\n }\n\n /**\n Send an event. The execution of suspended listeners\n is skipped, and once listeners are removed. A listener without\n a target is executed on the passed object. If an array of actions\n is not passed, the actions stored on the passed object are invoked.\n\n @method sendEvent\n @for Ember\n @param obj\n @param {String} eventName\n @param {Array} params Optional parameters for each listener.\n @param {Array} actions Optional array of actions (listeners).\n @return true\n */\n function sendEvent(obj, eventName, params, actions) {\n // first give object a chance to handle it\n if (obj !== Ember && 'function' === typeof obj.sendEvent) {\n obj.sendEvent(eventName, params);\n }\n\n if (!actions) {\n var meta = obj[META_KEY];\n actions = meta && meta.listeners && meta.listeners[eventName];\n }\n\n if (!actions) { return; }\n\n for (var i = actions.length - 3; i >= 0; i -= 3) { // looping in reverse for once listeners\n var target = actions[i], method = actions[i+1], flags = actions[i+2];\n if (!method) { continue; }\n if (flags & SUSPENDED) { continue; }\n if (flags & ONCE) { removeListener(obj, eventName, target, method); }\n if (!target) { target = obj; }\n if ('string' === typeof method) {\n if (params) {\n applyStr(target, method, params);\n } else {\n target[method]();\n }\n } else {\n if (params) {\n apply(target, method, params);\n } else {\n method.call(target);\n }\n }\n }\n return true;\n }\n\n /**\n @private\n @method hasListeners\n @for Ember\n @param obj\n @param {String} eventName\n */\n function hasListeners(obj, eventName) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n return !!(actions && actions.length);\n }\n\n /**\n @private\n @method listenersFor\n @for Ember\n @param obj\n @param {String} eventName\n */\n function listenersFor(obj, eventName) {\n var ret = [];\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return ret; }\n\n for (var i = 0, l = actions.length; i < l; i += 3) {\n var target = actions[i],\n method = actions[i+1];\n ret.push([target, method]);\n }\n\n return ret;\n }\n\n /**\n Define a property as a function that should be executed when\n a specified event or events are triggered.\n\n\n ``` javascript\n var Job = Ember.Object.extend({\n logCompleted: Ember.on('completed', function() {\n console.log('Job completed!');\n })\n });\n\n var job = Job.create();\n\n Ember.sendEvent(job, 'completed'); // Logs 'Job completed!'\n ```\n\n @method on\n @for Ember\n @param {String} eventNames*\n @param {Function} func\n @return func\n */\n function on(){\n var func = a_slice.call(arguments, -1)[0],\n events = a_slice.call(arguments, 0, -1);\n func.__ember_listens__ = events;\n return func;\n };\n\n __exports__.on = on;\n __exports__.addListener = addListener;\n __exports__.removeListener = removeListener;\n __exports__.suspendListener = suspendListener;\n __exports__.suspendListeners = suspendListeners;\n __exports__.sendEvent = sendEvent;\n __exports__.hasListeners = hasListeners;\n __exports__.watchedEvents = watchedEvents;\n __exports__.listenersFor = listenersFor;\n __exports__.listenersDiff = listenersDiff;\n __exports__.listenersUnion = listenersUnion;\n });\ndefine(\"ember-metal/expand_properties\",\n [\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var EmberError = __dependency1__[\"default\"];\n var EnumerableUtils = __dependency2__[\"default\"];\n\n /**\n @module ember-metal\n */\n\n var forEach = EnumerableUtils.forEach,\n BRACE_EXPANSION = /^((?:[^\\.]*\\.)*)\\{(.*)\\}$/;\n\n /**\n Expands `pattern`, invoking `callback` for each expansion.\n\n The only pattern supported is brace-expansion, anything else will be passed\n once to `callback` directly. Brace expansion can only appear at the end of a\n pattern, for an example see the last call below.\n\n Example\n ```js\n function echo(arg){ console.log(arg); }\n\n Ember.expandProperties('foo.bar', echo); //=> 'foo.bar'\n Ember.expandProperties('{foo,bar}', echo); //=> 'foo', 'bar'\n Ember.expandProperties('foo.{bar,baz}', echo); //=> 'foo.bar', 'foo.baz'\n Ember.expandProperties('{foo,bar}.baz', echo); //=> '{foo,bar}.baz'\n ```\n\n @method\n @private\n @param {string} pattern The property pattern to expand.\n @param {function} callback The callback to invoke. It is invoked once per\n expansion, and is passed the expansion.\n */\n function expandProperties(pattern, callback) {\n var match, prefix, list;\n\n if (pattern.indexOf(' ') > -1) {\n throw new EmberError('Brace expanded properties cannot contain spaces, ' + \n 'e.g. `user.{firstName, lastName}` should be `user.{firstName,lastName}`');\n }\n\n if (match = BRACE_EXPANSION.exec(pattern)) {\n prefix = match[1];\n list = match[2];\n\n forEach(list.split(','), function (suffix) {\n callback(prefix + suffix);\n });\n } else {\n callback(pattern);\n }\n };\n\n __exports__[\"default\"] = expandProperties;\n });\ndefine(\"ember-metal/get_properties\",\n [\"ember-metal/property_get\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var typeOf = __dependency2__.typeOf;\n\n /**\n To get multiple properties at once, call `Ember.getProperties`\n with an object followed by a list of strings or an array:\n\n ```javascript\n Ember.getProperties(record, 'firstName', 'lastName', 'zipCode');\n // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']);\n // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param obj\n @param {String...|Array} list of keys to get\n @return {Hash}\n */\n function getProperties(obj) {\n var ret = {},\n propertyNames = arguments,\n i = 1;\n\n if (arguments.length === 2 && typeOf(arguments[1]) === 'array') {\n i = 0;\n propertyNames = arguments[1];\n }\n for(var len = propertyNames.length; i < len; i++) {\n ret[propertyNames[i]] = get(obj, propertyNames[i]);\n }\n return ret;\n };\n\n __exports__[\"default\"] = getProperties;\n });\ndefine(\"ember-metal/instrumentation\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var tryCatchFinally = __dependency2__.tryCatchFinally;\n\n /**\n The purpose of the Ember Instrumentation module is\n to provide efficient, general-purpose instrumentation\n for Ember.\n\n Subscribe to a listener by using `Ember.subscribe`:\n\n ```javascript\n Ember.subscribe(\"render\", {\n before: function(name, timestamp, payload) {\n\n },\n\n after: function(name, timestamp, payload) {\n\n }\n });\n ```\n\n If you return a value from the `before` callback, that same\n value will be passed as a fourth parameter to the `after`\n callback.\n\n Instrument a block of code by using `Ember.instrument`:\n\n ```javascript\n Ember.instrument(\"render.handlebars\", payload, function() {\n // rendering logic\n }, binding);\n ```\n\n Event names passed to `Ember.instrument` are namespaced\n by periods, from more general to more specific. Subscribers\n can listen for events by whatever level of granularity they\n are interested in.\n\n In the above example, the event is `render.handlebars`,\n and the subscriber listened for all events beginning with\n `render`. It would receive callbacks for events named\n `render`, `render.handlebars`, `render.container`, or\n even `render.handlebars.layout`.\n\n @class Instrumentation\n @namespace Ember\n @static\n */\n var subscribers = [], cache = {};\n\n var populateListeners = function(name) {\n var listeners = [], subscriber;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n subscriber = subscribers[i];\n if (subscriber.regex.test(name)) {\n listeners.push(subscriber.object);\n }\n }\n\n cache[name] = listeners;\n return listeners;\n };\n\n var time = (function() {\n var perf = 'undefined' !== typeof window ? window.performance || {} : {};\n var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow;\n // fn.bind will be available in all the browsers that support the advanced window.performance... ;-)\n return fn ? fn.bind(perf) : function() { return +new Date(); };\n })();\n\n /**\n Notifies event's subscribers, calls `before` and `after` hooks.\n\n @method instrument\n @namespace Ember.Instrumentation\n\n @param {String} [name] Namespaced event name.\n @param {Object} payload\n @param {Function} callback Function that you're instrumenting.\n @param {Object} binding Context that instrument function is called with.\n */\n function instrument(name, payload, callback, binding) {\n var listeners = cache[name], timeName, ret;\n\n // ES6TODO: Docs. What is this?\n if (Ember.STRUCTURED_PROFILE) {\n timeName = name + \": \" + payload.object;\n console.time(timeName);\n }\n\n if (!listeners) {\n listeners = populateListeners(name);\n }\n\n if (listeners.length === 0) {\n ret = callback.call(binding);\n if (Ember.STRUCTURED_PROFILE) { console.timeEnd(timeName); }\n return ret;\n }\n\n var beforeValues = [], listener, i, l;\n\n function tryable() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n }\n\n function catchable(e) {\n payload = payload || {};\n payload.exception = e;\n }\n\n function finalizer() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n\n if (Ember.STRUCTURED_PROFILE) {\n console.timeEnd(timeName);\n }\n }\n\n return tryCatchFinally(tryable, catchable, finalizer);\n };\n\n /**\n Subscribes to a particular event or instrumented block of code.\n\n @method subscribe\n @namespace Ember.Instrumentation\n\n @param {String} [pattern] Namespaced event name.\n @param {Object} [object] Before and After hooks.\n\n @return {Subscriber}\n */\n function subscribe(pattern, object) {\n var paths = pattern.split(\".\"), path, regex = [];\n\n for (var i=0, l=paths.length; i<l; i++) {\n path = paths[i];\n if (path === \"*\") {\n regex.push(\"[^\\\\.]*\");\n } else {\n regex.push(path);\n }\n }\n\n regex = regex.join(\"\\\\.\");\n regex = regex + \"(\\\\..*)?\";\n\n var subscriber = {\n pattern: pattern,\n regex: new RegExp(\"^\" + regex + \"$\"),\n object: object\n };\n\n subscribers.push(subscriber);\n cache = {};\n\n return subscriber;\n };\n\n /**\n Unsubscribes from a particular event or instrumented block of code.\n\n @method unsubscribe\n @namespace Ember.Instrumentation\n\n @param {Object} [subscriber]\n */\n function unsubscribe(subscriber) {\n var index;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n if (subscribers[i] === subscriber) {\n index = i;\n }\n }\n\n subscribers.splice(index, 1);\n cache = {};\n };\n\n /**\n Resets `Ember.Instrumentation` by flushing list of subscribers.\n\n @method reset\n @namespace Ember.Instrumentation\n */\n function reset() {\n subscribers = [];\n cache = {};\n };\n\n __exports__.instrument = instrument;\n __exports__.subscribe = subscribe;\n __exports__.unsubscribe = unsubscribe;\n __exports__.reset = reset;\n });\ndefine(\"ember-metal/is_blank\",\n [\"ember-metal/core\",\"ember-metal/is_empty\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // deprecateFunc\n var isEmpty = __dependency2__[\"default\"];\n\n /**\n A value is blank if it is empty or a whitespace string.\n\n ```javascript\n Ember.isBlank(); // true\n Ember.isBlank(null); // true\n Ember.isBlank(undefined); // true\n Ember.isBlank(''); // true\n Ember.isBlank([]); // true\n Ember.isBlank('\\n\\t'); // true\n Ember.isBlank(' '); // true\n Ember.isBlank({}); // false\n Ember.isBlank('\\n\\t Hello'); // false\n Ember.isBlank('Hello world'); // false\n Ember.isBlank([1,2,3]); // false\n ```\n\n @method isBlank\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n @since 1.5.0\n */\n function isBlank(obj) {\n return isEmpty(obj) || (typeof obj === 'string' && obj.match(/\\S/) === null);\n };\n\n __exports__[\"default\"] = isBlank;\n });\ndefine(\"ember-metal/is_empty\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/is_none\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // deprecateFunc\n var get = __dependency2__.get;\n var isNone = __dependency3__[\"default\"];\n\n /**\n Verifies that a value is `null` or an empty string, empty array,\n or empty function.\n\n Constrains the rules on `Ember.isNone` by returning false for empty\n string and empty arrays.\n\n ```javascript\n Ember.isEmpty(); // true\n Ember.isEmpty(null); // true\n Ember.isEmpty(undefined); // true\n Ember.isEmpty(''); // true\n Ember.isEmpty([]); // true\n Ember.isEmpty('Adam Hawkins'); // false\n Ember.isEmpty([0,1,2]); // false\n ```\n\n @method isEmpty\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n */\n var isEmpty = function(obj) {\n return isNone(obj) || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && get(obj, 'length') === 0);\n };\n var empty = Ember.deprecateFunc(\"Ember.empty is deprecated. Please use Ember.isEmpty instead.\", isEmpty);\n\n __exports__[\"default\"] = isEmpty;\n __exports__.isEmpty = isEmpty;\n __exports__.empty = empty;\n });\ndefine(\"ember-metal/is_none\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // deprecateFunc\n\n /**\n Returns true if the passed value is null or undefined. This avoids errors\n from JSLint complaining about use of ==, which can be technically\n confusing.\n\n ```javascript\n Ember.isNone(); // true\n Ember.isNone(null); // true\n Ember.isNone(undefined); // true\n Ember.isNone(''); // false\n Ember.isNone([]); // false\n Ember.isNone(function() {}); // false\n ```\n\n @method isNone\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n */\n var isNone = function(obj) {\n return obj === null || obj === undefined;\n };\n var none = Ember.deprecateFunc(\"Ember.none is deprecated. Please use Ember.isNone instead.\", isNone);\n\n __exports__[\"default\"] = isNone;\n __exports__.isNone = isNone;\n __exports__.none = none;\n });\ndefine(\"ember-metal/libraries\",\n [\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n // Provides a way to register library versions with ember.\n var EnumerableUtils = __dependency1__[\"default\"];\n\n var forEach = EnumerableUtils.forEach,\n indexOf = EnumerableUtils.indexOf;\n\n var libraries = function() {\n var _libraries = [];\n var coreLibIndex = 0;\n\n var getLibrary = function(name) {\n for (var i = 0; i < _libraries.length; i++) {\n if (_libraries[i].name === name) {\n return _libraries[i];\n }\n }\n };\n\n _libraries.register = function(name, version) {\n if (!getLibrary(name)) {\n _libraries.push({name: name, version: version});\n }\n };\n\n _libraries.registerCoreLibrary = function(name, version) {\n if (!getLibrary(name)) {\n _libraries.splice(coreLibIndex++, 0, {name: name, version: version});\n }\n };\n\n _libraries.deRegister = function(name) {\n var lib = getLibrary(name);\n if (lib) _libraries.splice(indexOf(_libraries, lib), 1);\n };\n\n _libraries.each = function (callback) {\n forEach(_libraries, function(lib) {\n callback(lib.name, lib.version);\n });\n };\n\n return _libraries;\n }();\n\n __exports__[\"default\"] = libraries;\n });\ndefine(\"ember-metal/logger\",\n [\"ember-metal/core\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var EmberError = __dependency2__[\"default\"];\n\n function consoleMethod(name) {\n var consoleObj, logToConsole;\n if (Ember.imports.console) {\n consoleObj = Ember.imports.console;\n } else if (typeof console !== 'undefined') {\n consoleObj = console;\n }\n\n var method = typeof consoleObj === 'object' ? consoleObj[name] : null;\n\n if (method) {\n // Older IE doesn't support apply, but Chrome needs it\n if (typeof method.apply === 'function') {\n logToConsole = function() {\n method.apply(consoleObj, arguments);\n };\n logToConsole.displayName = 'console.' + name;\n return logToConsole;\n } else {\n return function() {\n var message = Array.prototype.join.call(arguments, ', ');\n method(message);\n };\n }\n }\n }\n\n function assertPolyfill(test, message) {\n if (!test) {\n try {\n // attempt to preserve the stack\n throw new EmberError(\"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 */\n var Logger = {\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\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\n @method log\n @for Ember.Logger\n @param {*} arguments\n */\n log: consoleMethod('log') || Ember.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\n ```javascript\n Ember.Logger.warn('Something happened!');\n // \"Something happened!\" will be printed to the console with a warning icon.\n ```\n\n @method warn\n @for Ember.Logger\n @param {*} arguments\n */\n warn: consoleMethod('warn') || Ember.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\n ```javascript\n Ember.Logger.error('Danger! Danger!');\n // \"Danger! Danger!\" will be printed to the console in red text.\n ```\n\n @method error\n @for Ember.Logger\n @param {*} arguments\n */\n error: consoleMethod('error') || Ember.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\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\n @method info\n @for Ember.Logger\n @param {*} arguments\n */\n info: consoleMethod('info') || Ember.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\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\n @method debug\n @for Ember.Logger\n @param {*} arguments\n */\n debug: consoleMethod('debug') || consoleMethod('info') || Ember.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\n ```javascript\n Ember.Logger.assert(true); // undefined\n Ember.Logger.assert(true === false); // Throws an Assertion failed error.\n ```\n\n @method assert\n @for Ember.Logger\n @param {Boolean} bool Value to test\n */\n assert: consoleMethod('assert') || assertPolyfill\n };\n\n __exports__[\"default\"] = Logger;\n });\ndefine(\"ember-metal\",\n [\"ember-metal/core\",\"ember-metal/merge\",\"ember-metal/instrumentation\",\"ember-metal/utils\",\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"ember-metal/platform\",\"ember-metal/array\",\"ember-metal/logger\",\"ember-metal/property_get\",\"ember-metal/events\",\"ember-metal/observer_set\",\"ember-metal/property_events\",\"ember-metal/properties\",\"ember-metal/property_set\",\"ember-metal/map\",\"ember-metal/get_properties\",\"ember-metal/set_properties\",\"ember-metal/watch_key\",\"ember-metal/chains\",\"ember-metal/watch_path\",\"ember-metal/watching\",\"ember-metal/expand_properties\",\"ember-metal/computed\",\"ember-metal/observer\",\"ember-metal/mixin\",\"ember-metal/binding\",\"ember-metal/run_loop\",\"ember-metal/libraries\",\"ember-metal/is_none\",\"ember-metal/is_empty\",\"ember-metal/is_blank\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __dependency27__, __dependency28__, __dependency29__, __dependency30__, __dependency31__, __dependency32__, __exports__) {\n \"use strict\";\n /**\n Ember Metal\n\n @module ember\n @submodule ember-metal\n */\n\n // BEGIN IMPORTS\n var Ember = __dependency1__[\"default\"];\n var merge = __dependency2__[\"default\"];\n var instrument = __dependency3__.instrument;\n var subscribe = __dependency3__.subscribe;\n var unsubscribe = __dependency3__.unsubscribe;\n var reset = __dependency3__.reset;\n var generateGuid = __dependency4__.generateGuid;\n var GUID_KEY = __dependency4__.GUID_KEY;\n var GUID_PREFIX = __dependency4__.GUID_PREFIX;\n var guidFor = __dependency4__.guidFor;\n var META_DESC = __dependency4__.META_DESC;\n var EMPTY_META = __dependency4__.EMPTY_META;\n var meta = __dependency4__.meta;\n var getMeta = __dependency4__.getMeta;\n var setMeta = __dependency4__.setMeta;\n var metaPath = __dependency4__.metaPath;\n var inspect = __dependency4__.inspect;\n var typeOf = __dependency4__.typeOf;\n var tryCatchFinally = __dependency4__.tryCatchFinally;\n var isArray = __dependency4__.isArray;\n var makeArray = __dependency4__.makeArray;\n var canInvoke = __dependency4__.canInvoke;\n var tryInvoke = __dependency4__.tryInvoke;\n var tryFinally = __dependency4__.tryFinally;\n var wrap = __dependency4__.wrap;\n var apply = __dependency4__.apply;\n var applyStr = __dependency4__.applyStr;\n var EmberError = __dependency5__[\"default\"];\n var EnumerableUtils = __dependency6__[\"default\"];\n\n var create = __dependency7__.create;\n var platform = __dependency7__.platform;\n var map = __dependency8__.map;\n var forEach = __dependency8__.forEach;\n var filter = __dependency8__.filter;\n var indexOf = __dependency8__.indexOf;\n var Logger = __dependency9__[\"default\"];\n\n var get = __dependency10__.get;\n var getWithDefault = __dependency10__.getWithDefault;\n var normalizeTuple = __dependency10__.normalizeTuple;\n var _getPath = __dependency10__._getPath;\n\n var on = __dependency11__.on;\n var addListener = __dependency11__.addListener;\n var removeListener = __dependency11__.removeListener;\n var suspendListener = __dependency11__.suspendListener;\n var suspendListeners = __dependency11__.suspendListeners;\n var sendEvent = __dependency11__.sendEvent;\n var hasListeners = __dependency11__.hasListeners;\n var watchedEvents = __dependency11__.watchedEvents;\n var listenersFor = __dependency11__.listenersFor;\n var listenersDiff = __dependency11__.listenersDiff;\n var listenersUnion = __dependency11__.listenersUnion;\n\n var ObserverSet = __dependency12__[\"default\"];\n\n var propertyWillChange = __dependency13__.propertyWillChange;\n var propertyDidChange = __dependency13__.propertyDidChange;\n var overrideChains = __dependency13__.overrideChains;\n var beginPropertyChanges = __dependency13__.beginPropertyChanges;\n var endPropertyChanges = __dependency13__.endPropertyChanges;\n var changeProperties = __dependency13__.changeProperties;\n\n var Descriptor = __dependency14__.Descriptor;\n var defineProperty = __dependency14__.defineProperty;\n var set = __dependency15__.set;\n var trySet = __dependency15__.trySet;\n\n var OrderedSet = __dependency16__.OrderedSet;\n var Map = __dependency16__.Map;\n var MapWithDefault = __dependency16__.MapWithDefault;\n var getProperties = __dependency17__[\"default\"];\n var setProperties = __dependency18__[\"default\"];\n var watchKey = __dependency19__.watchKey;\n var unwatchKey = __dependency19__.unwatchKey;\n var flushPendingChains = __dependency20__.flushPendingChains;\n var removeChainWatcher = __dependency20__.removeChainWatcher;\n var ChainNode = __dependency20__.ChainNode;\n var finishChains = __dependency20__.finishChains;\n var watchPath = __dependency21__.watchPath;\n var unwatchPath = __dependency21__.unwatchPath;\n var watch = __dependency22__.watch;\n var isWatching = __dependency22__.isWatching;\n var unwatch = __dependency22__.unwatch;\n var rewatch = __dependency22__.rewatch;\n var destroy = __dependency22__.destroy;\n var expandProperties = __dependency23__[\"default\"];\n var ComputedProperty = __dependency24__.ComputedProperty;\n var computed = __dependency24__.computed;\n var cacheFor = __dependency24__.cacheFor;\n\n var addObserver = __dependency25__.addObserver;\n var observersFor = __dependency25__.observersFor;\n var removeObserver = __dependency25__.removeObserver;\n var addBeforeObserver = __dependency25__.addBeforeObserver;\n var _suspendBeforeObserver = __dependency25__._suspendBeforeObserver;\n var _suspendObserver = __dependency25__._suspendObserver;\n var _suspendBeforeObservers = __dependency25__._suspendBeforeObservers;\n var _suspendObservers = __dependency25__._suspendObservers;\n var beforeObserversFor = __dependency25__.beforeObserversFor;\n var removeBeforeObserver = __dependency25__.removeBeforeObserver;\n var IS_BINDING = __dependency26__.IS_BINDING;\n var mixin = __dependency26__.mixin;\n var Mixin = __dependency26__.Mixin;\n var required = __dependency26__.required;\n var aliasMethod = __dependency26__.aliasMethod;\n var observer = __dependency26__.observer;\n var immediateObserver = __dependency26__.immediateObserver;\n var beforeObserver = __dependency26__.beforeObserver;\n var Binding = __dependency27__.Binding;\n var isGlobalPath = __dependency27__.isGlobalPath;\n var bind = __dependency27__.bind;\n var oneWay = __dependency27__.oneWay;\n var run = __dependency28__[\"default\"];\n var libraries = __dependency29__[\"default\"];\n var isNone = __dependency30__.isNone;\n var none = __dependency30__.none;\n var isEmpty = __dependency31__.isEmpty;\n var empty = __dependency31__.empty;\n var isBlank = __dependency32__[\"default\"];\n // END IMPORTS\n\n // BEGIN EXPORTS\n var EmberInstrumentation = Ember.Instrumentation = {};\n EmberInstrumentation.instrument = instrument;\n EmberInstrumentation.subscribe = subscribe;\n EmberInstrumentation.unsubscribe = unsubscribe;\n EmberInstrumentation.reset = reset;\n\n Ember.instrument = instrument;\n Ember.subscribe = subscribe;\n\n Ember.generateGuid = generateGuid;\n Ember.GUID_KEY = GUID_KEY;\n Ember.GUID_PREFIX = GUID_PREFIX;\n Ember.create = create;\n Ember.platform = platform;\n\n var EmberArrayPolyfills = Ember.ArrayPolyfills = {};\n\n EmberArrayPolyfills.map = map;\n EmberArrayPolyfills.forEach = forEach;\n EmberArrayPolyfills.filter = filter;\n EmberArrayPolyfills.indexOf = indexOf;\n\n Ember.Error = EmberError;\n Ember.guidFor = guidFor;\n Ember.META_DESC = META_DESC;\n Ember.EMPTY_META = EMPTY_META;\n Ember.meta = meta;\n Ember.getMeta = getMeta;\n Ember.setMeta = setMeta;\n Ember.metaPath = metaPath;\n Ember.inspect = inspect;\n Ember.typeOf = typeOf;\n Ember.tryCatchFinally = tryCatchFinally;\n Ember.isArray = isArray;\n Ember.makeArray = makeArray;\n Ember.canInvoke = canInvoke;\n Ember.tryInvoke = tryInvoke;\n Ember.tryFinally = tryFinally;\n Ember.wrap = wrap;\n Ember.apply = apply;\n Ember.applyStr = applyStr;\n\n Ember.Logger = Logger;\n\n Ember.get = get;\n Ember.getWithDefault = getWithDefault;\n Ember.normalizeTuple = normalizeTuple;\n Ember._getPath = _getPath;\n\n Ember.EnumerableUtils = EnumerableUtils;\n\n Ember.on = on;\n Ember.addListener = addListener;\n Ember.removeListener = removeListener;\n Ember._suspendListener = suspendListener;\n Ember._suspendListeners = suspendListeners;\n Ember.sendEvent = sendEvent;\n Ember.hasListeners = hasListeners;\n Ember.watchedEvents = watchedEvents;\n Ember.listenersFor = listenersFor;\n Ember.listenersDiff = listenersDiff;\n Ember.listenersUnion = listenersUnion;\n\n Ember._ObserverSet = ObserverSet;\n\n Ember.propertyWillChange = propertyWillChange;\n Ember.propertyDidChange = propertyDidChange;\n Ember.overrideChains = overrideChains;\n Ember.beginPropertyChanges = beginPropertyChanges;\n Ember.endPropertyChanges = endPropertyChanges;\n Ember.changeProperties = changeProperties;\n\n Ember.Descriptor = Descriptor;\n Ember.defineProperty = defineProperty;\n\n Ember.set = set;\n Ember.trySet = trySet;\n\n Ember.OrderedSet = OrderedSet;\n Ember.Map = Map;\n Ember.MapWithDefault = MapWithDefault;\n\n Ember.getProperties = getProperties;\n Ember.setProperties = setProperties;\n\n Ember.watchKey = watchKey;\n Ember.unwatchKey = unwatchKey;\n\n Ember.flushPendingChains = flushPendingChains;\n Ember.removeChainWatcher = removeChainWatcher;\n Ember._ChainNode = ChainNode;\n Ember.finishChains = finishChains;\n\n Ember.watchPath = watchPath;\n Ember.unwatchPath = unwatchPath;\n\n Ember.watch = watch;\n Ember.isWatching = isWatching;\n Ember.unwatch = unwatch;\n Ember.rewatch = rewatch;\n Ember.destroy = destroy;\n\n Ember.expandProperties = expandProperties;\n\n Ember.ComputedProperty = ComputedProperty;\n Ember.computed = computed;\n Ember.cacheFor = cacheFor;\n\n Ember.addObserver = addObserver;\n Ember.observersFor = observersFor;\n Ember.removeObserver = removeObserver;\n Ember.addBeforeObserver = addBeforeObserver;\n Ember._suspendBeforeObserver = _suspendBeforeObserver;\n Ember._suspendBeforeObservers = _suspendBeforeObservers;\n Ember._suspendObserver = _suspendObserver;\n Ember._suspendObservers = _suspendObservers;\n Ember.beforeObserversFor = beforeObserversFor;\n Ember.removeBeforeObserver = removeBeforeObserver;\n\n Ember.IS_BINDING = IS_BINDING;\n Ember.required = required;\n Ember.aliasMethod = aliasMethod;\n Ember.observer = observer;\n Ember.immediateObserver = immediateObserver;\n Ember.beforeObserver = beforeObserver;\n Ember.mixin = mixin;\n Ember.Mixin = Mixin;\n\n Ember.oneWay = oneWay;\n Ember.bind = bind;\n Ember.Binding = Binding;\n Ember.isGlobalPath = isGlobalPath;\n\n Ember.run = run;\n\n Ember.libraries = libraries;\n Ember.libraries.registerCoreLibrary('Ember', Ember.VERSION);\n\n Ember.isNone = isNone;\n Ember.none = none;\n\n Ember.isEmpty = isEmpty;\n Ember.empty = empty;\n\n Ember.isBlank = isBlank;\n\n Ember.merge = merge;\n\n /**\n A function may be assigned to `Ember.onerror` to be called when Ember\n internals encounter an error. This is useful for specialized error handling\n and reporting code.\n\n ```javascript\n Ember.onerror = function(error) {\n Em.$.ajax('/report-error', 'POST', {\n stack: error.stack,\n otherInformation: 'whatever app state you want to provide'\n });\n };\n ```\n\n Internally, `Ember.onerror` is used as Backburner's error handler.\n\n @event onerror\n @for Ember\n @param {Exception} error the error object\n */\n Ember.onerror = null;\n // END EXPORTS\n\n // do this for side-effects of updating Ember.assert, warn, etc when\n // ember-debug is present\n if (Ember.__loader.registry['ember-debug']) {\n requireModule('ember-debug');\n }\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-metal/map\",\n [\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/array\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n\n /*\n JavaScript (before ES6) does not have a Map implementation. Objects,\n which are often used as dictionaries, may only have Strings as keys.\n\n Because Ember has a way to get a unique identifier for every object\n via `Ember.guidFor`, we can implement a performant Map with arbitrary\n keys. Because it is commonly used in low-level bookkeeping, Map is\n implemented as a pure JavaScript object for performance.\n\n This implementation follows the current iteration of the ES6 proposal for\n maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),\n with two exceptions. First, because we need our implementation to be pleasant\n on older browsers, we do not use the `delete` name (using `remove` instead).\n Second, as we do not have the luxury of in-VM iteration, we implement a\n forEach method for iteration.\n\n Map is mocked out to look like an Ember object, so you can do\n `Ember.Map.create()` for symmetry with other Ember classes.\n */\n\n var set = __dependency1__.set;\n var guidFor = __dependency2__.guidFor;\n var indexOf = __dependency3__.indexOf;var create = __dependency4__.create;\n\n var copy = function(obj) {\n var output = {};\n\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) { output[prop] = obj[prop]; }\n }\n\n return output;\n };\n\n var copyMap = function(original, newObject) {\n var keys = original.keys.copy(),\n values = copy(original.values);\n\n newObject.keys = keys;\n newObject.values = values;\n newObject.length = original.length;\n\n return newObject;\n };\n\n /**\n This class is used internally by Ember and Ember Data.\n Please do not use it at this time. We plan to clean it up\n and add many tests soon.\n\n @class OrderedSet\n @namespace Ember\n @constructor\n @private\n */\n function OrderedSet() {\n this.clear();\n };\n\n /**\n @method create\n @static\n @return {Ember.OrderedSet}\n */\n OrderedSet.create = function() {\n return new OrderedSet();\n };\n\n\n OrderedSet.prototype = {\n /**\n @method clear\n */\n clear: function() {\n this.presenceSet = {};\n this.list = [];\n },\n\n /**\n @method add\n @param obj\n */\n add: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n if (guid in presenceSet) { return; }\n\n presenceSet[guid] = true;\n list.push(obj);\n },\n\n /**\n @method remove\n @param obj\n */\n remove: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n delete presenceSet[guid];\n\n var index = indexOf.call(list, obj);\n if (index > -1) {\n list.splice(index, 1);\n }\n },\n\n /**\n @method isEmpty\n @return {Boolean}\n */\n isEmpty: function() {\n return this.list.length === 0;\n },\n\n /**\n @method has\n @param obj\n @return {Boolean}\n */\n has: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet;\n\n return guid in presenceSet;\n },\n\n /**\n @method forEach\n @param {Function} fn\n @param self\n */\n forEach: function(fn, self) {\n // allow mutation during iteration\n var list = this.toArray();\n\n for (var i = 0, j = list.length; i < j; i++) {\n fn.call(self, list[i]);\n }\n },\n\n /**\n @method toArray\n @return {Array}\n */\n toArray: function() {\n return this.list.slice();\n },\n\n /**\n @method copy\n @return {Ember.OrderedSet}\n */\n copy: function() {\n var set = new OrderedSet();\n\n set.presenceSet = copy(this.presenceSet);\n set.list = this.toArray();\n\n return set;\n }\n };\n\n /**\n A Map stores values indexed by keys. Unlike JavaScript's\n default Objects, the keys of a Map can be any JavaScript\n object.\n\n Internally, a Map has two data structures:\n\n 1. `keys`: an OrderedSet of all of the existing keys\n 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)`\n\n When a key/value pair is added for the first time, we\n add the key to the `keys` OrderedSet, and create or\n replace an entry in `values`. When an entry is deleted,\n we delete its entry in `keys` and `values`.\n\n @class Map\n @namespace Ember\n @private\n @constructor\n */\n var Map = Ember.Map = function() {\n this.keys = OrderedSet.create();\n this.values = {};\n };\n\n /**\n @method create\n @static\n */\n Map.create = function() {\n return new Map();\n };\n\n Map.prototype = {\n /**\n This property will change as the number of objects in the map changes.\n\n @property length\n @type number\n @default 0\n */\n length: 0,\n\n\n /**\n Retrieve the value associated with a given key.\n\n @method get\n @param {*} key\n @return {*} the value associated with the key, or `undefined`\n */\n get: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values[guid];\n },\n\n /**\n Adds a value to the map. If a value for the given key has already been\n provided, the new value will replace the old value.\n\n @method set\n @param {*} key\n @param {*} value\n */\n set: function(key, value) {\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n keys.add(key);\n values[guid] = value;\n set(this, 'length', keys.list.length);\n },\n\n /**\n Removes a value from the map for an associated key.\n\n @method remove\n @param {*} key\n @return {Boolean} true if an item was removed, false otherwise\n */\n remove: function(key) {\n // don't use ES6 \"delete\" because it will be annoying\n // to use in browsers that are not ES6 friendly;\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n if (values.hasOwnProperty(guid)) {\n keys.remove(key);\n delete values[guid];\n set(this, 'length', keys.list.length);\n return true;\n } else {\n return false;\n }\n },\n\n /**\n Check whether a key is present.\n\n @method has\n @param {*} key\n @return {Boolean} true if the item was present, false otherwise\n */\n has: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values.hasOwnProperty(guid);\n },\n\n /**\n Iterate over all the keys and values. Calls the function once\n for each key, passing in the key and value, in that order.\n\n The keys are guaranteed to be iterated over in insertion order.\n\n @method forEach\n @param {Function} callback\n @param {*} self if passed, the `this` value inside the\n callback. By default, `this` is the map.\n */\n forEach: function(callback, self) {\n var keys = this.keys,\n values = this.values;\n\n keys.forEach(function(key) {\n var guid = guidFor(key);\n callback.call(self, key, values[guid]);\n });\n },\n\n /**\n @method copy\n @return {Ember.Map}\n */\n copy: function() {\n return copyMap(this, new Map());\n }\n };\n\n /**\n @class MapWithDefault\n @namespace Ember\n @extends Ember.Map\n @private\n @constructor\n @param [options]\n @param {*} [options.defaultValue]\n */\n function MapWithDefault(options) {\n Map.call(this);\n this.defaultValue = options.defaultValue;\n };\n\n /**\n @method create\n @static\n @param [options]\n @param {*} [options.defaultValue]\n @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns\n `Ember.MapWithDefault` otherwise returns `Ember.Map`\n */\n MapWithDefault.create = function(options) {\n if (options) {\n return new MapWithDefault(options);\n } else {\n return new Map();\n }\n };\n\n MapWithDefault.prototype = create(Map.prototype);\n\n /**\n Retrieve the value associated with a given key.\n\n @method get\n @param {*} key\n @return {*} the value associated with the key, or the default value\n */\n MapWithDefault.prototype.get = function(key) {\n var hasValue = this.has(key);\n\n if (hasValue) {\n return Map.prototype.get.call(this, key);\n } else {\n var defaultValue = this.defaultValue(key);\n this.set(key, defaultValue);\n return defaultValue;\n }\n };\n\n /**\n @method copy\n @return {Ember.MapWithDefault}\n */\n MapWithDefault.prototype.copy = function() {\n return copyMap(this, new MapWithDefault({\n defaultValue: this.defaultValue\n }));\n };\n\n __exports__.OrderedSet = OrderedSet;\n __exports__.Map = Map;\n __exports__.MapWithDefault = MapWithDefault;\n });\ndefine(\"ember-metal/merge\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n Merge the contents of two objects together into the first object.\n\n ```javascript\n Ember.merge({first: 'Tom'}, {last: 'Dale'}); // {first: 'Tom', last: 'Dale'}\n var a = {first: 'Yehuda'}, b = {last: 'Katz'};\n Ember.merge(a, b); // a == {first: 'Yehuda', last: 'Katz'}, b == {last: 'Katz'}\n ```\n\n @method merge\n @for Ember\n @param {Object} original The object to merge into\n @param {Object} updates The object to copy properties from\n @return {Object}\n */\n function merge(original, updates) {\n for (var prop in updates) {\n if (!updates.hasOwnProperty(prop)) { continue; }\n original[prop] = updates[prop];\n }\n return original;\n };\n\n __exports__[\"default\"] = merge;\n });\ndefine(\"ember-metal/mixin\",\n [\"ember-metal/core\",\"ember-metal/merge\",\"ember-metal/array\",\"ember-metal/platform\",\"ember-metal/utils\",\"ember-metal/expand_properties\",\"ember-metal/properties\",\"ember-metal/computed\",\"ember-metal/binding\",\"ember-metal/observer\",\"ember-metal/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-metal\n */\n\n var Ember = __dependency1__[\"default\"];\n // warn, assert, wrap, et;\n var merge = __dependency2__[\"default\"];\n var map = __dependency3__.map;\n var indexOf = __dependency3__.indexOf;\n var forEach = __dependency3__.forEach;\n var create = __dependency4__.create;\n var guidFor = __dependency5__.guidFor;\n var meta = __dependency5__.meta;\n var META_KEY = __dependency5__.META_KEY;\n var wrap = __dependency5__.wrap;\n var makeArray = __dependency5__.makeArray;\n var apply = __dependency5__.apply;\n var expandProperties = __dependency6__[\"default\"];\n var Descriptor = __dependency7__.Descriptor;\n var defineProperty = __dependency7__.defineProperty;\n var ComputedProperty = __dependency8__.ComputedProperty;\n var Binding = __dependency9__.Binding;\n var addObserver = __dependency10__.addObserver;\n var removeObserver = __dependency10__.removeObserver;\n var addBeforeObserver = __dependency10__.addBeforeObserver;\n var removeBeforeObserver = __dependency10__.removeBeforeObserver;\n var addListener = __dependency11__.addListener;\n var removeListener = __dependency11__.removeListener;\n\n var REQUIRED, Alias,\n a_map = map,\n a_indexOf = indexOf,\n a_forEach = forEach,\n a_slice = [].slice,\n o_create = create,\n defineProperty = defineProperty,\n metaFor = meta;\n\n function superFunction(){\n var ret, func = this.__nextSuper;\n if (func) {\n this.__nextSuper = null;\n ret = apply(this, func, arguments);\n this.__nextSuper = func;\n }\n return ret;\n }\n\n function mixinsMeta(obj) {\n var m = metaFor(obj, true), ret = m.mixins;\n if (!ret) {\n ret = m.mixins = {};\n } else if (!m.hasOwnProperty('mixins')) {\n ret = m.mixins = o_create(ret);\n }\n return ret;\n }\n\n function initMixin(mixin, args) {\n if (args && args.length > 0) {\n mixin.mixins = a_map.call(args, function(x) {\n if (x instanceof Mixin) { return x; }\n\n // Note: Manually setup a primitive mixin here. This is the only\n // way to actually get a primitive mixin. This way normal creation\n // of mixins will give you combined mixins...\n var mixin = new Mixin();\n mixin.properties = x;\n return mixin;\n });\n }\n return mixin;\n }\n\n function isMethod(obj) {\n return 'function' === typeof obj &&\n obj.isMethod !== false &&\n obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;\n }\n\n var CONTINUE = {};\n\n function mixinProperties(mixinsMeta, mixin) {\n var guid;\n\n if (mixin instanceof Mixin) {\n guid = guidFor(mixin);\n if (mixinsMeta[guid]) { return CONTINUE; }\n mixinsMeta[guid] = mixin;\n return mixin.properties;\n } else {\n return mixin; // apply anonymous mixin properties\n }\n }\n\n function concatenatedMixinProperties(concatProp, props, values, base) {\n var concats;\n\n // reset before adding each new mixin to pickup concats from previous\n concats = values[concatProp] || base[concatProp];\n if (props[concatProp]) {\n concats = concats ? concats.concat(props[concatProp]) : props[concatProp];\n }\n\n return concats;\n }\n\n function giveDescriptorSuper(meta, key, property, values, descs) {\n var superProperty;\n\n // Computed properties override methods, and do not call super to them\n if (values[key] === undefined) {\n // Find the original descriptor in a parent mixin\n superProperty = descs[key];\n }\n\n // If we didn't find the original descriptor in a parent mixin, find\n // it on the original object.\n superProperty = superProperty || meta.descs[key];\n\n if (!superProperty || !(superProperty instanceof ComputedProperty)) {\n return property;\n }\n\n // Since multiple mixins may inherit from the same parent, we need\n // to clone the computed property so that other mixins do not receive\n // the wrapped version.\n property = o_create(property);\n property.func = wrap(property.func, superProperty.func);\n\n return property;\n }\n\n function giveMethodSuper(obj, key, method, values, descs) {\n var superMethod;\n\n // Methods overwrite computed properties, and do not call super to them.\n if (descs[key] === undefined) {\n // Find the original method in a parent mixin\n superMethod = values[key];\n }\n\n // If we didn't find the original value in a parent mixin, find it in\n // the original object\n superMethod = superMethod || obj[key];\n\n // Only wrap the new method if the original method was a function\n if ('function' !== typeof superMethod) {\n return method;\n }\n\n return wrap(method, superMethod);\n }\n\n function applyConcatenatedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n return baseValue.concat(value);\n } else {\n return makeArray(baseValue).concat(value);\n }\n } else {\n return makeArray(value);\n }\n }\n\n function applyMergedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (!baseValue) { return value; }\n\n var newBase = merge({}, baseValue),\n hasFunction = false;\n\n for (var prop in value) {\n if (!value.hasOwnProperty(prop)) { continue; }\n\n var propValue = value[prop];\n if (isMethod(propValue)) {\n // TODO: support for Computed Properties, etc?\n hasFunction = true;\n newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {});\n } else {\n newBase[prop] = propValue;\n }\n }\n\n if (hasFunction) {\n newBase._super = superFunction;\n }\n\n return newBase;\n }\n\n function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) {\n if (value instanceof Descriptor) {\n if (value === REQUIRED && descs[key]) { return CONTINUE; }\n\n // Wrap descriptor function to implement\n // __nextSuper() if needed\n if (value.func) {\n value = giveDescriptorSuper(meta, key, value, values, descs);\n }\n\n descs[key] = value;\n values[key] = undefined;\n } else {\n if ((concats && a_indexOf.call(concats, key) >= 0) ||\n key === 'concatenatedProperties' ||\n key === 'mergedProperties') {\n value = applyConcatenatedProperties(base, key, value, values);\n } else if ((mergings && a_indexOf.call(mergings, key) >= 0)) {\n value = applyMergedProperties(base, key, value, values);\n } else if (isMethod(value)) {\n value = giveMethodSuper(base, key, value, values, descs);\n }\n\n descs[key] = undefined;\n values[key] = value;\n }\n }\n\n function mergeMixins(mixins, m, descs, values, base, keys) {\n var mixin, props, key, concats, mergings, meta;\n\n function removeKeys(keyName) {\n delete descs[keyName];\n delete values[keyName];\n }\n\n for(var i=0, l=mixins.length; i<l; i++) {\n mixin = mixins[i];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin),\n typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n props = mixinProperties(m, mixin);\n if (props === CONTINUE) { continue; }\n\n if (props) {\n meta = metaFor(base);\n if (base.willMergeMixin) { base.willMergeMixin(props); }\n concats = concatenatedMixinProperties('concatenatedProperties', props, values, base);\n mergings = concatenatedMixinProperties('mergedProperties', props, values, base);\n\n for (key in props) {\n if (!props.hasOwnProperty(key)) { continue; }\n keys.push(key);\n addNormalizedProperty(base, key, props[key], meta, descs, values, concats, mergings);\n }\n\n // manually copy toString() because some JS engines do not enumerate it\n if (props.hasOwnProperty('toString')) { base.toString = props.toString; }\n } else if (mixin.mixins) {\n mergeMixins(mixin.mixins, m, descs, values, base, keys);\n if (mixin._without) { a_forEach.call(mixin._without, removeKeys); }\n }\n }\n }\n\n var IS_BINDING = /^.+Binding$/;\n\n function detectBinding(obj, key, value, m) {\n if (IS_BINDING.test(key)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[key] = value;\n }\n }\n\n function connectBindings(obj, m) {\n // TODO Mixin.apply(instance) should disconnect binding if exists\n var bindings = m.bindings, key, binding, to;\n if (bindings) {\n for (key in bindings) {\n binding = bindings[key];\n if (binding) {\n to = key.slice(0, -7); // strip Binding off end\n if (binding instanceof Binding) {\n binding = binding.copy(); // copy prototypes' instance\n binding.to(to);\n } else { // binding is string path\n binding = new Binding(to, binding);\n }\n binding.connect(obj);\n obj[key] = binding;\n }\n }\n // mark as applied\n m.bindings = {};\n }\n }\n\n function finishPartial(obj, m) {\n connectBindings(obj, m || metaFor(obj));\n return obj;\n }\n\n function followAlias(obj, desc, m, descs, values) {\n var altKey = desc.methodName, value;\n if (descs[altKey] || values[altKey]) {\n value = values[altKey];\n desc = descs[altKey];\n } else if (m.descs[altKey]) {\n desc = m.descs[altKey];\n value = undefined;\n } else {\n desc = undefined;\n value = obj[altKey];\n }\n\n return { desc: desc, value: value };\n }\n\n function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) {\n var paths = observerOrListener[pathsKey];\n\n if (paths) {\n for (var i=0, l=paths.length; i<l; i++) {\n updateMethod(obj, paths[i], null, key);\n }\n }\n }\n\n function replaceObserversAndListeners(obj, key, observerOrListener) {\n var prev = obj[key];\n\n if ('function' === typeof prev) {\n updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', removeBeforeObserver);\n updateObserversAndListeners(obj, key, prev, '__ember_observes__', removeObserver);\n updateObserversAndListeners(obj, key, prev, '__ember_listens__', removeListener);\n }\n\n if ('function' === typeof observerOrListener) {\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', addBeforeObserver);\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', addObserver);\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', addListener);\n }\n }\n\n function applyMixin(obj, mixins, partial) {\n var descs = {}, values = {}, m = metaFor(obj),\n key, value, desc, keys = [];\n\n obj._super = superFunction;\n\n // Go through all mixins and hashes passed in, and:\n //\n // * Handle concatenated properties\n // * Handle merged properties\n // * Set up _super wrapping if necessary\n // * Set up computed property descriptors\n // * Copying `toString` in broken browsers\n mergeMixins(mixins, mixinsMeta(obj), descs, values, obj, keys);\n\n for(var i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n if (key === 'constructor' || !values.hasOwnProperty(key)) { continue; }\n\n desc = descs[key];\n value = values[key];\n\n if (desc === REQUIRED) { continue; }\n\n while (desc && desc instanceof Alias) {\n var followed = followAlias(obj, desc, m, descs, values);\n desc = followed.desc;\n value = followed.value;\n }\n\n if (desc === undefined && value === undefined) { continue; }\n\n replaceObserversAndListeners(obj, key, value);\n detectBinding(obj, key, value, m);\n defineProperty(obj, key, desc, value, m);\n }\n\n if (!partial) { // don't apply to prototype\n finishPartial(obj, m);\n }\n\n return obj;\n }\n\n /**\n @method mixin\n @for Ember\n @param obj\n @param mixins*\n @return obj\n */\n function mixin(obj) {\n var args = a_slice.call(arguments, 1);\n applyMixin(obj, args, false);\n return obj;\n };\n\n /**\n The `Ember.Mixin` class allows you to create mixins, whose properties can be\n added to other classes. For instance,\n\n ```javascript\n App.Editable = Ember.Mixin.create({\n edit: function() {\n console.log('starting to edit');\n this.set('isEditing', true);\n },\n isEditing: false\n });\n\n // Mix mixins into classes by passing them as the first arguments to\n // .extend.\n App.CommentView = Ember.View.extend(App.Editable, {\n template: Ember.Handlebars.compile('{{#if view.isEditing}}...{{else}}...{{/if}}')\n });\n\n commentView = App.CommentView.create();\n commentView.edit(); // outputs 'starting to edit'\n ```\n\n Note that Mixins are created with `Ember.Mixin.create`, not\n `Ember.Mixin.extend`.\n\n Note that mixins extend a constructor's prototype so arrays and object literals\n defined as properties will be shared amongst objects that implement the mixin.\n If you want to define a property in a mixin that is not shared, you can define\n it either as a computed property or have it be created on initialization of the object.\n\n ```javascript\n //filters array will be shared amongst any object implementing mixin\n App.Filterable = Ember.Mixin.create({\n filters: Ember.A()\n });\n\n //filters will be a separate array for every object implementing the mixin\n App.Filterable = Ember.Mixin.create({\n filters: Ember.computed(function(){return Ember.A();})\n });\n\n //filters will be created as a separate array during the object's initialization\n App.Filterable = Ember.Mixin.create({\n init: function() {\n this._super();\n this.set(\"filters\", Ember.A());\n }\n });\n ```\n\n @class Mixin\n @namespace Ember\n */\n function Mixin() { return initMixin(this, arguments); };\n\n Mixin.prototype = {\n properties: null,\n mixins: null,\n ownerConstructor: null\n };\n\n Mixin._apply = applyMixin;\n\n Mixin.applyPartial = function(obj) {\n var args = a_slice.call(arguments, 1);\n return applyMixin(obj, args, true);\n };\n\n Mixin.finishPartial = finishPartial;\n\n // ES6TODO: this relies on a global state?\n Ember.anyUnprocessedMixins = false;\n\n /**\n @method create\n @static\n @param arguments*\n */\n Mixin.create = function() {\n // ES6TODO: this relies on a global state?\n Ember.anyUnprocessedMixins = true;\n var M = this;\n return initMixin(new M(), arguments);\n };\n\n var MixinPrototype = Mixin.prototype;\n\n /**\n @method reopen\n @param arguments*\n */\n MixinPrototype.reopen = function() {\n var mixin, tmp;\n\n if (this.properties) {\n mixin = Mixin.create();\n mixin.properties = this.properties;\n delete this.properties;\n this.mixins = [mixin];\n } else if (!this.mixins) {\n this.mixins = [];\n }\n\n var len = arguments.length, mixins = this.mixins, idx;\n\n for(idx=0; idx < len; idx++) {\n mixin = arguments[idx];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin),\n typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n if (mixin instanceof Mixin) {\n mixins.push(mixin);\n } else {\n tmp = Mixin.create();\n tmp.properties = mixin;\n mixins.push(tmp);\n }\n }\n\n return this;\n };\n\n /**\n @method apply\n @param obj\n @return applied object\n */\n MixinPrototype.apply = function(obj) {\n return applyMixin(obj, [this], false);\n };\n\n MixinPrototype.applyPartial = function(obj) {\n return applyMixin(obj, [this], true);\n };\n\n function _detect(curMixin, targetMixin, seen) {\n var guid = guidFor(curMixin);\n\n if (seen[guid]) { return false; }\n seen[guid] = true;\n\n if (curMixin === targetMixin) { return true; }\n var mixins = curMixin.mixins, loc = mixins ? mixins.length : 0;\n while (--loc >= 0) {\n if (_detect(mixins[loc], targetMixin, seen)) { return true; }\n }\n return false;\n }\n\n /**\n @method detect\n @param obj\n @return {Boolean}\n */\n MixinPrototype.detect = function(obj) {\n if (!obj) { return false; }\n if (obj instanceof Mixin) { return _detect(obj, this, {}); }\n var m = obj[META_KEY],\n mixins = m && m.mixins;\n if (mixins) {\n return !!mixins[guidFor(this)];\n }\n return false;\n };\n\n MixinPrototype.without = function() {\n var ret = new Mixin(this);\n ret._without = a_slice.call(arguments);\n return ret;\n };\n\n function _keys(ret, mixin, seen) {\n if (seen[guidFor(mixin)]) { return; }\n seen[guidFor(mixin)] = true;\n\n if (mixin.properties) {\n var props = mixin.properties;\n for (var key in props) {\n if (props.hasOwnProperty(key)) { ret[key] = true; }\n }\n } else if (mixin.mixins) {\n a_forEach.call(mixin.mixins, function(x) { _keys(ret, x, seen); });\n }\n }\n\n MixinPrototype.keys = function() {\n var keys = {}, seen = {}, ret = [];\n _keys(keys, this, seen);\n for(var key in keys) {\n if (keys.hasOwnProperty(key)) { ret.push(key); }\n }\n return ret;\n };\n\n // returns the mixins currently applied to the specified object\n // TODO: Make Ember.mixin\n Mixin.mixins = function(obj) {\n var m = obj[META_KEY],\n mixins = m && m.mixins, ret = [];\n\n if (!mixins) { return ret; }\n\n for (var key in mixins) {\n var mixin = mixins[key];\n\n // skip primitive mixins since these are always anonymous\n if (!mixin.properties) { ret.push(mixin); }\n }\n\n return ret;\n };\n\n REQUIRED = new Descriptor();\n REQUIRED.toString = function() { return '(Required Property)'; };\n\n /**\n Denotes a required property for a mixin\n\n @method required\n @for Ember\n */\n function required() {\n return REQUIRED;\n };\n\n Alias = function(methodName) {\n this.methodName = methodName;\n };\n Alias.prototype = new Descriptor();\n\n /**\n Makes a method available via an additional name.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name: function() {\n return 'Tomhuda Katzdale';\n },\n moniker: Ember.aliasMethod('name')\n });\n\n var goodGuy = App.Person.create();\n \n goodGuy.name(); // 'Tomhuda Katzdale'\n goodGuy.moniker(); // 'Tomhuda Katzdale'\n ```\n\n @method aliasMethod\n @for Ember\n @param {String} methodName name of the method to alias\n @return {Ember.Descriptor}\n */\n function aliasMethod(methodName) {\n return new Alias(methodName);\n };\n\n // ..........................................................\n // OBSERVER HELPER\n //\n\n /**\n Specify a method that observes property changes.\n\n ```javascript\n Ember.Object.extend({\n valueObserver: Ember.observer('value', function() {\n // Executes whenever the \"value\" property changes\n })\n });\n ```\n\n In the future this method may become asynchronous. If you want to ensure\n synchronous behavior, use `immediateObserver`.\n\n Also available as `Function.prototype.observes` if prototype extensions are\n enabled.\n\n @method observer\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n */\n function observer() {\n var func = a_slice.call(arguments, -1)[0];\n var paths;\n\n var addWatchedProperty = function (path) { paths.push(path); };\n var _paths = a_slice.call(arguments, 0, -1);\n\n if (typeof func !== \"function\") {\n // revert to old, soft-deprecated argument ordering\n\n func = arguments[0];\n _paths = a_slice.call(arguments, 1);\n }\n\n paths = [];\n\n for (var i=0; i<_paths.length; ++i) {\n expandProperties(_paths[i], addWatchedProperty);\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Ember.observer called without a function\");\n }\n\n func.__ember_observes__ = paths;\n return func;\n };\n\n /**\n Specify a method that observes property changes.\n\n ```javascript\n Ember.Object.extend({\n valueObserver: Ember.immediateObserver('value', function() {\n // Executes whenever the \"value\" property changes\n })\n });\n ```\n\n In the future, `Ember.observer` may become asynchronous. In this event,\n `Ember.immediateObserver` will maintain the synchronous behavior.\n\n Also available as `Function.prototype.observesImmediately` if prototype extensions are\n enabled.\n\n @method immediateObserver\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n */\n function immediateObserver() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", typeof arg !== \"string\" || arg.indexOf('.') === -1);\n }\n\n return observer.apply(this, arguments);\n };\n\n /**\n When observers fire, they are called with the arguments `obj`, `keyName`.\n\n Note, `@each.property` observer is called per each add or replace of an element\n and it's not called with a specific enumeration item.\n\n A `beforeObserver` fires before a property changes.\n\n A `beforeObserver` is an alternative form of `.observesBefore()`.\n\n ```javascript\n App.PersonView = Ember.View.extend({\n friends: [{ name: 'Tom' }, { name: 'Stefan' }, { name: 'Kris' }],\n\n valueWillChange: Ember.beforeObserver('content.value', function(obj, keyName) {\n this.changingFrom = obj.get(keyName);\n }),\n\n valueDidChange: Ember.observer('content.value', function(obj, keyName) {\n // only run if updating a value already in the DOM\n if (this.get('state') === 'inDOM') {\n var color = obj.get(keyName) > this.changingFrom ? 'green' : 'red';\n // logic\n }\n }),\n\n friendsDidChange: Ember.observer('friends.@each.name', function(obj, keyName) {\n // some logic\n // obj.get(keyName) returns friends array\n })\n });\n ```\n\n Also available as `Function.prototype.observesBefore` if prototype extensions are\n enabled.\n\n @method beforeObserver\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n */\n function beforeObserver() {\n var func = a_slice.call(arguments, -1)[0];\n var paths;\n\n var addWatchedProperty = function(path) { paths.push(path); };\n\n var _paths = a_slice.call(arguments, 0, -1);\n\n if (typeof func !== \"function\") {\n // revert to old, soft-deprecated argument ordering\n\n func = arguments[0];\n _paths = a_slice.call(arguments, 1);\n }\n\n paths = [];\n\n for (var i=0; i<_paths.length; ++i) {\n expandProperties(_paths[i], addWatchedProperty);\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Ember.beforeObserver called without a function\");\n }\n\n func.__ember_observesBefore__ = paths;\n return func;\n };\n\n __exports__.IS_BINDING = IS_BINDING;\n __exports__.mixin = mixin;\n __exports__.Mixin = Mixin;\n __exports__.required = required;\n __exports__.aliasMethod = aliasMethod;\n __exports__.observer = observer;\n __exports__.immediateObserver = immediateObserver;\n __exports__.beforeObserver = beforeObserver;\n });\ndefine(\"ember-metal/observer\",\n [\"ember-metal/watching\",\"ember-metal/array\",\"ember-metal/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var watch = __dependency1__.watch;\n var unwatch = __dependency1__.unwatch;\n var map = __dependency2__.map;\n var listenersFor = __dependency3__.listenersFor;\n var addListener = __dependency3__.addListener;\n var removeListener = __dependency3__.removeListener;\n var suspendListeners = __dependency3__.suspendListeners;\n var suspendListener = __dependency3__.suspendListener;\n /**\n @module ember-metal\n */\n\n var AFTER_OBSERVERS = ':change',\n BEFORE_OBSERVERS = ':before';\n\n function changeEvent(keyName) {\n return keyName+AFTER_OBSERVERS;\n }\n\n function beforeEvent(keyName) {\n return keyName+BEFORE_OBSERVERS;\n }\n\n /**\n @method addObserver\n @for Ember\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n */\n function addObserver(obj, _path, target, method) {\n addListener(obj, changeEvent(_path), target, method);\n watch(obj, _path);\n\n return this;\n };\n\n function observersFor(obj, path) {\n return listenersFor(obj, changeEvent(path));\n };\n\n /**\n @method removeObserver\n @for Ember\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n */\n function removeObserver(obj, _path, target, method) {\n unwatch(obj, _path);\n removeListener(obj, changeEvent(_path), target, method);\n\n return this;\n };\n\n /**\n @method addBeforeObserver\n @for Ember\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n */\n function addBeforeObserver(obj, _path, target, method) {\n addListener(obj, beforeEvent(_path), target, method);\n watch(obj, _path);\n\n return this;\n };\n\n // Suspend observer during callback.\n //\n // This should only be used by the target of the observer\n // while it is setting the observed path.\n function _suspendBeforeObserver(obj, path, target, method, callback) {\n return suspendListener(obj, beforeEvent(path), target, method, callback);\n };\n\n function _suspendObserver(obj, path, target, method, callback) {\n return suspendListener(obj, changeEvent(path), target, method, callback);\n };\n\n function _suspendBeforeObservers(obj, paths, target, method, callback) {\n var events = map.call(paths, beforeEvent);\n return suspendListeners(obj, events, target, method, callback);\n };\n\n function _suspendObservers(obj, paths, target, method, callback) {\n var events = map.call(paths, changeEvent);\n return suspendListeners(obj, events, target, method, callback);\n };\n\n function beforeObserversFor(obj, path) {\n return listenersFor(obj, beforeEvent(path));\n };\n\n /**\n @method removeBeforeObserver\n @for Ember\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n */\n function removeBeforeObserver(obj, _path, target, method) {\n unwatch(obj, _path);\n removeListener(obj, beforeEvent(_path), target, method);\n\n return this;\n };\n\n __exports__.addObserver = addObserver;\n __exports__.observersFor = observersFor;\n __exports__.removeObserver = removeObserver;\n __exports__.addBeforeObserver = addBeforeObserver;\n __exports__._suspendBeforeObserver = _suspendBeforeObserver;\n __exports__._suspendObserver = _suspendObserver;\n __exports__._suspendBeforeObservers = _suspendBeforeObservers;\n __exports__._suspendObservers = _suspendObservers;\n __exports__.beforeObserversFor = beforeObserversFor;\n __exports__.removeBeforeObserver = removeBeforeObserver;\n });\ndefine(\"ember-metal/observer_set\",\n [\"ember-metal/utils\",\"ember-metal/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var guidFor = __dependency1__.guidFor;\n var sendEvent = __dependency2__.sendEvent;\n\n /*\n this.observerSet = {\n [senderGuid]: { // variable name: `keySet`\n [keyName]: listIndex\n }\n },\n this.observers = [\n {\n sender: obj,\n keyName: keyName,\n eventName: eventName,\n listeners: [\n [target, method, flags]\n ]\n },\n ...\n ]\n */\n function ObserverSet() {\n this.clear();\n };\n\n ObserverSet.prototype.add = function(sender, keyName, eventName) {\n var observerSet = this.observerSet,\n observers = this.observers,\n senderGuid = guidFor(sender),\n keySet = observerSet[senderGuid],\n index;\n\n if (!keySet) {\n observerSet[senderGuid] = keySet = {};\n }\n index = keySet[keyName];\n if (index === undefined) {\n index = observers.push({\n sender: sender,\n keyName: keyName,\n eventName: eventName,\n listeners: []\n }) - 1;\n keySet[keyName] = index;\n }\n return observers[index].listeners;\n };\n\n ObserverSet.prototype.flush = function() {\n var observers = this.observers, i, len, observer, sender;\n this.clear();\n for (i=0, len=observers.length; i < len; ++i) {\n observer = observers[i];\n sender = observer.sender;\n if (sender.isDestroying || sender.isDestroyed) { continue; }\n sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners);\n }\n };\n\n ObserverSet.prototype.clear = function() {\n this.observerSet = {};\n this.observers = [];\n };\n\n __exports__[\"default\"] = ObserverSet;\n });\ndefine(\"ember-metal/platform\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n /*globals Node */\n\n var Ember = __dependency1__[\"default\"];\n\n /**\n @module ember-metal\n */\n\n /**\n Platform specific methods and feature detectors needed by the framework.\n\n @class platform\n @namespace Ember\n @static\n */\n // TODO remove this\n var platform = {};\n\n /**\n Identical to `Object.create()`. Implements if not available natively.\n\n @method create\n @for Ember\n */\n var create = Object.create;\n\n // IE8 has Object.create but it couldn't treat property descriptors.\n if (create) {\n if (create({a: 1}, {a: {value: 2}}).a !== 2) {\n create = null;\n }\n }\n\n // STUB_OBJECT_CREATE allows us to override other libraries that stub\n // Object.create different than we would prefer\n if (!create || Ember.ENV.STUB_OBJECT_CREATE) {\n var K = function() {};\n\n create = function(obj, props) {\n K.prototype = obj;\n obj = new K();\n if (props) {\n K.prototype = obj;\n for (var prop in props) {\n K.prototype[prop] = props[prop].value;\n }\n obj = new K();\n }\n K.prototype = null;\n\n return obj;\n };\n\n create.isSimulated = true;\n }\n\n var defineProperty = Object.defineProperty;\n var canRedefineProperties, canDefinePropertyOnDOM;\n\n // Catch IE8 where Object.defineProperty exists but only works on DOM elements\n if (defineProperty) {\n try {\n defineProperty({}, 'a',{get:function() {}});\n } catch (e) {\n defineProperty = null;\n }\n }\n\n if (defineProperty) {\n // Detects a bug in Android <3.2 where you cannot redefine a property using\n // Object.defineProperty once accessors have already been set.\n canRedefineProperties = (function() {\n var obj = {};\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n get: function() { },\n set: function() { }\n });\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: true\n });\n\n return obj.a === true;\n })();\n\n // This is for Safari 5.0, which supports Object.defineProperty, but not\n // on DOM nodes.\n canDefinePropertyOnDOM = (function() {\n try {\n defineProperty(document.createElement('div'), 'definePropertyOnDOM', {});\n return true;\n } catch(e) { }\n\n return false;\n })();\n\n if (!canRedefineProperties) {\n defineProperty = null;\n } else if (!canDefinePropertyOnDOM) {\n defineProperty = function(obj, keyName, desc) {\n var isNode;\n\n if (typeof Node === \"object\") {\n isNode = obj instanceof Node;\n } else {\n isNode = typeof obj === \"object\" && typeof obj.nodeType === \"number\" && typeof obj.nodeName === \"string\";\n }\n\n if (isNode) {\n // TODO: Should we have a warning here?\n return (obj[keyName] = desc.value);\n } else {\n return Object.defineProperty(obj, keyName, desc);\n }\n };\n }\n }\n\n /**\n @class platform\n @namespace Ember\n */\n\n /**\n Identical to `Object.defineProperty()`. Implements as much functionality\n as possible if not available natively.\n\n @method defineProperty\n @param {Object} obj The object to modify\n @param {String} keyName property name to modify\n @param {Object} desc descriptor hash\n @return {void}\n */\n platform.defineProperty = defineProperty;\n\n /**\n Set to true if the platform supports native getters and setters.\n\n @property hasPropertyAccessors\n @final\n */\n platform.hasPropertyAccessors = true;\n\n if (!platform.defineProperty) {\n platform.hasPropertyAccessors = false;\n\n platform.defineProperty = function(obj, keyName, desc) {\n if (!desc.get) { obj[keyName] = desc.value; }\n };\n\n platform.defineProperty.isSimulated = true;\n }\n\n if (Ember.ENV.MANDATORY_SETTER && !platform.hasPropertyAccessors) {\n Ember.ENV.MANDATORY_SETTER = false;\n }\n\n __exports__.create = create;\n __exports__.platform = platform;\n });\ndefine(\"ember-metal/properties\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/platform\",\"ember-metal/property_events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n\n var Ember = __dependency1__[\"default\"];\n var META_KEY = __dependency2__.META_KEY;\n var meta = __dependency2__.meta;\n var platform = __dependency3__.platform;\n var overrideChains = __dependency4__.overrideChains;\n var metaFor = meta,\n objectDefineProperty = platform.defineProperty;\n\n var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n // ..........................................................\n // DESCRIPTOR\n //\n\n /**\n Objects of this type can implement an interface to respond to requests to\n get and set. The default implementation handles simple properties.\n\n You generally won't need to create or subclass this directly.\n\n @class Descriptor\n @namespace Ember\n @private\n @constructor\n */\n function Descriptor() {};\n\n // ..........................................................\n // DEFINING PROPERTIES API\n //\n\n var MANDATORY_SETTER_FUNCTION = Ember.MANDATORY_SETTER_FUNCTION = function(value) {\n Ember.assert(\"You must use Ember.set() to access this property (of \" + this + \")\", false);\n };\n\n var DEFAULT_GETTER_FUNCTION = Ember.DEFAULT_GETTER_FUNCTION = function(name) {\n return function() {\n var meta = this[META_KEY];\n return meta && meta.values[name];\n };\n };\n\n /**\n NOTE: This is a low-level method used by other parts of the API. You almost\n never want to call this method directly. Instead you should use\n `Ember.mixin()` to define new properties.\n\n Defines a property on an object. This method works much like the ES5\n `Object.defineProperty()` method except that it can also accept computed\n properties and other special descriptors.\n\n Normally this method takes only three parameters. However if you pass an\n instance of `Ember.Descriptor` as the third param then you can pass an\n optional value as the fourth parameter. This is often more efficient than\n creating new descriptor hashes for each property.\n\n ## Examples\n\n ```javascript\n // ES5 compatible mode\n Ember.defineProperty(contact, 'firstName', {\n writable: true,\n configurable: false,\n enumerable: true,\n value: 'Charles'\n });\n\n // define a simple property\n Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');\n\n // define a computed property\n Ember.defineProperty(contact, 'fullName', Ember.computed(function() {\n return this.firstName+' '+this.lastName;\n }).property('firstName', 'lastName'));\n ```\n\n @private\n @method defineProperty\n @for Ember\n @param {Object} obj the object to define this property on. This may be a prototype.\n @param {String} keyName the name of the property\n @param {Ember.Descriptor} [desc] an instance of `Ember.Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.\n @param {*} [data] something other than a descriptor, that will\n become the explicit value of this property.\n */\n function defineProperty(obj, keyName, desc, data, meta) {\n var descs, existingDesc, watching, value;\n\n if (!meta) meta = metaFor(obj);\n descs = meta.descs;\n existingDesc = meta.descs[keyName];\n watching = meta.watching[keyName] > 0;\n\n if (existingDesc instanceof Descriptor) {\n existingDesc.teardown(obj, keyName);\n }\n\n if (desc instanceof Descriptor) {\n value = desc;\n\n descs[keyName] = desc;\n if (MANDATORY_SETTER && watching) {\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: undefined // make enumerable\n });\n } else {\n obj[keyName] = undefined; // make enumerable\n }\n } else {\n descs[keyName] = undefined; // shadow descriptor in proto\n if (desc == null) {\n value = data;\n\n if (MANDATORY_SETTER && watching) {\n meta.values[keyName] = data;\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: MANDATORY_SETTER_FUNCTION,\n get: DEFAULT_GETTER_FUNCTION(keyName)\n });\n } else {\n obj[keyName] = data;\n }\n } else {\n value = desc;\n\n // compatibility with ES5\n objectDefineProperty(obj, keyName, desc);\n }\n }\n\n // if key is being watched, override chains that\n // were initialized with the prototype\n if (watching) { overrideChains(obj, keyName, meta); }\n\n // The `value` passed to the `didDefineProperty` hook is\n // either the descriptor or data, whichever was passed.\n if (obj.didDefineProperty) { obj.didDefineProperty(obj, keyName, value); }\n\n return this;\n };\n\n __exports__.Descriptor = Descriptor;\n __exports__.defineProperty = defineProperty;\n });\ndefine(\"ember-metal/property_events\",\n [\"ember-metal/utils\",\"ember-metal/events\",\"ember-metal/observer_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var META_KEY = __dependency1__.META_KEY;\n var guidFor = __dependency1__.guidFor;\n var tryFinally = __dependency1__.tryFinally;\n var sendEvent = __dependency2__.sendEvent;\n var listenersUnion = __dependency2__.listenersUnion;\n var listenersDiff = __dependency2__.listenersDiff;\n var ObserverSet = __dependency3__[\"default\"];\n\n var beforeObserverSet = new ObserverSet(),\n observerSet = new ObserverSet(),\n deferred = 0;\n\n // ..........................................................\n // PROPERTY CHANGES\n //\n\n /**\n This function is called just before an object property is about to change.\n It will notify any before observers and prepare caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyDidChange()` which you should call just\n after the property value changes.\n\n @method propertyWillChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n */\n function propertyWillChange(obj, keyName) {\n var m = obj[META_KEY],\n watching = (m && m.watching[keyName] > 0) || keyName === 'length',\n proto = m && m.proto,\n desc = m && m.descs[keyName];\n\n if (!watching) { return; }\n if (proto === obj) { return; }\n if (desc && desc.willChange) { desc.willChange(obj, keyName); }\n dependentKeysWillChange(obj, keyName, m);\n chainsWillChange(obj, keyName, m);\n notifyBeforeObservers(obj, keyName);\n }\n\n /**\n This function is called just after an object property has changed.\n It will notify any observers and clear caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyWillChange()` which you should call just\n before the property value changes.\n\n @method propertyDidChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n */\n function propertyDidChange(obj, keyName) {\n var m = obj[META_KEY],\n watching = (m && m.watching[keyName] > 0) || keyName === 'length',\n proto = m && m.proto,\n desc = m && m.descs[keyName];\n\n if (proto === obj) { return; }\n\n // shouldn't this mean that we're watching this key?\n if (desc && desc.didChange) { desc.didChange(obj, keyName); }\n if (!watching && keyName !== 'length') { return; }\n\n dependentKeysDidChange(obj, keyName, m);\n chainsDidChange(obj, keyName, m, false);\n notifyObservers(obj, keyName);\n }\n\n var WILL_SEEN, DID_SEEN;\n\n // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...)\n function dependentKeysWillChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = WILL_SEEN, top = !seen;\n if (top) { seen = WILL_SEEN = {}; }\n iterDeps(propertyWillChange, obj, depKey, seen, meta);\n if (top) { WILL_SEEN = null; }\n }\n\n // called whenever a property has just changed to update dependent keys\n function dependentKeysDidChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = DID_SEEN, top = !seen;\n if (top) { seen = DID_SEEN = {}; }\n iterDeps(propertyDidChange, obj, depKey, seen, meta);\n if (top) { DID_SEEN = null; }\n }\n\n function iterDeps(method, obj, depKey, seen, meta) {\n var guid = guidFor(obj);\n if (!seen[guid]) seen[guid] = {};\n if (seen[guid][depKey]) return;\n seen[guid][depKey] = true;\n\n var deps = meta.deps;\n deps = deps && deps[depKey];\n if (deps) {\n for(var key in deps) {\n var desc = meta.descs[key];\n if (desc && desc._suspended === obj) continue;\n method(obj, key);\n }\n }\n }\n\n function chainsWillChange(obj, keyName, m) {\n if (!(m.hasOwnProperty('chainWatchers') &&\n m.chainWatchers[keyName])) {\n return;\n }\n\n var nodes = m.chainWatchers[keyName],\n events = [],\n i, l;\n\n for(i = 0, l = nodes.length; i < l; i++) {\n nodes[i].willChange(events);\n }\n\n for (i = 0, l = events.length; i < l; i += 2) {\n propertyWillChange(events[i], events[i+1]);\n }\n }\n\n function chainsDidChange(obj, keyName, m, suppressEvents) {\n if (!(m && m.hasOwnProperty('chainWatchers') &&\n m.chainWatchers[keyName])) {\n return;\n }\n\n var nodes = m.chainWatchers[keyName],\n events = suppressEvents ? null : [],\n i, l;\n\n for(i = 0, l = nodes.length; i < l; i++) {\n nodes[i].didChange(events);\n }\n\n if (suppressEvents) {\n return;\n }\n\n for (i = 0, l = events.length; i < l; i += 2) {\n propertyDidChange(events[i], events[i+1]);\n }\n }\n\n function overrideChains(obj, keyName, m) {\n chainsDidChange(obj, keyName, m, true);\n };\n\n /**\n @method beginPropertyChanges\n @chainable\n @private\n */\n function beginPropertyChanges() {\n deferred++;\n }\n\n /**\n @method endPropertyChanges\n @private\n */\n function endPropertyChanges() {\n deferred--;\n if (deferred<=0) {\n beforeObserverSet.clear();\n observerSet.flush();\n }\n }\n\n /**\n Make a series of property changes together in an\n exception-safe way.\n\n ```javascript\n Ember.changeProperties(function() {\n obj1.set('foo', mayBlowUpWhenSet);\n obj2.set('bar', baz);\n });\n ```\n\n @method changeProperties\n @param {Function} callback\n @param [binding]\n */\n function changeProperties(cb, binding) {\n beginPropertyChanges();\n tryFinally(cb, endPropertyChanges, binding);\n };\n\n function notifyBeforeObservers(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = keyName + ':before', listeners, diff;\n if (deferred) {\n listeners = beforeObserverSet.add(obj, keyName, eventName);\n diff = listenersDiff(obj, eventName, listeners);\n sendEvent(obj, eventName, [obj, keyName], diff);\n } else {\n sendEvent(obj, eventName, [obj, keyName]);\n }\n }\n\n function notifyObservers(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = keyName + ':change', listeners;\n if (deferred) {\n listeners = observerSet.add(obj, keyName, eventName);\n listenersUnion(obj, eventName, listeners);\n } else {\n sendEvent(obj, eventName, [obj, keyName]);\n }\n }\n\n __exports__.propertyWillChange = propertyWillChange;\n __exports__.propertyDidChange = propertyDidChange;\n __exports__.overrideChains = overrideChains;\n __exports__.beginPropertyChanges = beginPropertyChanges;\n __exports__.endPropertyChanges = endPropertyChanges;\n __exports__.changeProperties = changeProperties;\n });\ndefine(\"ember-metal/property_get\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n\n var Ember = __dependency1__[\"default\"];\n var META_KEY = __dependency2__.META_KEY;\n var EmberError = __dependency3__[\"default\"];\n\n var get;\n\n var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n var IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\\.]/;\n var HAS_THIS = 'this.';\n var FIRST_KEY = /^([^\\.]+)/;\n\n // ..........................................................\n // GET AND SET\n //\n // If we are on a platform that supports accessors we can use those.\n // Otherwise simulate accessors by looking up the property directly on the\n // object.\n\n /**\n Gets the value of a property on an object. If the property is computed,\n the function will be invoked. If the property is not defined but the\n object implements the `unknownProperty` method then that will be invoked.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to retrieve a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to retrieve\n properties if the property might not be defined on the object and you want\n to respect the `unknownProperty` handler. Otherwise you can ignore this\n method.\n\n Note that if the object itself is `undefined`, this method will throw\n an error.\n\n @method get\n @for Ember\n @param {Object} obj The object to retrieve from.\n @param {String} keyName The property key to retrieve\n @return {Object} the property value or `null`.\n */\n get = function get(obj, keyName) {\n // Helpers that operate with 'this' within an #each\n if (keyName === '') {\n return obj;\n }\n\n if (!keyName && 'string'===typeof obj) {\n keyName = obj;\n obj = null;\n }\n\n Ember.assert(\"Cannot call get with \"+ keyName +\" key.\", !!keyName);\n Ember.assert(\"Cannot call get with '\"+ keyName +\"' on an undefined object.\", obj !== undefined);\n\n if (obj === null) { return _getPath(obj, keyName); }\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;\n\n if (desc === undefined && keyName.indexOf('.') !== -1) {\n return _getPath(obj, keyName);\n }\n\n if (desc) {\n return desc.get(obj, keyName);\n } else {\n if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {\n ret = meta.values[keyName];\n } else {\n ret = obj[keyName];\n }\n\n if (ret === undefined &&\n 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {\n return obj.unknownProperty(keyName);\n }\n\n return ret;\n }\n };\n\n // Currently used only by Ember Data tests\n if (Ember.config.overrideAccessors) {\n Ember.get = get;\n Ember.config.overrideAccessors();\n get = Ember.get;\n }\n\n /**\n Normalizes a target/path pair to reflect that actual target/path that should\n be observed, etc. This takes into account passing in global property\n paths (i.e. a path beginning with a captial letter not defined on the\n target).\n\n @private\n @method normalizeTuple\n @for Ember\n @param {Object} target The current target. May be `null`.\n @param {String} path A path on the target or a global property path.\n @return {Array} a temporary array with the normalized target/path pair.\n */\n function normalizeTuple(target, path) {\n var hasThis = path.indexOf(HAS_THIS) === 0,\n isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),\n key;\n\n if (!target || isGlobal) target = Ember.lookup;\n if (hasThis) path = path.slice(5);\n\n if (target === Ember.lookup) {\n key = path.match(FIRST_KEY)[0];\n target = get(target, key);\n path = path.slice(key.length+1);\n }\n\n // must return some kind of path to be valid else other things will break.\n if (!path || path.length===0) throw new EmberError('Path cannot be empty');\n\n return [ target, path ];\n };\n\n function _getPath(root, path) {\n var hasThis, parts, tuple, idx, len;\n\n // If there is no root and path is a key name, return that\n // property from the global object.\n // E.g. get('Ember') -> Ember\n if (root === null && path.indexOf('.') === -1) { return get(Ember.lookup, path); }\n\n // detect complicated paths and normalize them\n hasThis = path.indexOf(HAS_THIS) === 0;\n\n if (!root || hasThis) {\n tuple = normalizeTuple(root, path);\n root = tuple[0];\n path = tuple[1];\n tuple.length = 0;\n }\n\n parts = path.split(\".\");\n len = parts.length;\n for (idx = 0; root != null && idx < len; idx++) {\n root = get(root, parts[idx], true);\n if (root && root.isDestroyed) { return undefined; }\n }\n return root;\n };\n\n function getWithDefault(root, key, defaultValue) {\n var value = get(root, key);\n\n if (value === undefined) { return defaultValue; }\n return value;\n };\n\n __exports__[\"default\"] = get;\n __exports__.get = get;\n __exports__.getWithDefault = getWithDefault;\n __exports__.normalizeTuple = normalizeTuple;\n __exports__._getPath = _getPath;\n });\ndefine(\"ember-metal/property_set\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/utils\",\"ember-metal/property_events\",\"ember-metal/properties\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var getPath = __dependency2__._getPath;\n var META_KEY = __dependency3__.META_KEY;\n var propertyWillChange = __dependency4__.propertyWillChange;\n var propertyDidChange = __dependency4__.propertyDidChange;\n var defineProperty = __dependency5__.defineProperty;\n var EmberError = __dependency6__[\"default\"];\n\n var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;\n\n /**\n Sets the value of a property on an object, respecting computed properties\n and notifying observers and other listeners of the change. If the\n property is not defined but the object implements the `setUnknownProperty`\n method then that will be invoked as well.\n\n @method set\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} keyName The property key to set\n @param {Object} value The value to set\n @return {Object} the passed value.\n */\n var set = function set(obj, keyName, value, tolerant) {\n if (typeof obj === 'string') {\n Ember.assert(\"Path '\" + obj + \"' must be global if no obj is given.\", IS_GLOBAL.test(obj));\n value = keyName;\n keyName = obj;\n obj = null;\n }\n\n Ember.assert(\"Cannot call set with \"+ keyName +\" key.\", !!keyName);\n\n if (!obj) {\n return setPath(obj, keyName, value, tolerant);\n }\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName],\n isUnknown, currentValue;\n\n if (desc === undefined && keyName.indexOf('.') !== -1) {\n return setPath(obj, keyName, value, tolerant);\n }\n\n Ember.assert(\"You need to provide an object and key to `set`.\", !!obj && keyName !== undefined);\n Ember.assert('calling set on destroyed object', !obj.isDestroyed);\n\n if (desc !== undefined) {\n desc.set(obj, keyName, value);\n } else {\n\n if (typeof obj === 'object' && obj !== null && value !== undefined && obj[keyName] === value) {\n return value;\n }\n\n isUnknown = 'object' === typeof obj && !(keyName in obj);\n\n // setUnknownProperty is called if `obj` is an object,\n // the property does not already exist, and the\n // `setUnknownProperty` method exists on the object\n if (isUnknown && 'function' === typeof obj.setUnknownProperty) {\n obj.setUnknownProperty(keyName, value);\n } else if (meta && meta.watching[keyName] > 0) {\n if (MANDATORY_SETTER) {\n currentValue = meta.values[keyName];\n } else {\n currentValue = obj[keyName];\n }\n // only trigger a change if the value has changed\n if (value !== currentValue) {\n propertyWillChange(obj, keyName);\n if (MANDATORY_SETTER) {\n if ((currentValue === undefined && !(keyName in obj)) || !obj.propertyIsEnumerable(keyName)) {\n defineProperty(obj, keyName, null, value); // setup mandatory setter\n } else {\n meta.values[keyName] = value;\n }\n } else {\n obj[keyName] = value;\n }\n propertyDidChange(obj, keyName);\n }\n } else {\n obj[keyName] = value;\n }\n }\n return value;\n };\n\n // Currently used only by Ember Data tests\n // ES6TODO: Verify still true\n if (Ember.config.overrideAccessors) {\n Ember.set = set;\n Ember.config.overrideAccessors();\n set = Ember.set;\n }\n\n function setPath(root, path, value, tolerant) {\n var keyName;\n\n // get the last part of the path\n keyName = path.slice(path.lastIndexOf('.') + 1);\n\n // get the first part of the part\n path = (path === keyName) ? keyName : path.slice(0, path.length-(keyName.length+1));\n\n // unless the path is this, look up the first part to\n // get the root\n if (path !== 'this') {\n root = getPath(root, path);\n }\n\n if (!keyName || keyName.length === 0) {\n throw new EmberError('Property set failed: You passed an empty path');\n }\n\n if (!root) {\n if (tolerant) { return; }\n else { throw new EmberError('Property set failed: object in path \"'+path+'\" could not be found or was destroyed.'); }\n }\n\n return set(root, keyName, value);\n }\n\n /**\n Error-tolerant form of `Ember.set`. Will not blow up if any part of the\n chain is `undefined`, `null`, or destroyed.\n\n This is primarily used when syncing bindings, which may try to update after\n an object has been destroyed.\n\n @method trySet\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} path The property path to set\n @param {Object} value The value to set\n */\n function trySet(root, path, value) {\n return set(root, path, value, true);\n };\n\n __exports__.set = set;\n __exports__.trySet = trySet;\n });\ndefine(\"ember-metal/run_loop\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/array\",\"ember-metal/property_events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var apply = __dependency2__.apply;\n var indexOf = __dependency3__.indexOf;\n var beginPropertyChanges = __dependency4__.beginPropertyChanges;\n var endPropertyChanges = __dependency4__.endPropertyChanges;\n\n var onBegin = function(current) {\n run.currentRunLoop = current;\n };\n\n var onEnd = function(current, next) {\n run.currentRunLoop = next;\n };\n\n // ES6TODO: should Backburner become es6?\n var Backburner = requireModule('backburner').Backburner,\n backburner = new Backburner(['sync', 'actions', 'destroy'], {\n sync: {\n before: beginPropertyChanges,\n after: endPropertyChanges\n },\n defaultQueue: 'actions',\n onBegin: onBegin,\n onEnd: onEnd,\n onErrorTarget: Ember,\n onErrorMethod: 'onerror'\n }),\n slice = [].slice,\n concat = [].concat;\n\n // ..........................................................\n // run - this is ideally the only public API the dev sees\n //\n\n /**\n Runs the passed target and method inside of a RunLoop, ensuring any\n deferred actions including bindings and views updates are flushed at the\n end.\n\n Normally you should not need to invoke this method yourself. However if\n you are implementing raw event handlers when interfacing with other\n libraries or plugins, you should probably wrap all of your code inside this\n call.\n\n ```javascript\n run(function() {\n // code to be execute within a RunLoop\n });\n ```\n\n @class run\n @namespace Ember\n @static\n @constructor\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function.\n */\n var run = function() {\n return apply(backburner, backburner.run, arguments);\n };\n\n /**\n If no run-loop is present, it creates a new one. If a run loop is\n present it will queue itself to run on the existing run-loops action\n queue.\n\n Please note: This is not for normal usage, and should be used sparingly.\n\n If invoked when not within a run loop:\n\n ```javascript\n run.join(function() {\n // creates a new run-loop\n });\n ```\n\n Alternatively, if called within an existing run loop:\n\n ```javascript\n run(function() {\n // creates a new run-loop\n run.join(function() {\n // joins with the existing run-loop, and queues for invocation on\n // the existing run-loops action queue.\n });\n });\n ```\n\n @method join\n @namespace Ember\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} Return value from invoking the passed function. Please note,\n when called within an existing loop, no return value is possible.\n */\n run.join = function(target, method /* args */) {\n if (!run.currentRunLoop) {\n return apply(Ember, run, arguments);\n }\n\n var args = slice.call(arguments);\n args.unshift('actions');\n apply(run, run.schedule, args);\n };\n\n /**\n Provides a useful utility for when integrating with non-Ember libraries\n that provide asynchronous callbacks.\n\n Ember utilizes a run-loop to batch and coalesce changes. This works by\n marking the start and end of Ember-related Javascript execution.\n\n When using events such as a View's click handler, Ember wraps the event\n handler in a run-loop, but when integrating with non-Ember libraries this\n can be tedious.\n\n For example, the following is rather verbose but is the correct way to combine\n third-party events and Ember code.\n\n ```javascript\n var that = this;\n jQuery(window).on('resize', function(){\n run(function(){\n that.handleResize();\n });\n });\n ```\n\n To reduce the boilerplate, the following can be used to construct a\n run-loop-wrapped callback handler.\n\n ```javascript\n jQuery(window).on('resize', run.bind(this, this.handleResize));\n ```\n\n @method bind\n @namespace run\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function. Please note,\n when called within an existing loop, no return value is possible.\n @since 1.4.0\n */\n run.bind = function(target, method /* args*/) {\n var args = slice.call(arguments);\n return function() {\n return apply(run, run.join, args.concat(slice.call(arguments)));\n };\n };\n\n run.backburner = backburner;\n run.currentRunLoop = null;\n run.queues = backburner.queueNames;\n\n /**\n Begins a new RunLoop. Any deferred actions invoked after the begin will\n be buffered until you invoke a matching call to `run.end()`. This is\n a lower-level way to use a RunLoop instead of using `run()`.\n\n ```javascript\n run.begin();\n // code to be execute within a RunLoop\n run.end();\n ```\n\n @method begin\n @return {void}\n */\n run.begin = function() {\n backburner.begin();\n };\n\n /**\n Ends a RunLoop. This must be called sometime after you call\n `run.begin()` to flush any deferred actions. This is a lower-level way\n to use a RunLoop instead of using `run()`.\n\n ```javascript\n run.begin();\n // code to be execute within a RunLoop\n run.end();\n ```\n\n @method end\n @return {void}\n */\n run.end = function() {\n backburner.end();\n };\n\n /**\n Array of named queues. This array determines the order in which queues\n are flushed at the end of the RunLoop. You can define your own queues by\n simply adding the queue name to this array. Normally you should not need\n to inspect or modify this property.\n\n @property queues\n @type Array\n @default ['sync', 'actions', 'destroy']\n */\n\n /**\n Adds the passed target/method and any optional arguments to the named\n queue to be executed at the end of the RunLoop. If you have not already\n started a RunLoop when calling this method one will be started for you\n automatically.\n\n At the end of a RunLoop, any methods scheduled in this way will be invoked.\n Methods will be invoked in an order matching the named queues defined in\n the `run.queues` property.\n\n ```javascript\n run.schedule('sync', this, function() {\n // this will be executed in the first RunLoop queue, when bindings are synced\n console.log(\"scheduled on sync queue\");\n });\n\n run.schedule('actions', this, function() {\n // this will be executed in the 'actions' queue, after bindings have synced.\n console.log(\"scheduled on actions queue\");\n });\n\n // Note the functions will be run in order based on the run queues order.\n // Output would be:\n // scheduled on sync queue\n // scheduled on actions queue\n ```\n\n @method schedule\n @param {String} queue The name of the queue to schedule against.\n Default queues are 'sync' and 'actions'\n @param {Object} [target] target object to use as the context when invoking a method.\n @param {String|Function} method The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.\n @param {Object} [arguments*] Optional arguments to be passed to the queued method.\n @return {void}\n */\n run.schedule = function(queue, target, method) {\n checkAutoRun();\n apply(backburner, backburner.schedule, arguments);\n };\n\n // Used by global test teardown\n run.hasScheduledTimers = function() {\n return backburner.hasTimers();\n };\n\n // Used by global test teardown\n run.cancelTimers = function () {\n backburner.cancelTimers();\n };\n\n /**\n Immediately flushes any events scheduled in the 'sync' queue. Bindings\n use this queue so this method is a useful way to immediately force all\n bindings in the application to sync.\n\n You should call this method anytime you need any changed state to propagate\n throughout the app immediately without repainting the UI (which happens\n in the later 'render' queue added by the `ember-views` package).\n\n ```javascript\n run.sync();\n ```\n\n @method sync\n @return {void}\n */\n run.sync = function() {\n if (backburner.currentInstance) {\n backburner.currentInstance.queues.sync.flush();\n }\n };\n\n /**\n Invokes the passed target/method and optional arguments after a specified\n period if time. The last parameter of this method must always be a number\n of milliseconds.\n\n You should use this method whenever you need to run some action after a\n period of time instead of using `setTimeout()`. This method will ensure that\n items that expire during the same script execution cycle all execute\n together, which is often more efficient than using a real setTimeout.\n\n ```javascript\n run.later(myContext, function() {\n // code here will execute within a RunLoop in about 500ms with this == myContext\n }, 500);\n ```\n\n @method later\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait Number of milliseconds to wait.\n @return {String} a string you can use to cancel the timer in\n `run.cancel` later.\n */\n run.later = function(target, method) {\n return apply(backburner, backburner.later, arguments);\n };\n\n /**\n Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling `scheduleOnce` with the \"actions\" queue.\n\n @method once\n @param {Object} [target] The target of the method to invoke.\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} Timer information for use in cancelling, see `run.cancel`.\n */\n run.once = function(target, method) {\n checkAutoRun();\n var args = slice.call(arguments);\n args.unshift('actions');\n return apply(backburner, backburner.scheduleOnce, args);\n };\n\n /**\n Schedules a function to run one time in a given queue of the current RunLoop.\n Calling this method with the same queue/target/method combination will have\n no effect (past the initial call).\n\n Note that although you can pass optional arguments these will not be\n considered when looking for duplicates. New arguments will replace previous\n calls.\n\n ```javascript\n run(function() {\n var sayHi = function() { console.log('hi'); }\n run.scheduleOnce('afterRender', myContext, sayHi);\n run.scheduleOnce('afterRender', myContext, sayHi);\n // sayHi will only be executed once, in the afterRender queue of the RunLoop\n });\n ```\n\n Also note that passing an anonymous function to `run.scheduleOnce` will\n not prevent additional calls with an identical anonymous function from\n scheduling the items multiple times, e.g.:\n\n ```javascript\n function scheduleIt() {\n run.scheduleOnce('actions', myContext, function() { console.log(\"Closure\"); });\n }\n scheduleIt();\n scheduleIt();\n // \"Closure\" will print twice, even though we're using `run.scheduleOnce`,\n // because the function we pass to it is anonymous and won't match the\n // previously scheduled operation.\n ```\n\n Available queues, and their order, can be found at `run.queues`\n\n @method scheduleOnce\n @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'.\n @param {Object} [target] The target of the method to invoke.\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} Timer information for use in cancelling, see `run.cancel`.\n */\n run.scheduleOnce = function(queue, target, method) {\n checkAutoRun();\n return apply(backburner, backburner.scheduleOnce, arguments);\n };\n\n /**\n Schedules an item to run from within a separate run loop, after\n control has been returned to the system. This is equivalent to calling\n `run.later` with a wait time of 1ms.\n\n ```javascript\n run.next(myContext, function() {\n // code to be executed in the next run loop,\n // which will be scheduled after the current one\n });\n ```\n\n Multiple operations scheduled with `run.next` will coalesce\n into the same later run loop, along with any other operations\n scheduled by `run.later` that expire right around the same\n time that `run.next` operations will fire.\n\n Note that there are often alternatives to using `run.next`.\n For instance, if you'd like to schedule an operation to happen\n after all DOM element operations have completed within the current\n run loop, you can make use of the `afterRender` run loop queue (added\n by the `ember-views` package, along with the preceding `render` queue\n where all the DOM element operations happen). Example:\n\n ```javascript\n App.MyCollectionView = Ember.CollectionView.extend({\n didInsertElement: function() {\n run.scheduleOnce('afterRender', this, 'processChildElements');\n },\n processChildElements: function() {\n // ... do something with collectionView's child view\n // elements after they've finished rendering, which\n // can't be done within the CollectionView's\n // `didInsertElement` hook because that gets run\n // before the child elements have been added to the DOM.\n }\n });\n ```\n\n One benefit of the above approach compared to using `run.next` is\n that you will be able to perform DOM/CSS operations before unprocessed\n elements are rendered to the screen, which may prevent flickering or\n other artifacts caused by delaying processing until after rendering.\n\n The other major benefit to the above approach is that `run.next`\n introduces an element of non-determinism, which can make things much\n harder to test, due to its reliance on `setTimeout`; it's much harder\n to guarantee the order of scheduled operations when they are scheduled\n outside of the current run loop, i.e. with `run.next`.\n\n @method next\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} Timer information for use in cancelling, see `run.cancel`.\n */\n run.next = function() {\n var args = slice.call(arguments);\n args.push(1);\n return apply(backburner, backburner.later, args);\n };\n\n /**\n Cancels a scheduled item. Must be a value returned by `run.later()`,\n `run.once()`, `run.next()`, `run.debounce()`, or\n `run.throttle()`.\n\n ```javascript\n var runNext = run.next(myContext, function() {\n // will not be executed\n });\n run.cancel(runNext);\n\n var runLater = run.later(myContext, function() {\n // will not be executed\n }, 500);\n run.cancel(runLater);\n\n var runOnce = run.once(myContext, function() {\n // will not be executed\n });\n run.cancel(runOnce);\n\n var throttle = run.throttle(myContext, function() {\n // will not be executed\n }, 1, false);\n run.cancel(throttle);\n\n var debounce = run.debounce(myContext, function() {\n // will not be executed\n }, 1);\n run.cancel(debounce);\n\n var debounceImmediate = run.debounce(myContext, function() {\n // will be executed since we passed in true (immediate)\n }, 100, true);\n // the 100ms delay until this method can be called again will be cancelled\n run.cancel(debounceImmediate);\n ```\n\n @method cancel\n @param {Object} timer Timer object to cancel\n @return {Boolean} true if cancelled or false/undefined if it wasn't found\n */\n run.cancel = function(timer) {\n return backburner.cancel(timer);\n };\n\n /**\n Delay calling the target method until the debounce period has elapsed\n with no additional debounce calls. If `debounce` is called again before\n the specified time has elapsed, the timer is reset and the entire period\n must pass again before the target method is called.\n\n This method should be used when an event may be called multiple times\n but the action should only be called once when the event is done firing.\n A common example is for scroll events where you only want updates to\n happen once scrolling has ceased.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'debounce'};\n\n run.debounce(myContext, myFunc, 150);\n\n // less than 150ms passes\n\n run.debounce(myContext, myFunc, 150);\n\n // 150ms passes\n // myFunc is invoked with context myContext\n // console logs 'debounce ran.' one time.\n ```\n\n Immediate allows you to run the function immediately, but debounce\n other calls for this function until the wait time has elapsed. If\n `debounce` is called again before the specified time has elapsed,\n the timer is reset and the entire period must pass again before\n the method can be called again.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'debounce'};\n\n run.debounce(myContext, myFunc, 150, true);\n\n // console logs 'debounce ran.' one time immediately.\n // 100ms passes\n\n run.debounce(myContext, myFunc, 150, true);\n\n // 150ms passes and nothing else is logged to the console and\n // the debouncee is no longer being watched\n\n run.debounce(myContext, myFunc, 150, true);\n\n // console logs 'debounce ran.' one time immediately.\n // 150ms passes and nothing else is logged to the console and\n // the debouncee is no longer being watched\n\n ```\n\n @method debounce\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait Number of milliseconds to wait.\n @param {Boolean} immediate Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.\n @return {Array} Timer information for use in cancelling, see `run.cancel`.\n */\n run.debounce = function() {\n return apply(backburner, backburner.debounce, arguments);\n };\n\n /**\n Ensure that the target method is never called more frequently than\n the specified spacing period. The target method is called immediately.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'throttle'};\n\n run.throttle(myContext, myFunc, 150);\n // myFunc is invoked with context myContext\n // console logs 'throttle ran.'\n\n // 50ms passes\n run.throttle(myContext, myFunc, 150);\n\n // 50ms passes\n run.throttle(myContext, myFunc, 150);\n\n // 150ms passes\n run.throttle(myContext, myFunc, 150);\n // myFunc is invoked with context myContext\n // console logs 'throttle ran.'\n ```\n\n @method throttle\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} spacing Number of milliseconds to space out requests.\n @param {Boolean} immediate Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.\n @return {Array} Timer information for use in cancelling, see `run.cancel`.\n */\n run.throttle = function() {\n return apply(backburner, backburner.throttle, arguments);\n };\n\n // Make sure it's not an autorun during testing\n function checkAutoRun() {\n if (!run.currentRunLoop) {\n Ember.assert(\"You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an run\", !Ember.testing);\n }\n }\n\n /**\n Add a new named queue after the specified queue.\n\n The queue to add will only be added once.\n\n @method _addQueue\n @param {String} name the name of the queue to add.\n @param {String} after the name of the queue to add after.\n @private\n */\n run._addQueue = function(name, after) {\n if (indexOf.call(run.queues, name) === -1) {\n run.queues.splice(indexOf.call(run.queues, after)+1, 0, name);\n }\n }\n\n __exports__[\"default\"] = run\n });\ndefine(\"ember-metal/set_properties\",\n [\"ember-metal/property_events\",\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var changeProperties = __dependency1__.changeProperties;\n var set = __dependency2__.set;\n\n /**\n Set a list of properties on an object. These properties are set inside\n a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n observers will be buffered.\n\n ```javascript\n var anObject = Ember.Object.create();\n\n anObject.setProperties({\n firstName: 'Stanley',\n lastName: 'Stuart',\n age: 21\n });\n ```\n\n @method setProperties\n @param self\n @param {Object} hash\n @return self\n */\n function setProperties(self, hash) {\n changeProperties(function() {\n for(var prop in hash) {\n if (hash.hasOwnProperty(prop)) { set(self, prop, hash[prop]); }\n }\n });\n return self;\n };\n\n __exports__[\"default\"] = setProperties;\n });\ndefine(\"ember-metal/utils\",\n [\"ember-metal/core\",\"ember-metal/platform\",\"ember-metal/array\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var platform = __dependency2__.platform;\n var create = __dependency2__.create;\n var forEach = __dependency3__.forEach;\n\n /**\n @module ember-metal\n */\n\n /**\n Prefix used for guids through out Ember.\n @private\n @property GUID_PREFIX\n @for Ember\n @type String\n @final\n */\n var GUID_PREFIX = 'ember';\n\n\n var o_defineProperty = platform.defineProperty,\n o_create = create,\n // Used for guid generation...\n numberCache = [],\n stringCache = {},\n uuid = 0;\n\n var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n /**\n A unique key used to assign guids and other private metadata to objects.\n If you inspect an object in your browser debugger you will often see these.\n They can be safely ignored.\n\n On browsers that support it, these properties are added with enumeration\n disabled so they won't show up when you iterate over your properties.\n\n @private\n @property GUID_KEY\n @for Ember\n @type String\n @final\n */\n var GUID_KEY = '__ember' + (+ new Date());\n\n var GUID_DESC = {\n writable: false,\n configurable: false,\n enumerable: false,\n value: null\n };\n\n /**\n Generates a new guid, optionally saving the guid to the object that you\n pass in. You will rarely need to use this method. Instead you should\n call `Ember.guidFor(obj)`, which return an existing guid if available.\n\n @private\n @method generateGuid\n @for Ember\n @param {Object} [obj] Object the guid will be used for. If passed in, the guid will\n be saved on the object and reused whenever you pass the same object\n again.\n\n If no object is passed, just generate a new guid.\n @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to\n separate the guid into separate namespaces.\n @return {String} the guid\n */\n function generateGuid(obj, prefix) {\n if (!prefix) prefix = GUID_PREFIX;\n var ret = (prefix + (uuid++));\n if (obj) {\n if (obj[GUID_KEY] === null) {\n obj[GUID_KEY] = ret;\n } else {\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n }\n }\n return ret;\n }\n\n /**\n Returns a unique id for the object. If the object does not yet have a guid,\n one will be assigned to it. You can call this on any object,\n `Ember.Object`-based or not, but be aware that it will add a `_guid`\n property.\n\n You can also use this method on DOM Element objects.\n\n @private\n @method guidFor\n @for Ember\n @param {Object} obj any object, string, number, Element, or primitive\n @return {String} the unique guid for this instance.\n */\n function guidFor(obj) {\n\n // special cases where we don't want to add a key to object\n if (obj === undefined) return \"(undefined)\";\n if (obj === null) return \"(null)\";\n\n var ret;\n var type = typeof obj;\n\n // Don't allow prototype changes to String etc. to change the guidFor\n switch(type) {\n case 'number':\n ret = numberCache[obj];\n if (!ret) ret = numberCache[obj] = 'nu'+obj;\n return ret;\n\n case 'string':\n ret = stringCache[obj];\n if (!ret) ret = stringCache[obj] = 'st'+(uuid++);\n return ret;\n\n case 'boolean':\n return obj ? '(true)' : '(false)';\n\n default:\n if (obj[GUID_KEY]) return obj[GUID_KEY];\n if (obj === Object) return '(Object)';\n if (obj === Array) return '(Array)';\n ret = 'ember' + (uuid++);\n\n if (obj[GUID_KEY] === null) {\n obj[GUID_KEY] = ret;\n } else {\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n }\n return ret;\n }\n };\n\n // ..........................................................\n // META\n //\n\n var META_DESC = {\n writable: true,\n configurable: false,\n enumerable: false,\n value: null\n };\n\n\n /**\n The key used to store meta information on object for property observing.\n\n @property META_KEY\n @for Ember\n @private\n @final\n @type String\n */\n var META_KEY = '__ember_meta__';\n\n var isDefinePropertySimulated = platform.defineProperty.isSimulated;\n\n function Meta(obj) {\n this.descs = {};\n this.watching = {};\n this.cache = {};\n this.cacheMeta = {};\n this.source = obj;\n }\n\n Meta.prototype = {\n descs: null,\n deps: null,\n watching: null,\n listeners: null,\n cache: null,\n cacheMeta: null,\n source: null,\n mixins: null,\n bindings: null,\n chains: null,\n chainWatchers: null,\n values: null,\n proto: null\n };\n\n if (isDefinePropertySimulated) {\n // on platforms that don't support enumerable false\n // make meta fail jQuery.isPlainObject() to hide from\n // jQuery.extend() by having a property that fails\n // hasOwnProperty check.\n Meta.prototype.__preventPlainObject__ = true;\n\n // Without non-enumerable properties, meta objects will be output in JSON\n // unless explicitly suppressed\n Meta.prototype.toJSON = function () { };\n }\n\n // Placeholder for non-writable metas.\n var EMPTY_META = new Meta(null);\n\n if (MANDATORY_SETTER) { EMPTY_META.values = {}; }\n\n /**\n Retrieves the meta hash for an object. If `writable` is true ensures the\n hash is writable for this object as well.\n\n The meta object contains information about computed property descriptors as\n well as any watched properties and other information. You generally will\n not access this information directly but instead work with higher level\n methods that manipulate this hash indirectly.\n\n @method meta\n @for Ember\n @private\n\n @param {Object} obj The object to retrieve meta for\n @param {Boolean} [writable=true] Pass `false` if you do not intend to modify\n the meta hash, allowing the method to avoid making an unnecessary copy.\n @return {Object} the meta hash for an object\n */\n function meta(obj, writable) {\n\n var ret = obj[META_KEY];\n if (writable===false) return ret || EMPTY_META;\n\n if (!ret) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = new Meta(obj);\n\n if (MANDATORY_SETTER) { ret.values = {}; }\n\n obj[META_KEY] = ret;\n\n // make sure we don't accidentally try to create constructor like desc\n ret.descs.constructor = null;\n\n } else if (ret.source !== obj) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = o_create(ret);\n ret.descs = o_create(ret.descs);\n ret.watching = o_create(ret.watching);\n ret.cache = {};\n ret.cacheMeta = {};\n ret.source = obj;\n\n if (MANDATORY_SETTER) { ret.values = o_create(ret.values); }\n\n obj[META_KEY] = ret;\n }\n return ret;\n };\n\n function getMeta(obj, property) {\n var _meta = meta(obj, false);\n return _meta[property];\n };\n\n function setMeta(obj, property, value) {\n var _meta = meta(obj, true);\n _meta[property] = value;\n return value;\n };\n\n /**\n @deprecated\n @private\n\n In order to store defaults for a class, a prototype may need to create\n a default meta object, which will be inherited by any objects instantiated\n from the class's constructor.\n\n However, the properties of that meta object are only shallow-cloned,\n so if a property is a hash (like the event system's `listeners` hash),\n it will by default be shared across all instances of that class.\n\n This method allows extensions to deeply clone a series of nested hashes or\n other complex objects. For instance, the event system might pass\n `['listeners', 'foo:change', 'ember157']` to `prepareMetaPath`, which will\n walk down the keys provided.\n\n For each key, if the key does not exist, it is created. If it already\n exists and it was inherited from its constructor, the constructor's\n key is cloned.\n\n You can also pass false for `writable`, which will simply return\n undefined if `prepareMetaPath` discovers any part of the path that\n shared or undefined.\n\n @method metaPath\n @for Ember\n @param {Object} obj The object whose meta we are examining\n @param {Array} path An array of keys to walk down\n @param {Boolean} writable whether or not to create a new meta\n (or meta property) if one does not already exist or if it's\n shared with its constructor\n */\n function metaPath(obj, path, writable) {\n Ember.deprecate(\"Ember.metaPath is deprecated and will be removed from future releases.\");\n var _meta = meta(obj, writable), keyName, value;\n\n for (var i=0, l=path.length; i<l; i++) {\n keyName = path[i];\n value = _meta[keyName];\n\n if (!value) {\n if (!writable) { return undefined; }\n value = _meta[keyName] = { __ember_source__: obj };\n } else if (value.__ember_source__ !== obj) {\n if (!writable) { return undefined; }\n value = _meta[keyName] = o_create(value);\n value.__ember_source__ = obj;\n }\n\n _meta = value;\n }\n\n return value;\n };\n\n /**\n Wraps the passed function so that `this._super` will point to the superFunc\n when the function is invoked. This is the primitive we use to implement\n calls to super.\n\n @private\n @method wrap\n @for Ember\n @param {Function} func The function to call\n @param {Function} superFunc The super function.\n @return {Function} wrapped function.\n */\n function wrap(func, superFunc) {\n function superWrapper() {\n var ret, sup = this.__nextSuper;\n this.__nextSuper = superFunc;\n ret = apply(this, func, arguments);\n this.__nextSuper = sup;\n return ret;\n }\n\n superWrapper.wrappedFunction = func;\n superWrapper.wrappedFunction.__ember_arity__ = func.length;\n superWrapper.__ember_observes__ = func.__ember_observes__;\n superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__;\n superWrapper.__ember_listens__ = func.__ember_listens__;\n\n return superWrapper;\n };\n\n var EmberArray;\n\n /**\n Returns true if the passed object is an array or Array-like.\n\n Ember Array Protocol:\n\n - the object has an objectAt property\n - the object is a native Array\n - the object is an Object, and has a length property\n\n Unlike `Ember.typeOf` this method returns true even if the passed object is\n not formally array but appears to be array-like (i.e. implements `Ember.Array`)\n\n ```javascript\n Ember.isArray(); // false\n Ember.isArray([]); // true\n Ember.isArray(Ember.ArrayProxy.create({ content: [] })); // true\n ```\n\n @method isArray\n @for Ember\n @param {Object} obj The object to test\n @return {Boolean} true if the passed object is an array or Array-like\n */\n // ES6TODO: Move up to runtime? This is only use in ember-metal by concatenatedProperties\n function isArray(obj) {\n var modulePath, type;\n\n if (typeof EmberArray === \"undefined\") {\n modulePath = 'ember-runtime/mixins/array';\n if (requirejs._eak_seen[modulePath]) {\n EmberArray = requireModule(modulePath)['default'];\n }\n }\n\n if (!obj || obj.setInterval) { return false; }\n if (Array.isArray && Array.isArray(obj)) { return true; }\n if (EmberArray && EmberArray.detect(obj)) { return true; }\n\n type = typeOf(obj);\n if ('array' === type) { return true; }\n if ((obj.length !== undefined) && 'object' === type) { return true; }\n return false;\n };\n\n /**\n Forces the passed object to be part of an array. If the object is already\n an array or array-like, returns the object. Otherwise adds the object to\n an array. If obj is `null` or `undefined`, returns an empty array.\n\n ```javascript\n Ember.makeArray(); // []\n Ember.makeArray(null); // []\n Ember.makeArray(undefined); // []\n Ember.makeArray('lindsay'); // ['lindsay']\n Ember.makeArray([1, 2, 42]); // [1, 2, 42]\n\n var controller = Ember.ArrayProxy.create({ content: [] });\n\n Ember.makeArray(controller) === controller; // true\n ```\n\n @method makeArray\n @for Ember\n @param {Object} obj the object\n @return {Array}\n */\n function makeArray(obj) {\n if (obj === null || obj === undefined) { return []; }\n return isArray(obj) ? obj : [obj];\n };\n\n /**\n Checks to see if the `methodName` exists on the `obj`.\n\n ```javascript\n var foo = { bar: Ember.K, baz: null };\n\n Ember.canInvoke(foo, 'bar'); // true\n Ember.canInvoke(foo, 'baz'); // false\n Ember.canInvoke(foo, 'bat'); // false\n ```\n\n @method canInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @return {Boolean}\n */\n function canInvoke(obj, methodName) {\n return !!(obj && typeof obj[methodName] === 'function');\n }\n\n /**\n Checks to see if the `methodName` exists on the `obj`,\n and if it does, invokes it with the arguments passed.\n\n ```javascript\n var d = new Date('03/15/2013');\n\n Ember.tryInvoke(d, 'getTime'); // 1363320000000\n Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000\n Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined\n ```\n\n @method tryInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @param {Array} [args] The arguments to pass to the method\n @return {*} the return value of the invoked method or undefined if it cannot be invoked\n */\n function tryInvoke(obj, methodName, args) {\n if (canInvoke(obj, methodName)) {\n return args ? applyStr(obj, methodName, args) : applyStr(obj, methodName);\n }\n };\n\n // https://github.com/emberjs/ember.js/pull/1617\n var needsFinallyFix = (function() {\n var count = 0;\n try{\n try { }\n finally {\n count++;\n throw new Error('needsFinallyFixTest');\n }\n } catch (e) {}\n\n return count !== 1;\n })();\n\n /**\n Provides try/finally functionality, while working\n around Safari's double finally bug.\n\n ```javascript\n var tryable = function() {\n someResource.lock();\n runCallback(); // May throw error.\n };\n\n var finalizer = function() {\n someResource.unlock();\n };\n\n Ember.tryFinally(tryable, finalizer);\n ```\n\n @method tryFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} finalizer The function to run the finally callback\n @param {Object} [binding] The optional calling object. Defaults to 'this'\n @return {*} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable\n */\n\n var tryFinally;\n if (needsFinallyFix) {\n tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e) {\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n } else {\n tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n }\n\n /**\n Provides try/catch/finally functionality, while working\n around Safari's double finally bug.\n\n ```javascript\n var tryable = function() {\n for (i = 0, l = listeners.length; i < l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n };\n\n var catchable = function(e) {\n payload = payload || {};\n payload.exception = e;\n };\n\n var finalizer = function() {\n for (i = 0, l = listeners.length; i < l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n };\n\n Ember.tryCatchFinally(tryable, catchable, finalizer);\n ```\n\n @method tryCatchFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} catchable The function to run the catchable callback\n @param {Function} finalizer The function to run the finally callback\n @param {Object} [binding] The optional calling object. Defaults to 'this'\n @return {*} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable.\n */\n var tryCatchFinally;\n if (needsFinallyFix) {\n tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e) {\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n } else {\n tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n }\n\n // ........................................\n // TYPING & ARRAY MESSAGING\n //\n\n var TYPE_MAP = {};\n var t = \"Boolean Number String Function Array Date RegExp Object\".split(\" \");\n forEach.call(t, function(name) {\n TYPE_MAP[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n });\n\n var toString = Object.prototype.toString;\n\n var EmberObject;\n\n /**\n Returns a consistent type for the passed item.\n\n Use this instead of the built-in `typeof` to get the type of an item.\n It will return the same result across all browsers and includes a bit\n more detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive or String object. |\n | 'number' | Number primitive or Number object. |\n | 'boolean' | Boolean primitive or Boolean object. |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'regexp' | An instance of RegExp |\n | 'date' | An instance of Date |\n | 'class' | An Ember class (created using Ember.Object.extend()) |\n | 'instance' | An Ember object instance |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object not inheriting from Ember.Object |\n\n Examples:\n\n ```javascript\n Ember.typeOf(); // 'undefined'\n Ember.typeOf(null); // 'null'\n Ember.typeOf(undefined); // 'undefined'\n Ember.typeOf('michael'); // 'string'\n Ember.typeOf(new String('michael')); // 'string'\n Ember.typeOf(101); // 'number'\n Ember.typeOf(new Number(101)); // 'number'\n Ember.typeOf(true); // 'boolean'\n Ember.typeOf(new Boolean(true)); // 'boolean'\n Ember.typeOf(Ember.makeArray); // 'function'\n Ember.typeOf([1, 2, 90]); // 'array'\n Ember.typeOf(/abc/); // 'regexp'\n Ember.typeOf(new Date()); // 'date'\n Ember.typeOf(Ember.Object.extend()); // 'class'\n Ember.typeOf(Ember.Object.create()); // 'instance'\n Ember.typeOf(new Error('teamocil')); // 'error'\n\n // 'normal' JavaScript object\n Ember.typeOf({ a: 'b' }); // 'object'\n ```\n\n @method typeOf\n @for Ember\n @param {Object} item the item to check\n @return {String} the type\n */\n function typeOf(item) {\n var ret, modulePath;\n\n // ES6TODO: Depends on Ember.Object which is defined in runtime.\n if (typeof EmberObject === \"undefined\") {\n modulePath = 'ember-runtime/system/object';\n if (requirejs._eak_seen[modulePath]) {\n EmberObject = requireModule(modulePath)['default'];\n }\n }\n\n ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object';\n\n if (ret === 'function') {\n if (EmberObject && EmberObject.detect(item)) ret = 'class';\n } else if (ret === 'object') {\n if (item instanceof Error) ret = 'error';\n else if (EmberObject && item instanceof EmberObject) ret = 'instance';\n else if (item instanceof Date) ret = 'date';\n }\n\n return ret;\n };\n\n /**\n Convenience method to inspect an object. This method will attempt to\n convert the object into a useful string description.\n\n It is a pretty simple implementation. If you want something more robust,\n use something like JSDump: https://github.com/NV/jsDump\n\n @method inspect\n @for Ember\n @param {Object} obj The object you want to inspect.\n @return {String} A description of the object\n @since 1.4.0\n */\n function inspect(obj) {\n var type = typeOf(obj);\n if (type === 'array') {\n return '[' + obj + ']';\n }\n if (type !== 'object') {\n return obj + '';\n }\n\n var v, ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) {\n v = obj[key];\n if (v === 'toString') { continue; } // ignore useless items\n if (typeOf(v) === 'function') { v = \"function() { ... }\"; }\n ret.push(key + \": \" + v);\n }\n }\n return \"{\" + ret.join(\", \") + \"}\";\n };\n\n // The following functions are intentionally minified to keep the functions\n // below Chrome's function body size inlining limit of 600 chars.\n\n function apply(t /* target */, m /* method */, a /* args */) {\n var l = a && a.length;\n if (!a || !l) { return m.call(t); }\n switch (l) {\n case 1: return m.call(t, a[0]);\n case 2: return m.call(t, a[0], a[1]);\n case 3: return m.call(t, a[0], a[1], a[2]);\n case 4: return m.call(t, a[0], a[1], a[2], a[3]);\n case 5: return m.call(t, a[0], a[1], a[2], a[3], a[4]);\n default: return m.apply(t, a);\n }\n };\n\n function applyStr(t /* target */, m /* method */, a /* args */) {\n var l = a && a.length;\n if (!a || !l) { return t[m](); }\n switch (l) {\n case 1: return t[m](a[0]);\n case 2: return t[m](a[0], a[1]);\n case 3: return t[m](a[0], a[1], a[2]);\n case 4: return t[m](a[0], a[1], a[2], a[3]);\n case 5: return t[m](a[0], a[1], a[2], a[3], a[4]);\n default: return t[m].apply(t, a);\n }\n };\n\n __exports__.generateGuid = generateGuid;\n __exports__.GUID_KEY = GUID_KEY;\n __exports__.GUID_PREFIX = GUID_PREFIX;\n __exports__.guidFor = guidFor;\n __exports__.META_DESC = META_DESC;\n __exports__.EMPTY_META = EMPTY_META;\n __exports__.META_KEY = META_KEY;\n __exports__.meta = meta;\n __exports__.getMeta = getMeta;\n __exports__.setMeta = setMeta;\n __exports__.metaPath = metaPath;\n __exports__.inspect = inspect;\n __exports__.typeOf = typeOf;\n __exports__.tryCatchFinally = tryCatchFinally;\n __exports__.isArray = isArray;\n __exports__.makeArray = makeArray;\n __exports__.canInvoke = canInvoke;\n __exports__.tryInvoke = tryInvoke;\n __exports__.tryFinally = tryFinally;\n __exports__.wrap = wrap;\n __exports__.applyStr = applyStr;\n __exports__.apply = apply;\n });\ndefine(\"backburner\",\n [\"backburner/utils\",\"backburner/deferred_action_queues\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Utils = __dependency1__[\"default\"];\n var DeferredActionQueues = __dependency2__.DeferredActionQueues;\n\n var slice = [].slice,\n pop = [].pop,\n each = Utils.each,\n isString = Utils.isString,\n isFunction = Utils.isFunction,\n isNumber = Utils.isNumber,\n timers = [],\n global = this,\n NUMBER = /\\d+/;\n\n // In IE 6-8, try/finally doesn't work without a catch.\n // Unfortunately, this is impossible to test for since wrapping it in a parent try/catch doesn't trigger the bug.\n // This tests for another broken try/catch behavior that only exhibits in the same versions of IE.\n var needsIETryCatchFix = (function(e,x){\n try{ x(); }\n catch(e) { } // jshint ignore:line\n return !!e;\n })();\n\n function isCoercableNumber(number) {\n return isNumber(number) || NUMBER.test(number);\n }\n\n function Backburner(queueNames, options) {\n this.queueNames = queueNames;\n this.options = options || {};\n if (!this.options.defaultQueue) {\n this.options.defaultQueue = queueNames[0];\n }\n this.instanceStack = [];\n this._debouncees = [];\n this._throttlers = [];\n }\n\n Backburner.prototype = {\n queueNames: null,\n options: null,\n currentInstance: null,\n instanceStack: null,\n\n begin: function() {\n var options = this.options,\n onBegin = options && options.onBegin,\n previousInstance = this.currentInstance;\n\n if (previousInstance) {\n this.instanceStack.push(previousInstance);\n }\n\n this.currentInstance = new DeferredActionQueues(this.queueNames, options);\n if (onBegin) {\n onBegin(this.currentInstance, previousInstance);\n }\n },\n\n end: function() {\n var options = this.options,\n onEnd = options && options.onEnd,\n currentInstance = this.currentInstance,\n nextInstance = null;\n\n // Prevent double-finally bug in Safari 6.0.2 and iOS 6\n // This bug appears to be resolved in Safari 6.0.5 and iOS 7\n var finallyAlreadyCalled = false;\n try {\n currentInstance.flush();\n } finally {\n if (!finallyAlreadyCalled) {\n finallyAlreadyCalled = true;\n\n this.currentInstance = null;\n\n if (this.instanceStack.length) {\n nextInstance = this.instanceStack.pop();\n this.currentInstance = nextInstance;\n }\n\n if (onEnd) {\n onEnd(currentInstance, nextInstance);\n }\n }\n }\n },\n\n run: function(target, method /*, args */) {\n var onError = getOnError(this.options);\n\n this.begin();\n\n if (!method) {\n method = target;\n target = null;\n }\n\n if (isString(method)) {\n method = target[method];\n }\n\n var args = slice.call(arguments, 2);\n\n // guard against Safari 6's double-finally bug\n var didFinally = false;\n\n if (onError) {\n try {\n return method.apply(target, args);\n } catch(error) {\n onError(error);\n } finally {\n if (!didFinally) {\n didFinally = true;\n this.end();\n }\n }\n } else {\n try {\n return method.apply(target, args);\n } finally {\n if (!didFinally) {\n didFinally = true;\n this.end();\n }\n }\n }\n },\n\n defer: function(queueName, target, method /* , args */) {\n if (!method) {\n method = target;\n target = null;\n }\n\n if (isString(method)) {\n method = target[method];\n }\n\n var stack = this.DEBUG ? new Error() : undefined,\n args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;\n if (!this.currentInstance) { createAutorun(this); }\n return this.currentInstance.schedule(queueName, target, method, args, false, stack);\n },\n\n deferOnce: function(queueName, target, method /* , args */) {\n if (!method) {\n method = target;\n target = null;\n }\n\n if (isString(method)) {\n method = target[method];\n }\n\n var stack = this.DEBUG ? new Error() : undefined,\n args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;\n if (!this.currentInstance) { createAutorun(this); }\n return this.currentInstance.schedule(queueName, target, method, args, true, stack);\n },\n\n setTimeout: function() {\n var args = slice.call(arguments),\n length = args.length,\n method, wait, target,\n methodOrTarget, methodOrWait, methodOrArgs;\n\n if (length === 0) {\n return;\n } else if (length === 1) {\n method = args.shift();\n wait = 0;\n } else if (length === 2) {\n methodOrTarget = args[0];\n methodOrWait = args[1];\n\n if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) {\n target = args.shift();\n method = args.shift();\n wait = 0;\n } else if (isCoercableNumber(methodOrWait)) {\n method = args.shift();\n wait = args.shift();\n } else {\n method = args.shift();\n wait = 0;\n }\n } else {\n var last = args[args.length - 1];\n\n if (isCoercableNumber(last)) {\n wait = args.pop();\n } else {\n wait = 0;\n }\n\n methodOrTarget = args[0];\n methodOrArgs = args[1];\n\n if (isFunction(methodOrArgs) || (isString(methodOrArgs) &&\n methodOrTarget !== null &&\n methodOrArgs in methodOrTarget)) {\n target = args.shift();\n method = args.shift();\n } else {\n method = args.shift();\n }\n }\n\n var executeAt = (+new Date()) + parseInt(wait, 10);\n\n if (isString(method)) {\n method = target[method];\n }\n\n var onError = getOnError(this.options);\n\n function fn() {\n if (onError) {\n try {\n method.apply(target, args);\n } catch (e) {\n onError(e);\n }\n } else {\n method.apply(target, args);\n }\n }\n\n // find position to insert\n var i = searchTimer(executeAt, timers);\n\n timers.splice(i, 0, executeAt, fn);\n\n updateLaterTimer(this, executeAt, wait);\n\n return fn;\n },\n\n throttle: function(target, method /* , args, wait, [immediate] */) {\n var self = this,\n args = arguments,\n immediate = pop.call(args),\n wait,\n throttler,\n index,\n timer;\n\n if (isNumber(immediate) || isString(immediate)) {\n wait = immediate;\n immediate = true;\n } else {\n wait = pop.call(args);\n }\n\n wait = parseInt(wait, 10);\n\n index = findThrottler(target, method, this._throttlers);\n if (index > -1) { return this._throttlers[index]; } // throttled\n\n timer = global.setTimeout(function() {\n if (!immediate) {\n self.run.apply(self, args);\n }\n var index = findThrottler(target, method, self._throttlers);\n if (index > -1) {\n self._throttlers.splice(index, 1);\n }\n }, wait);\n\n if (immediate) {\n self.run.apply(self, args);\n }\n\n throttler = [target, method, timer];\n\n this._throttlers.push(throttler);\n\n return throttler;\n },\n\n debounce: function(target, method /* , args, wait, [immediate] */) {\n var self = this,\n args = arguments,\n immediate = pop.call(args),\n wait,\n index,\n debouncee,\n timer;\n\n if (isNumber(immediate) || isString(immediate)) {\n wait = immediate;\n immediate = false;\n } else {\n wait = pop.call(args);\n }\n\n wait = parseInt(wait, 10);\n // Remove debouncee\n index = findDebouncee(target, method, this._debouncees);\n\n if (index > -1) {\n debouncee = this._debouncees[index];\n this._debouncees.splice(index, 1);\n clearTimeout(debouncee[2]);\n }\n\n timer = global.setTimeout(function() {\n if (!immediate) {\n self.run.apply(self, args);\n }\n var index = findDebouncee(target, method, self._debouncees);\n if (index > -1) {\n self._debouncees.splice(index, 1);\n }\n }, wait);\n\n if (immediate && index === -1) {\n self.run.apply(self, args);\n }\n\n debouncee = [target, method, timer];\n\n self._debouncees.push(debouncee);\n\n return debouncee;\n },\n\n cancelTimers: function() {\n var clearItems = function(item) {\n clearTimeout(item[2]);\n };\n\n each(this._throttlers, clearItems);\n this._throttlers = [];\n\n each(this._debouncees, clearItems);\n this._debouncees = [];\n\n if (this._laterTimer) {\n clearTimeout(this._laterTimer);\n this._laterTimer = null;\n }\n timers = [];\n\n if (this._autorun) {\n clearTimeout(this._autorun);\n this._autorun = null;\n }\n },\n\n hasTimers: function() {\n return !!timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun;\n },\n\n cancel: function(timer) {\n var timerType = typeof timer;\n\n if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce\n return timer.queue.cancel(timer);\n } else if (timerType === 'function') { // we're cancelling a setTimeout\n for (var i = 0, l = timers.length; i < l; i += 2) {\n if (timers[i + 1] === timer) {\n timers.splice(i, 2); // remove the two elements\n return true;\n }\n }\n } else if (Object.prototype.toString.call(timer) === \"[object Array]\"){ // we're cancelling a throttle or debounce\n return this._cancelItem(findThrottler, this._throttlers, timer) ||\n this._cancelItem(findDebouncee, this._debouncees, timer);\n } else {\n return; // timer was null or not a timer\n }\n },\n\n _cancelItem: function(findMethod, array, timer){\n var item,\n index;\n\n if (timer.length < 3) { return false; }\n\n index = findMethod(timer[0], timer[1], array);\n\n if(index > -1) {\n\n item = array[index];\n\n if(item[2] === timer[2]){\n array.splice(index, 1);\n clearTimeout(timer[2]);\n return true;\n }\n }\n\n return false;\n }\n };\n\n Backburner.prototype.schedule = Backburner.prototype.defer;\n Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce;\n Backburner.prototype.later = Backburner.prototype.setTimeout;\n\n if (needsIETryCatchFix) {\n var originalRun = Backburner.prototype.run;\n Backburner.prototype.run = wrapInTryCatch(originalRun);\n\n var originalEnd = Backburner.prototype.end;\n Backburner.prototype.end = wrapInTryCatch(originalEnd);\n }\n\n function wrapInTryCatch(func) {\n return function () {\n try {\n return func.apply(this, arguments);\n } catch (e) {\n throw e;\n }\n };\n }\n\n function getOnError(options) {\n return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]);\n }\n\n\n function createAutorun(backburner) {\n backburner.begin();\n backburner._autorun = global.setTimeout(function() {\n backburner._autorun = null;\n backburner.end();\n });\n }\n\n function updateLaterTimer(self, executeAt, wait) {\n if (!self._laterTimer || executeAt < self._laterTimerExpiresAt) {\n self._laterTimer = global.setTimeout(function() {\n self._laterTimer = null;\n self._laterTimerExpiresAt = null;\n executeTimers(self);\n }, wait);\n self._laterTimerExpiresAt = executeAt;\n }\n }\n\n function executeTimers(self) {\n var now = +new Date(),\n time, fns, i, l;\n\n self.run(function() {\n i = searchTimer(now, timers);\n\n fns = timers.splice(0, i);\n\n for (i = 1, l = fns.length; i < l; i += 2) {\n self.schedule(self.options.defaultQueue, null, fns[i]);\n }\n });\n\n if (timers.length) {\n updateLaterTimer(self, timers[0], timers[0] - now);\n }\n }\n\n function findDebouncee(target, method, debouncees) {\n return findItem(target, method, debouncees);\n }\n\n function findThrottler(target, method, throttlers) {\n return findItem(target, method, throttlers);\n }\n\n function findItem(target, method, collection) {\n var item,\n index = -1;\n\n for (var i = 0, l = collection.length; i < l; i++) {\n item = collection[i];\n if (item[0] === target && item[1] === method) {\n index = i;\n break;\n }\n }\n\n return index;\n }\n\n function searchTimer(time, timers) {\n var start = 0,\n end = timers.length - 2,\n middle, l;\n\n while (start < end) {\n // since timers is an array of pairs 'l' will always\n // be an integer\n l = (end - start) / 2;\n\n // compensate for the index in case even number\n // of pairs inside timers\n middle = start + l - (l % 2);\n\n if (time >= timers[middle]) {\n start = middle + 2;\n } else {\n end = middle;\n }\n }\n\n return (time >= timers[start]) ? start + 2 : start;\n }\n\n __exports__.Backburner = Backburner;\n });\ndefine(\"backburner/deferred_action_queues\",\n [\"backburner/utils\",\"backburner/queue\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Utils = __dependency1__[\"default\"];\n var Queue = __dependency2__.Queue;\n\n var each = Utils.each,\n isString = Utils.isString;\n\n function DeferredActionQueues(queueNames, options) {\n var queues = this.queues = {};\n this.queueNames = queueNames = queueNames || [];\n\n this.options = options;\n\n each(queueNames, function(queueName) {\n queues[queueName] = new Queue(this, queueName, options);\n });\n }\n\n DeferredActionQueues.prototype = {\n queueNames: null,\n queues: null,\n options: null,\n\n schedule: function(queueName, target, method, args, onceFlag, stack) {\n var queues = this.queues,\n queue = queues[queueName];\n\n if (!queue) { throw new Error(\"You attempted to schedule an action in a queue (\" + queueName + \") that doesn't exist\"); }\n\n if (onceFlag) {\n return queue.pushUnique(target, method, args, stack);\n } else {\n return queue.push(target, method, args, stack);\n }\n },\n\n invoke: function(target, method, args, _) {\n if (args && args.length > 0) {\n method.apply(target, args);\n } else {\n method.call(target);\n }\n },\n\n invokeWithOnError: function(target, method, args, onError) {\n try {\n if (args && args.length > 0) {\n method.apply(target, args);\n } else {\n method.call(target);\n }\n } catch(error) {\n onError(error);\n }\n },\n\n flush: function() {\n var queues = this.queues,\n queueNames = this.queueNames,\n queueName, queue, queueItems, priorQueueNameIndex,\n queueNameIndex = 0, numberOfQueues = queueNames.length,\n options = this.options,\n onError = options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]),\n invoke = onError ? this.invokeWithOnError : this.invoke;\n\n outerloop:\n while (queueNameIndex < numberOfQueues) {\n queueName = queueNames[queueNameIndex];\n queue = queues[queueName];\n queueItems = queue._queueBeingFlushed = queue._queue.slice();\n queue._queue = [];\n\n var queueOptions = queue.options, // TODO: write a test for this\n before = queueOptions && queueOptions.before,\n after = queueOptions && queueOptions.after,\n target, method, args, stack,\n queueIndex = 0, numberOfQueueItems = queueItems.length;\n\n if (numberOfQueueItems && before) { before(); }\n\n while (queueIndex < numberOfQueueItems) {\n target = queueItems[queueIndex];\n method = queueItems[queueIndex+1];\n args = queueItems[queueIndex+2];\n stack = queueItems[queueIndex+3]; // Debugging assistance\n\n if (isString(method)) { method = target[method]; }\n\n // method could have been nullified / canceled during flush\n if (method) {\n invoke(target, method, args, onError);\n }\n\n queueIndex += 4;\n }\n\n queue._queueBeingFlushed = null;\n if (numberOfQueueItems && after) { after(); }\n\n if ((priorQueueNameIndex = indexOfPriorQueueWithActions(this, queueNameIndex)) !== -1) {\n queueNameIndex = priorQueueNameIndex;\n continue outerloop;\n }\n\n queueNameIndex++;\n }\n }\n };\n\n function indexOfPriorQueueWithActions(daq, currentQueueIndex) {\n var queueName, queue;\n\n for (var i = 0, l = currentQueueIndex; i <= l; i++) {\n queueName = daq.queueNames[i];\n queue = daq.queues[queueName];\n if (queue._queue.length) { return i; }\n }\n\n return -1;\n }\n\n __exports__.DeferredActionQueues = DeferredActionQueues;\n });\ndefine(\"backburner/queue\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n function Queue(daq, name, options) {\n this.daq = daq;\n this.name = name;\n this.globalOptions = options;\n this.options = options[name];\n this._queue = [];\n }\n\n Queue.prototype = {\n daq: null,\n name: null,\n options: null,\n onError: null,\n _queue: null,\n\n push: function(target, method, args, stack) {\n var queue = this._queue;\n queue.push(target, method, args, stack);\n return {queue: this, target: target, method: method};\n },\n\n pushUnique: function(target, method, args, stack) {\n var queue = this._queue, currentTarget, currentMethod, i, l;\n\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === target && currentMethod === method) {\n queue[i+2] = args; // replace args\n queue[i+3] = stack; // replace stack\n return {queue: this, target: target, method: method};\n }\n }\n\n queue.push(target, method, args, stack);\n return {queue: this, target: target, method: method};\n },\n\n // TODO: remove me, only being used for Ember.run.sync\n flush: function() {\n var queue = this._queue,\n globalOptions = this.globalOptions,\n options = this.options,\n before = options && options.before,\n after = options && options.after,\n onError = globalOptions.onError || (globalOptions.onErrorTarget && globalOptions.onErrorTarget[globalOptions.onErrorMethod]),\n target, method, args, stack, i, l = queue.length;\n\n if (l && before) { before(); }\n for (i = 0; i < l; i += 4) {\n target = queue[i];\n method = queue[i+1];\n args = queue[i+2];\n stack = queue[i+3]; // Debugging assistance\n\n // TODO: error handling\n if (args && args.length > 0) {\n if (onError) {\n try {\n method.apply(target, args);\n } catch (e) {\n onError(e);\n }\n } else {\n method.apply(target, args);\n }\n } else {\n if (onError) {\n try {\n method.call(target);\n } catch(e) {\n onError(e);\n }\n } else {\n method.call(target);\n }\n }\n }\n if (l && after) { after(); }\n\n // check if new items have been added\n if (queue.length > l) {\n this._queue = queue.slice(l);\n this.flush();\n } else {\n this._queue.length = 0;\n }\n },\n\n cancel: function(actionToCancel) {\n var queue = this._queue, currentTarget, currentMethod, i, l;\n\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === actionToCancel.target && currentMethod === actionToCancel.method) {\n queue.splice(i, 4);\n return true;\n }\n }\n\n // if not found in current queue\n // could be in the queue that is being flushed\n queue = this._queueBeingFlushed;\n if (!queue) {\n return;\n }\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === actionToCancel.target && currentMethod === actionToCancel.method) {\n // don't mess with array during flush\n // just nullify the method\n queue[i+1] = null;\n return true;\n }\n }\n }\n };\n\n __exports__.Queue = Queue;\n });\ndefine(\"backburner/utils\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = {\n each: function(collection, callback) {\n for (var i = 0; i < collection.length; i++) {\n callback(collection[i]);\n }\n },\n\n isString: function(suspect) {\n return typeof suspect === 'string';\n },\n\n isFunction: function(suspect) {\n return typeof suspect === 'function';\n },\n\n isNumber: function(suspect) {\n return typeof suspect === 'number';\n }\n };\n });\n\ndefine(\"ember-metal/watch_key\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var meta = __dependency2__.meta;\n var typeOf = __dependency2__.typeOf;\n var platform = __dependency3__.platform;\n\n var metaFor = meta, // utils.js\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n o_defineProperty = platform.defineProperty;\n\n function watchKey(obj, keyName, meta) {\n // can't watch length on Array - it is special...\n if (keyName === 'length' && typeOf(obj) === 'array') { return; }\n\n var m = meta || metaFor(obj), watching = m.watching;\n\n // activate watching first time\n if (!watching[keyName]) {\n watching[keyName] = 1;\n\n if ('function' === typeof obj.willWatchProperty) {\n obj.willWatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n m.values[keyName] = obj[keyName];\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: obj.propertyIsEnumerable(keyName),\n set: Ember.MANDATORY_SETTER_FUNCTION,\n get: Ember.DEFAULT_GETTER_FUNCTION(keyName)\n });\n }\n } else {\n watching[keyName] = (watching[keyName] || 0) + 1;\n }\n };\n\n function unwatchKey(obj, keyName, meta) {\n var m = meta || metaFor(obj), watching = m.watching;\n\n if (watching[keyName] === 1) {\n watching[keyName] = 0;\n\n if ('function' === typeof obj.didUnwatchProperty) {\n obj.didUnwatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: obj.propertyIsEnumerable(keyName),\n set: function(val) {\n // redefine to set as enumerable\n o_defineProperty(obj, keyName, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: val\n });\n delete m.values[keyName];\n },\n get: Ember.DEFAULT_GETTER_FUNCTION(keyName)\n });\n }\n } else if (watching[keyName] > 1) {\n watching[keyName]--;\n }\n };\n\n __exports__.watchKey = watchKey;\n __exports__.unwatchKey = unwatchKey;\n });\ndefine(\"ember-metal/watch_path\",\n [\"ember-metal/utils\",\"ember-metal/chains\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var meta = __dependency1__.meta;\n var typeOf = __dependency1__.typeOf;\n var ChainNode = __dependency2__.ChainNode;\n\n var metaFor = meta;\n\n // get the chains for the current object. If the current object has\n // chains inherited from the proto they will be cloned and reconfigured for\n // the current object.\n function chainsFor(obj, meta) {\n var m = meta || metaFor(obj), ret = m.chains;\n if (!ret) {\n ret = m.chains = new ChainNode(null, null, obj);\n } else if (ret.value() !== obj) {\n ret = m.chains = ret.copy(obj);\n }\n return ret;\n }\n\n function watchPath(obj, keyPath, meta) {\n // can't watch length on Array - it is special...\n if (keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n var m = meta || metaFor(obj), watching = m.watching;\n\n if (!watching[keyPath]) { // activate watching first time\n watching[keyPath] = 1;\n chainsFor(obj, m).add(keyPath);\n } else {\n watching[keyPath] = (watching[keyPath] || 0) + 1;\n }\n };\n\n function unwatchPath(obj, keyPath, meta) {\n var m = meta || metaFor(obj), watching = m.watching;\n\n if (watching[keyPath] === 1) {\n watching[keyPath] = 0;\n chainsFor(obj, m).remove(keyPath);\n } else if (watching[keyPath] > 1) {\n watching[keyPath]--;\n }\n };\n\n __exports__.watchPath = watchPath;\n __exports__.unwatchPath = unwatchPath;\n });\ndefine(\"ember-metal/watching\",\n [\"ember-metal/utils\",\"ember-metal/chains\",\"ember-metal/watch_key\",\"ember-metal/watch_path\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember-metal\n */\n\n var meta = __dependency1__.meta;\n var META_KEY = __dependency1__.META_KEY;\n var GUID_KEY = __dependency1__.GUID_KEY;\n var typeOf = __dependency1__.typeOf;\n var generateGuid = __dependency1__.generateGuid;\n var removeChainWatcher = __dependency2__.removeChainWatcher;\n var flushPendingChains = __dependency2__.flushPendingChains;\n var watchKey = __dependency3__.watchKey;\n var unwatchKey = __dependency3__.unwatchKey;\n var watchPath = __dependency4__.watchPath;\n var unwatchPath = __dependency4__.unwatchPath;\n\n var metaFor = meta; // utils.js\n\n // returns true if the passed path is just a keyName\n function isKeyName(path) {\n return path.indexOf('.') === -1;\n }\n\n /**\n Starts watching a property on an object. Whenever the property changes,\n invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the\n primitive used by observers and dependent keys; usually you will never call\n this method directly but instead use higher level methods like\n `Ember.addObserver()`\n\n @private\n @method watch\n @for Ember\n @param obj\n @param {String} keyName\n */\n function watch(obj, _keyPath, m) {\n // can't watch length on Array - it is special...\n if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n if (isKeyName(_keyPath)) {\n watchKey(obj, _keyPath, m);\n } else {\n watchPath(obj, _keyPath, m);\n }\n };\n\n function isWatching(obj, key) {\n var meta = obj[META_KEY];\n return (meta && meta.watching[key]) > 0;\n };\n\n watch.flushPending = flushPendingChains;\n\n function unwatch(obj, _keyPath, m) {\n // can't watch length on Array - it is special...\n if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n if (isKeyName(_keyPath)) {\n unwatchKey(obj, _keyPath, m);\n } else {\n unwatchPath(obj, _keyPath, m);\n }\n };\n\n /**\n Call on an object when you first beget it from another object. This will\n setup any chained watchers on the object instance as needed. This method is\n safe to call multiple times.\n\n @private\n @method rewatch\n @for Ember\n @param obj\n */\n function rewatch(obj) {\n var m = obj[META_KEY], chains = m && m.chains;\n\n // make sure the object has its own guid.\n if (GUID_KEY in obj && !obj.hasOwnProperty(GUID_KEY)) {\n generateGuid(obj);\n }\n\n // make sure any chained watchers update.\n if (chains && chains.value() !== obj) {\n m.chains = chains.copy(obj);\n }\n };\n\n var NODE_STACK = [];\n\n /**\n Tears down the meta on an object so that it can be garbage collected.\n Multiple calls will have no effect.\n\n @method destroy\n @for Ember\n @param {Object} obj the object to destroy\n @return {void}\n */\n function destroy(obj) {\n var meta = obj[META_KEY], node, nodes, key, nodeObject;\n if (meta) {\n obj[META_KEY] = null;\n // remove chainWatchers to remove circular references that would prevent GC\n node = meta.chains;\n if (node) {\n NODE_STACK.push(node);\n // process tree\n while (NODE_STACK.length > 0) {\n node = NODE_STACK.pop();\n // push children\n nodes = node._chains;\n if (nodes) {\n for (key in nodes) {\n if (nodes.hasOwnProperty(key)) {\n NODE_STACK.push(nodes[key]);\n }\n }\n }\n // remove chainWatcher in node object\n if (node._watching) {\n nodeObject = node._object;\n if (nodeObject) {\n removeChainWatcher(nodeObject, node._key, node);\n }\n }\n }\n }\n }\n };\n\n __exports__.watch = watch;\n __exports__.isWatching = isWatching;\n __exports__.unwatch = unwatch;\n __exports__.rewatch = rewatch;\n __exports__.destroy = destroy;\n });\n})();\n//@ sourceURL=ember-metal");minispade.register('ember-routing', "(function() {minispade.require(\"ember-handlebars\");\nminispade.require(\"ember-views\");\nminispade.require(\"ember-runtime\");\ndefine(\"ember-routing/ext/controller\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/enumerable_utils\",\"ember-runtime/controllers/controller\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, deprecate\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EnumerableUtils = __dependency4__[\"default\"];\n var map = EnumerableUtils.map;\n\n var ControllerMixin = __dependency5__.ControllerMixin;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n\n ControllerMixin.reopen({\n /**\n Transition the application into another route. The route may\n be either a single route or route path:\n\n ```javascript\n aController.transitionToRoute('blogPosts');\n aController.transitionToRoute('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n aController.transitionToRoute('blogPost', aPost);\n ```\n\n If a literal is passed (such as a number or a string), it will\n be treated as an identifier instead. In this case, the `model`\n hook of the route will be triggered:\n\n ```javascript\n aController.transitionToRoute('blogPost', 1);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n App.Router.map(function() {\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n });\n\n aController.transitionToRoute('blogComment', aPost, aComment);\n aController.transitionToRoute('blogComment', 1, 13);\n ```\n\n It is also possible to pass a URL (a string that starts with a\n `/`). This is intended for testing and debugging purposes and\n should rarely be used in production code.\n\n ```javascript\n aController.transitionToRoute('/');\n aController.transitionToRoute('/blog/post/1/comment/13');\n ```\n\n See also [replaceRoute](/api/classes/Ember.ControllerMixin.html#method_replaceRoute).\n\n @param {String} name the name of the route or a URL\n @param {...Object} models the model(s) or identifier(s) to be used\n while transitioning to the route.\n @for Ember.ControllerMixin\n @method transitionToRoute\n */\n transitionToRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.transitionToRoute || target.transitionTo;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method transitionTo\n */\n transitionTo: function() {\n Ember.deprecate(\"transitionTo is deprecated. Please use transitionToRoute.\");\n return this.transitionToRoute.apply(this, arguments);\n },\n\n /**\n Transition into another route while replacing the current URL, if possible.\n This will replace the current history entry instead of adding a new one.\n Beside that, it is identical to `transitionToRoute` in all other respects.\n\n ```javascript\n aController.replaceRoute('blogPosts');\n aController.replaceRoute('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n aController.replaceRoute('blogPost', aPost);\n ```\n\n If a literal is passed (such as a number or a string), it will\n be treated as an identifier instead. In this case, the `model`\n hook of the route will be triggered:\n\n ```javascript\n aController.replaceRoute('blogPost', 1);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n App.Router.map(function() {\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n });\n\n aController.replaceRoute('blogComment', aPost, aComment);\n aController.replaceRoute('blogComment', 1, 13);\n ```\n\n It is also possible to pass a URL (a string that starts with a\n `/`). This is intended for testing and debugging purposes and\n should rarely be used in production code.\n\n ```javascript\n aController.replaceRoute('/');\n aController.replaceRoute('/blog/post/1/comment/13');\n ```\n\n @param {String} name the name of the route or a URL\n @param {...Object} models the model(s) or identifier(s) to be used\n while transitioning to the route.\n @for Ember.ControllerMixin\n @method replaceRoute\n */\n replaceRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.replaceRoute || target.replaceWith;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method replaceWith\n */\n replaceWith: function() {\n Ember.deprecate(\"replaceWith is deprecated. Please use replaceRoute.\");\n return this.replaceRoute.apply(this, arguments);\n }\n });\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n ControllerMixin.reopen({\n concatenatedProperties: ['queryParams'],\n queryParams: null,\n _finalizingQueryParams: false,\n _queryParamChangesDuringSuspension: null\n });\n }\n\n __exports__[\"default\"] = ControllerMixin;\n });\ndefine(\"ember-routing/ext/run_loop\",\n [\"ember-metal/run_loop\"],\n function(__dependency1__) {\n \"use strict\";\n var run = __dependency1__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n\n // Add a new named queue after the 'actions' queue (where RSVP promises\n // resolve), which is used in router transitions to prevent unnecessary\n // loading state entry if all context promises resolve on the\n // 'actions' queue first.\n\n var queues = run.queues;\n run._addQueue('routerTransitions', 'actions');\n });\ndefine(\"ember-routing/ext/view\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/run_loop\",\"ember-views/views/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var run = __dependency3__[\"default\"];\n var EmberView = __dependency4__.View;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n EmberView.reopen({\n\n /**\n Sets the private `_outlets` object on the view.\n\n @method init\n */\n init: function() {\n set(this, '_outlets', {});\n this._super();\n },\n\n /**\n Manually fill any of a view's `{{outlet}}` areas with the\n supplied view.\n\n Example\n\n ```javascript\n var MyView = Ember.View.extend({\n template: Ember.Handlebars.compile('Child view: {{outlet \"main\"}} ')\n });\n var myView = MyView.create();\n myView.appendTo('body');\n // The html for myView now looks like:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n\n var FooView = Ember.View.extend({\n template: Ember.Handlebars.compile('<h1>Foo</h1> ')\n });\n var fooView = FooView.create();\n myView.connectOutlet('main', fooView);\n // The html for myView now looks like:\n // <div id=\"ember228\" class=\"ember-view\">Child view:\n // <div id=\"ember234\" class=\"ember-view\"><h1>Foo</h1> </div>\n // </div>\n ```\n @method connectOutlet\n @param {String} outletName A unique name for the outlet\n @param {Object} view An Ember.View\n */\n connectOutlet: function(outletName, view) {\n if (this._pendingDisconnections) {\n delete this._pendingDisconnections[outletName];\n }\n\n if (this._hasEquivalentView(outletName, view)) {\n view.destroy();\n return;\n }\n\n var outlets = get(this, '_outlets'),\n container = get(this, 'container'),\n router = container && container.lookup('router:main'),\n renderedName = get(view, 'renderedName');\n\n set(outlets, outletName, view);\n\n if (router && renderedName) {\n router._connectActiveView(renderedName, view);\n }\n },\n\n /**\n Determines if the view has already been created by checking if\n the view has the same constructor, template, and context as the\n view in the `_outlets` object.\n\n @private\n @method _hasEquivalentView\n @param {String} outletName The name of the outlet we are checking\n @param {Object} view An Ember.View\n @return {Boolean}\n */\n _hasEquivalentView: function(outletName, view) {\n var existingView = get(this, '_outlets.'+outletName);\n return existingView &&\n existingView.constructor === view.constructor &&\n existingView.get('template') === view.get('template') &&\n existingView.get('context') === view.get('context');\n },\n\n /**\n Removes an outlet from the view.\n\n Example\n\n ```javascript\n var MyView = Ember.View.extend({\n template: Ember.Handlebars.compile('Child view: {{outlet \"main\"}} ')\n });\n var myView = MyView.create();\n myView.appendTo('body');\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n\n var FooView = Ember.View.extend({\n template: Ember.Handlebars.compile('<h1>Foo</h1> ')\n });\n var fooView = FooView.create();\n myView.connectOutlet('main', fooView);\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view:\n // <div id=\"ember234\" class=\"ember-view\"><h1>Foo</h1> </div>\n // </div>\n\n myView.disconnectOutlet('main');\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n ```\n\n @method disconnectOutlet\n @param {String} outletName The name of the outlet to be removed\n */\n disconnectOutlet: function(outletName) {\n if (!this._pendingDisconnections) {\n this._pendingDisconnections = {};\n }\n this._pendingDisconnections[outletName] = true;\n run.once(this, '_finishDisconnections');\n },\n\n /**\n Gets an outlet that is pending disconnection and then\n nullifys the object on the `_outlet` object.\n\n @private\n @method _finishDisconnections\n */\n _finishDisconnections: function() {\n if (this.isDestroyed) return; // _outlets will be gone anyway\n var outlets = get(this, '_outlets');\n var pendingDisconnections = this._pendingDisconnections;\n this._pendingDisconnections = null;\n\n for (var outletName in pendingDisconnections) {\n set(outlets, outletName, null);\n }\n }\n });\n\n __exports__[\"default\"] = EmberView;\n });\ndefine(\"ember-routing/helpers/action\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/array\",\"ember-metal/run_loop\",\"ember-views/system/utils\",\"ember-handlebars\",\"ember-routing/system/router\",\"ember-handlebars/ext\",\"ember-handlebars/helpers/view\",\"ember-routing/helpers/shared\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Handlebars, uuid, FEATURES, assert, deprecate\n var get = __dependency2__.get;\n var forEach = __dependency3__.forEach;\n var run = __dependency4__[\"default\"];\n\n var isSimpleClick = __dependency5__.isSimpleClick;\n var EmberHandlebars = __dependency6__[\"default\"];\n var EmberRouter = __dependency7__[\"default\"];\n\n\n var EmberHandlebars = __dependency6__[\"default\"];\n var handlebarsGet = __dependency8__.handlebarsGet;\n var viewHelper = __dependency9__.viewHelper;\n var resolveParams = __dependency10__.resolveParams;\n var resolvePath = __dependency10__.resolvePath;\n\n // requireModule('ember-handlebars');\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var SafeString = EmberHandlebars.SafeString,\n a_slice = Array.prototype.slice;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return ret.concat(resolveParams(options.context, options.params, { types: types, data: data }));\n }\n\n var ActionHelper = {\n registeredActions: {}\n };\n\n var keys = [\"alt\", \"shift\", \"meta\", \"ctrl\"];\n\n var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/;\n\n var isAllowedEvent = function(event, allowedKeys) {\n if (typeof allowedKeys === \"undefined\") {\n if (POINTER_EVENT_TYPE_REGEX.test(event.type)) {\n return isSimpleClick(event);\n } else {\n allowedKeys = '';\n }\n }\n\n if (allowedKeys.indexOf(\"any\") >= 0) {\n return true;\n }\n\n var allowed = true;\n\n forEach.call(keys, function(key) {\n if (event[key + \"Key\"] && allowedKeys.indexOf(key) === -1) {\n allowed = false;\n }\n });\n\n return allowed;\n };\n\n ActionHelper.registerAction = function(actionNameOrPath, options, allowedKeys) {\n var actionId = ++Ember.uuid;\n\n ActionHelper.registeredActions[actionId] = {\n eventName: options.eventName,\n handler: function handleRegisteredAction(event) {\n if (!isAllowedEvent(event, allowedKeys)) { return true; }\n\n if (options.preventDefault !== false) {\n event.preventDefault();\n }\n\n if (options.bubbles === false) {\n event.stopPropagation();\n }\n\n var target = options.target,\n parameters = options.parameters,\n actionName;\n\n if (target.target) {\n target = handlebarsGet(target.root, target.target, target.options);\n } else {\n target = target.root;\n }\n\n if (options.boundProperty) {\n actionName = resolveParams(parameters.context, [actionNameOrPath], { types: ['ID'], data: parameters.options.data })[0];\n\n if(typeof actionName === 'undefined' || typeof actionName === 'function') {\n Ember.assert(\"You specified a quoteless path to the {{action}} helper '\" + actionNameOrPath + \"' which did not resolve to an actionName. Perhaps you meant to use a quoted actionName? (e.g. {{action '\" + actionNameOrPath + \"'}}).\", true);\n actionName = actionNameOrPath;\n }\n }\n\n if (!actionName) {\n actionName = actionNameOrPath;\n }\n\n run(function runRegisteredAction() {\n if (target.send) {\n target.send.apply(target, args(parameters, actionName));\n } else {\n Ember.assert(\"The action '\" + actionName + \"' did not exist on \" + target, typeof target[actionName] === 'function');\n target[actionName].apply(target, args(parameters));\n }\n });\n }\n };\n\n options.view.on('willClearRender', function() {\n delete ActionHelper.registeredActions[actionId];\n });\n\n return actionId;\n };\n\n /**\n The `{{action}}` helper registers an HTML element within a template for DOM\n event handling and forwards that interaction to the templates's controller\n or supplied `target` option (see 'Specifying a Target').\n\n If the controller does not implement the event, the event is sent\n to the current route, and it bubbles up the route hierarchy from there.\n\n User interaction with that element will invoke the supplied action name on\n the appropriate target. Specifying a non-quoted action name will result in\n a bound property lookup at the time the event will be triggered.\n\n Given the following application Handlebars template on the page\n\n ```handlebars\n <div {{action 'anActionName'}}>\n click me\n </div>\n ```\n\n And application code\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n anActionName: function() {\n }\n }\n });\n ```\n\n Will result in the following rendered HTML\n\n ```html\n <div class=\"ember-view\">\n <div data-ember-action=\"1\">\n click me\n </div>\n </div>\n ```\n\n Clicking \"click me\" will trigger the `anActionName` action of the\n `App.ApplicationController`. In this case, no additional parameters will be passed.\n\n If you provide additional parameters to the helper:\n\n ```handlebars\n <button {{action 'edit' post}}>Edit</button>\n ```\n\n Those parameters will be passed along as arguments to the JavaScript\n function implementing the action.\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers. If you need to allow event propagation (to handle file inputs for\n example) you can supply the `preventDefault=false` option to the `{{action}}` helper:\n\n ```handlebars\n <div {{action \"sayHello\" preventDefault=false}}>\n <input type=\"file\" />\n <input type=\"checkbox\" />\n </div>\n ```\n\n To disable bubbling, pass `bubbles=false` to the helper:\n\n ```handlebars\n <button {{action 'edit' post bubbles=false}}>Edit</button>\n ```\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See [Ember.View](/api/classes/Ember.View.html)\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n <div {{action \"anActionName\" on=\"doubleClick\"}}>\n click me\n </div>\n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n NOTE: Because `{{action}}` depends on Ember's event dispatch system it will\n only function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new `Ember.Application`\n is created. Having an instance of `Ember.Application` will satisfy this\n requirement.\n\n ### Specifying whitelisted modifier keys\n\n By default the `{{action}}` helper will ignore click event with pressed modifier\n keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.\n\n ```handlebars\n <div {{action \"anActionName\" allowedKeys=\"alt\"}}>\n click me\n </div>\n ```\n\n This way the `{{action}}` will fire when clicking with the alt key pressed down.\n\n Alternatively, supply \"any\" to the `allowedKeys` option to accept any combination of modifier keys.\n\n ```handlebars\n <div {{action \"anActionName\" allowedKeys=\"any\"}}>\n click me with any key pressed\n </div>\n ```\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical Ember application, where views are managed through use of the\n `{{outlet}}` helper, actions will bubble to the current controller, then\n to the current route, and then up the route hierarchy.\n\n Alternatively, a `target` option can be provided to the helper to change\n which object will receive the method call. This option must be a path\n to an object, accessible in the current context:\n\n ```handlebars\n {{! the application template }}\n <div {{action \"anActionName\" target=view}}>\n click me\n </div>\n ```\n\n ```javascript\n App.ApplicationView = Ember.View.extend({\n actions: {\n anActionName: function(){}\n }\n });\n\n ```\n\n ### Additional Parameters\n\n You may specify additional parameters to the `{{action}}` helper. These\n parameters are passed along as the arguments to the JavaScript function\n implementing the action.\n\n ```handlebars\n {{#each person in people}}\n <div {{action \"edit\" person}}>\n click me\n </div>\n {{/each}}\n ```\n\n Clicking \"click me\" will trigger the `edit` method on the current controller\n with the value of `person` as a parameter.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object} [context]*\n @param {Hash} options\n */\n function actionHelper(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n controller = options.data.keywords.controller;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\",\n parameters: {\n context: this,\n options: options,\n params: contexts\n },\n view: options.data.view,\n bubbles: hash.bubbles,\n preventDefault: hash.preventDefault,\n target: { options: options },\n boundProperty: options.types[0] === \"ID\"\n };\n\n if (hash.target) {\n action.target.root = this;\n action.target.target = hash.target;\n } else if (controller) {\n action.target.root = controller;\n }\n\n var actionId = ActionHelper.registerAction(actionName, action, hash.allowedKeys);\n return new SafeString('data-ember-action=\"' + actionId + '\"');\n };\n\n __exports__.ActionHelper = ActionHelper;\n __exports__.actionHelper = actionHelper;\n });\ndefine(\"ember-routing/helpers/link_to\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/merge\",\"ember-metal/run_loop\",\"ember-metal/computed\",\"ember-runtime/system/lazy_load\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-runtime/keys\",\"ember-views/system/utils\",\"ember-views/views/view\",\"ember-handlebars\",\"ember-handlebars/helpers/view\",\"ember-routing/system/router\",\"ember-routing/helpers/shared\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, Logger, Handlebars, warn, assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var merge = __dependency4__[\"default\"];\n var run = __dependency5__[\"default\"];\n var computed = __dependency6__.computed;\n\n var onLoad = __dependency7__.onLoad;\n var fmt = __dependency8__.fmt;\n var EmberObject = __dependency9__[\"default\"];\n var keys = __dependency10__[\"default\"];\n var isSimpleClick = __dependency11__.isSimpleClick;\n var EmberView = __dependency12__.View;\n var EmberHandlebars = __dependency13__[\"default\"];\n var viewHelper = __dependency14__.viewHelper;\n var EmberRouter = __dependency15__[\"default\"];\n var resolveParams = __dependency16__.resolveParams;\n var resolvePaths = __dependency16__.resolvePaths;\n\n // requireModule('ember-handlebars');\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var slice = [].slice;\n\n requireModule('ember-handlebars');\n\n var numberOfContextsAcceptedByHandler = function(handler, handlerInfos) {\n var req = 0;\n for (var i = 0, l = handlerInfos.length; i < l; i++) {\n req = req + handlerInfos[i].names.length;\n if (handlerInfos[i].handler === handler)\n break;\n }\n\n // query params adds an additional context\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n req = req + 1;\n }\n return req;\n };\n\n var QueryParams = EmberObject.extend({\n values: null\n });\n\n function computeQueryParams(linkView, stripDefaultValues) {\n var helperParameters = linkView.parameters,\n queryParamsObject = get(linkView, 'queryParamsObject'),\n suppliedParams = {};\n\n if (queryParamsObject) {\n merge(suppliedParams, queryParamsObject.values);\n }\n\n var resolvedParams = get(linkView, 'resolvedParams'),\n router = get(linkView, 'router'),\n routeName = resolvedParams[0],\n paramsForRoute = router._queryParamsFor(routeName),\n qps = paramsForRoute.qps,\n paramsForRecognizer = {};\n\n // We need to collect all non-default query params for this route.\n for (var i = 0, len = qps.length; i < len; ++i) {\n var qp = qps[i];\n\n // Check if the link-to provides a value for this qp.\n var providedType = null, value;\n if (qp.prop in suppliedParams) {\n value = suppliedParams[qp.prop];\n providedType = queryParamsObject.types[qp.prop];\n delete suppliedParams[qp.prop];\n } else if (qp.urlKey in suppliedParams) {\n value = suppliedParams[qp.urlKey];\n providedType = queryParamsObject.types[qp.urlKey];\n delete suppliedParams[qp.urlKey];\n }\n\n if (providedType) {\n if (providedType === 'ID') {\n var normalizedPath = EmberHandlebars.normalizePath(helperParameters.context, value, helperParameters.options.data);\n value = EmberHandlebars.get(normalizedPath.root, normalizedPath.path, helperParameters.options);\n }\n\n value = qp.route.serializeQueryParam(value, qp.urlKey, qp.type);\n } else {\n value = qp.svalue;\n }\n\n if (stripDefaultValues && value === qp.sdef) {\n continue;\n }\n\n paramsForRecognizer[qp.urlKey] = value;\n }\n\n return paramsForRecognizer;\n }\n\n function routeArgsWithoutDefaultQueryParams(linkView) {\n var routeArgs = linkView.get('routeArgs');\n\n if (!routeArgs[routeArgs.length-1].queryParams) {\n return routeArgs;\n }\n\n routeArgs = routeArgs.slice();\n routeArgs[routeArgs.length-1] = {\n queryParams: computeQueryParams(linkView, true)\n };\n return routeArgs;\n }\n\n function getResolvedPaths(options) {\n\n var types = options.options.types,\n data = options.options.data;\n\n return resolvePaths(options.context, options.params, { types: types, data: data });\n }\n\n /**\n `Ember.LinkView` renders an element whose `click` event triggers a\n transition of the application's instance of `Ember.Router` to\n a supplied route by name.\n\n Instances of `LinkView` will most likely be created through\n the `link-to` Handlebars helper, but properties of this class\n can be overridden to customize application-wide behavior.\n\n @class LinkView\n @namespace Ember\n @extends Ember.View\n @see {Handlebars.helpers.link-to}\n **/\n var LinkView = Ember.LinkView = EmberView.extend({\n tagName: 'a',\n currentWhen: null,\n\n /**\n Sets the `title` attribute of the `LinkView`'s HTML element.\n\n @property title\n @default null\n **/\n title: null,\n\n /**\n Sets the `rel` attribute of the `LinkView`'s HTML element.\n\n @property rel\n @default null\n **/\n rel: null,\n\n /**\n The CSS class to apply to `LinkView`'s element when its `active`\n property is `true`.\n\n @property activeClass\n @type String\n @default active\n **/\n activeClass: 'active',\n\n /**\n The CSS class to apply to `LinkView`'s element when its `loading`\n property is `true`.\n\n @property loadingClass\n @type String\n @default loading\n **/\n loadingClass: 'loading',\n\n /**\n The CSS class to apply to a `LinkView`'s element when its `disabled`\n property is `true`.\n\n @property disabledClass\n @type String\n @default disabled\n **/\n disabledClass: 'disabled',\n _isDisabled: false,\n\n /**\n Determines whether the `LinkView` will trigger routing via\n the `replaceWith` routing strategy.\n\n @property replace\n @type Boolean\n @default false\n **/\n replace: false,\n\n /**\n By default the `{{link-to}}` helper will bind to the `href` and\n `title` attributes. It's discourage that you override these defaults,\n however you can push onto the array if needed.\n\n @property attributeBindings\n @type Array | String\n @default ['href', 'title', 'rel']\n **/\n attributeBindings: ['href', 'title', 'rel'],\n\n /**\n By default the `{{link-to}}` helper will bind to the `active`, `loading`, and\n `disabled` classes. It is discouraged to override these directly.\n\n @property classNameBindings\n @type Array\n @default ['active', 'loading', 'disabled']\n **/\n classNameBindings: ['active', 'loading', 'disabled'],\n\n /**\n By default the `{{link-to}}` helper responds to the `click` event. You\n can override this globally by setting this property to your custom\n event name.\n\n This is particularly useful on mobile when one wants to avoid the 300ms\n click delay using some sort of custom `tap` event.\n\n @property eventName\n @type String\n @default click\n */\n eventName: 'click',\n\n // this is doc'ed here so it shows up in the events\n // section of the API documentation, which is where\n // people will likely go looking for it.\n /**\n Triggers the `LinkView`'s routing behavior. If\n `eventName` is changed to a value other than `click`\n the routing behavior will trigger on that custom event\n instead.\n\n @event click\n **/\n\n /**\n An overridable method called when LinkView objects are instantiated.\n\n Example:\n\n ```javascript\n App.MyLinkView = Ember.LinkView.extend({\n init: function() {\n this._super();\n Ember.Logger.log('Event is ' + this.get('eventName'));\n }\n });\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n @method init\n */\n init: function() {\n this._super.apply(this, arguments);\n\n // Map desired event name to invoke function\n var eventName = get(this, 'eventName');\n this.on(eventName, this, this._invoke);\n },\n\n /**\n This method is invoked by observers installed during `init` that fire\n whenever the params change\n\n @private\n @method _paramsChanged\n @since 1.3.0\n */\n _paramsChanged: function() {\n this.notifyPropertyChange('resolvedParams');\n },\n\n /**\n This is called to setup observers that will trigger a rerender.\n\n @private\n @method _setupPathObservers\n @since 1.3.0\n **/\n _setupPathObservers: function(){\n var helperParameters = this.parameters,\n linkTextPath = helperParameters.options.linkTextPath,\n paths = getResolvedPaths(helperParameters),\n length = paths.length,\n path, i, normalizedPath;\n\n if (linkTextPath) {\n normalizedPath = EmberHandlebars.normalizePath(helperParameters.context, linkTextPath, helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this.rerender);\n }\n\n for(i=0; i < length; i++) {\n path = paths[i];\n if (null === path) {\n // A literal value was provided, not a path, so nothing to observe.\n continue;\n }\n\n normalizedPath = EmberHandlebars.normalizePath(helperParameters.context, path, helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this._paramsChanged);\n }\n\n var queryParamsObject = this.queryParamsObject;\n if (queryParamsObject) {\n var values = queryParamsObject.values;\n\n // Install observers for all of the hash options\n // provided in the (query-params) subexpression.\n for (var k in values) {\n if (!values.hasOwnProperty(k)) { continue; }\n\n if (queryParamsObject.types[k] === 'ID') {\n normalizedPath = EmberHandlebars.normalizePath(helperParameters.context, values[k], helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this._paramsChanged);\n }\n }\n }\n },\n\n afterRender: function(){\n this._super.apply(this, arguments);\n this._setupPathObservers();\n },\n\n /**\n Even though this isn't a virtual view, we want to treat it as if it is\n so that you can access the parent with {{view.prop}}\n\n @private\n @method concreteView\n **/\n concreteView: computed(function() {\n return get(this, 'parentView');\n }).property('parentView'),\n\n /**\n\n Accessed as a classname binding to apply the `LinkView`'s `disabledClass`\n CSS `class` to the element when the link is disabled.\n\n When `true` interactions with the element will not trigger route changes.\n @property disabled\n */\n disabled: computed(function computeLinkViewDisabled(key, value) {\n if (value !== undefined) { this.set('_isDisabled', value); }\n\n return value ? get(this, 'disabledClass') : false;\n }),\n\n /**\n Accessed as a classname binding to apply the `LinkView`'s `activeClass`\n CSS `class` to the element when the link is active.\n\n A `LinkView` is considered active when its `currentWhen` property is `true`\n or the application's current route is the route the `LinkView` would trigger\n transitions into.\n\n @property active\n **/\n active: computed(function computeLinkViewActive() {\n if (get(this, 'loading')) { return false; }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs'),\n contexts = routeArgs.slice(1),\n resolvedParams = get(this, 'resolvedParams'),\n currentWhen = this.currentWhen || routeArgs[0],\n maximumContexts = numberOfContextsAcceptedByHandler(currentWhen, router.router.recognizer.handlersFor(currentWhen));\n\n // if we don't have enough contexts revert back to full route name\n // this is because the leaf route will use one of the contexts\n if (contexts.length > maximumContexts)\n currentWhen = routeArgs[0];\n\n var isActive = router.isActive.apply(router, [currentWhen].concat(contexts));\n\n if (isActive) { return get(this, 'activeClass'); }\n }).property('resolvedParams', 'routeArgs'),\n\n /**\n Accessed as a classname binding to apply the `LinkView`'s `loadingClass`\n CSS `class` to the element when the link is loading.\n\n A `LinkView` is considered loading when it has at least one\n parameter whose value is currently null or undefined. During\n this time, clicking the link will perform no transition and\n emit a warning that the link is still in a loading state.\n\n @property loading\n **/\n loading: computed(function computeLinkViewLoading() {\n if (!get(this, 'routeArgs')) { return get(this, 'loadingClass'); }\n }).property('routeArgs'),\n\n /**\n Returns the application's main router from the container.\n\n @private\n @property router\n **/\n router: computed(function() {\n return get(this, 'controller').container.lookup('router:main');\n }),\n\n /**\n Event handler that invokes the link, activating the associated route.\n\n @private\n @method _invoke\n @param {Event} event\n */\n _invoke: function(event) {\n if (!isSimpleClick(event)) { return true; }\n\n if (this.preventDefault !== false) { event.preventDefault(); }\n if (this.bubbles === false) { event.stopPropagation(); }\n\n if (get(this, '_isDisabled')) { return false; }\n\n if (get(this, 'loading')) {\n Ember.Logger.warn(\"This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.\");\n return false;\n }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs');\n\n var transition;\n if (get(this, 'replace')) {\n transition = router.replaceWith.apply(router, routeArgs);\n } else {\n transition = router.transitionTo.apply(router, routeArgs);\n }\n\n // Schedule eager URL update, but after we've given the transition\n // a chance to synchronously redirect.\n // We need to always generate the URL instead of using the href because\n // the href will include any rootURL set, but the router expects a URL\n // without it! Note that we don't use the first level router because it\n // calls location.formatURL(), which also would add the rootURL!\n var url = router.router.generate.apply(router.router, routeArgsWithoutDefaultQueryParams(this));\n run.scheduleOnce('routerTransitions', this, this._eagerUpdateUrl, transition, url);\n },\n\n /**\n @private\n @method _eagerUpdateUrl\n @param transition\n @param href\n */\n _eagerUpdateUrl: function(transition, href) {\n if (!transition.isActive || !transition.urlMethod) {\n // transition was aborted, already ran to completion,\n // or it has a null url-updated method.\n return;\n }\n\n if (href.indexOf('#') === 0) {\n href = href.slice(1);\n }\n\n // Re-use the routerjs hooks set up by the Ember router.\n var routerjs = get(this, 'router.router');\n if (transition.urlMethod === 'update') {\n routerjs.updateURL(href);\n } else if (transition.urlMethod === 'replace') {\n routerjs.replaceURL(href);\n }\n\n // Prevent later update url refire.\n transition.method(null);\n },\n\n /**\n Computed property that returns an array of the\n resolved parameters passed to the `link-to` helper,\n e.g.:\n\n ```hbs\n {{link-to a b '123' c}}\n ```\n\n will generate a `resolvedParams` of:\n\n ```js\n [aObject, bObject, '123', cObject]\n ```\n\n @private\n @property\n @return {Array}\n */\n resolvedParams: computed(function() {\n var parameters = this.parameters,\n options = parameters.options,\n types = options.types,\n data = options.data;\n\n if (parameters.params.length === 0) {\n var appController = this.container.lookup('controller:application');\n return [get(appController, 'currentRouteName')];\n } else {\n return resolveParams(parameters.context, parameters.params, { types: types, data: data });\n }\n }).property('router.url'),\n\n /**\n Computed property that returns the current route name and\n any dynamic segments.\n\n @private\n @property\n @return {Array} An array with the route name and any dynamic segments\n */\n routeArgs: computed(function computeLinkViewRouteArgs() {\n var resolvedParams = get(this, 'resolvedParams').slice(0),\n router = get(this, 'router'),\n namedRoute = resolvedParams[0];\n\n if (!namedRoute) { return; }\n\n Ember.assert(fmt(\"The attempt to link-to route '%@' failed. \" +\n \"The router did not find '%@' in its possible routes: '%@'\",\n [namedRoute, namedRoute, keys(router.router.recognizer.names).join(\"', '\")]),\n router.hasRoute(namedRoute));\n\n //normalize route name\n var handlers = router.router.recognizer.handlersFor(namedRoute);\n var normalizedPath = handlers[handlers.length - 1].handler;\n if (namedRoute !== normalizedPath) {\n //set namedRoute as currentWhen only when currentWhen is not given explicitly\n if (!this.currentWhen) {\n this.set('currentWhen', namedRoute);\n }\n namedRoute = handlers[handlers.length - 1].handler;\n resolvedParams[0] = namedRoute;\n }\n\n for (var i = 1, len = resolvedParams.length; i < len; ++i) {\n var param = resolvedParams[i];\n if (param === null || typeof param === 'undefined') {\n // If contexts aren't present, consider the linkView unloaded.\n return;\n }\n }\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n resolvedParams.push({ queryParams: get(this, 'queryParams') });\n }\n\n return resolvedParams;\n }).property('resolvedParams', 'queryParams'),\n\n queryParamsObject: null,\n queryParams: computed(function computeLinkViewQueryParams() {\n return computeQueryParams(this, false);\n }).property('resolvedParams.[]'),\n\n /**\n Sets the element's `href` attribute to the url for\n the `LinkView`'s targeted route.\n\n If the `LinkView`'s `tagName` is changed to a value other\n than `a`, this property will be ignored.\n\n @property href\n **/\n href: computed(function computeLinkViewHref() {\n if (get(this, 'tagName') !== 'a') { return; }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs');\n\n if (!routeArgs) {\n return get(this, 'loadingHref');\n }\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n routeArgs = routeArgsWithoutDefaultQueryParams(this);\n }\n\n return router.generate.apply(router, routeArgs);\n }).property('routeArgs'),\n\n /**\n The default href value to use while a link-to is loading.\n Only applies when tagName is 'a'\n\n @property loadingHref\n @type String\n @default #\n */\n loadingHref: '#'\n });\n\n LinkView.toString = function() { return \"LinkView\"; };\n\n /**\n The `{{link-to}}` helper renders a link to the supplied\n `routeName` passing an optionally supplied model to the\n route as its `model` context of the route. The block\n for `{{link-to}}` becomes the innerHTML of the rendered\n element:\n\n ```handlebars\n {{#link-to 'photoGallery'}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos\">\n Great Hamster Photos\n </a>\n ```\n\n ### Supplying a tagName\n By default `{{link-to}}` renders an `<a>` element. This can\n be overridden for a single use of `{{link-to}}` by supplying\n a `tagName` option:\n\n ```handlebars\n {{#link-to 'photoGallery' tagName=\"li\"}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n ```html\n <li>\n Great Hamster Photos\n </li>\n ```\n\n To override this option for your entire application, see\n \"Overriding Application-wide Defaults\".\n\n ### Disabling the `link-to` helper\n By default `{{link-to}}` is enabled.\n any passed value to `disabled` helper property will disable the `link-to` helper.\n\n static use: the `disabled` option:\n\n ```handlebars\n {{#link-to 'photoGallery' disabled=true}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n dynamic use: the `disabledWhen` option:\n\n ```handlebars\n {{#link-to 'photoGallery' disabledWhen=controller.someProperty}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n any passed value to `disabled` will disable it except `undefined`.\n to ensure that only `true` disable the `link-to` helper you can\n override the global behaviour of `Ember.LinkView`.\n\n ```javascript\n Ember.LinkView.reopen({\n disabled: Ember.computed(function(key, value) {\n if (value !== undefined) {\n this.set('_isDisabled', value === true);\n }\n return value === true ? get(this, 'disabledClass') : false;\n })\n });\n ```\n\n see \"Overriding Application-wide Defaults\" for more.\n\n ### Handling `href`\n `{{link-to}}` will use your application's Router to\n fill the element's `href` property with a url that\n matches the path to the supplied `routeName` for your\n routers's configured `Location` scheme, which defaults\n to Ember.HashLocation.\n\n ### Handling current route\n `{{link-to}}` will apply a CSS class name of 'active'\n when the application's current route matches\n the supplied routeName. For example, if the application's\n current route is 'photoGallery.recent' the following\n use of `{{link-to}}`:\n\n ```handlebars\n {{#link-to 'photoGallery.recent'}}\n Great Hamster Photos from the last week\n {{/link-to}}\n ```\n\n will result in\n\n ```html\n <a href=\"/hamster-photos/this-week\" class=\"active\">\n Great Hamster Photos\n </a>\n ```\n\n The CSS class name used for active classes can be customized\n for a single use of `{{link-to}}` by passing an `activeClass`\n option:\n\n ```handlebars\n {{#link-to 'photoGallery.recent' activeClass=\"current-url\"}}\n Great Hamster Photos from the last week\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/this-week\" class=\"current-url\">\n Great Hamster Photos\n </a>\n ```\n\n To override this option for your entire application, see\n \"Overriding Application-wide Defaults\".\n\n ### Supplying a model\n An optional model argument can be used for routes whose\n paths contain dynamic segments. This argument will become\n the model context of the linked route:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n });\n ```\n\n ```handlebars\n {{#link-to 'photoGallery' aPhoto}}\n {{aPhoto.title}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42\">\n Tomster\n </a>\n ```\n\n ### Supplying multiple models\n For deep-linking to route paths that contain multiple\n dynamic segments, multiple model arguments can be used.\n As the router transitions through the route path, each\n supplied model argument will become the context for the\n route with the dynamic segments:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"}, function() {\n this.route(\"comment\", {path: \"comments/:comment_id\"});\n });\n });\n ```\n This argument will become the model context of the linked route:\n\n ```handlebars\n {{#link-to 'photoGallery.comment' aPhoto comment}}\n {{comment.body}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42/comment/718\">\n A+++ would snuggle again.\n </a>\n ```\n\n ### Supplying an explicit dynamic segment value\n If you don't have a model object available to pass to `{{link-to}}`,\n an optional string or integer argument can be passed for routes whose\n paths contain dynamic segments. This argument will become the value\n of the dynamic segment:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n });\n ```\n\n ```handlebars\n {{#link-to 'photoGallery' aPhotoId}}\n {{aPhoto.title}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42\">\n Tomster\n </a>\n ```\n\n When transitioning into the linked route, the `model` hook will\n be triggered with parameters including this passed identifier.\n\n ### Allowing Default Action\n\n By default the `{{link-to}}` helper prevents the default browser action\n by calling `preventDefault()` as this sort of action bubbling is normally\n handled internally and we do not want to take the browser to a new URL (for\n example).\n\n If you need to override this behavior specify `preventDefault=false` in\n your template:\n\n ```handlebars\n {{#link-to 'photoGallery' aPhotoId preventDefault=false}}\n {{aPhotoId.title}}\n {{/link-to}}\n ```\n\n ### Overriding attributes\n You can override any given property of the Ember.LinkView\n that is generated by the `{{link-to}}` helper by passing\n key/value pairs, like so:\n\n ```handlebars\n {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames='pic sweet'}}\n Uh-mazing!\n {{/link-to}}\n ```\n\n See [Ember.LinkView](/api/classes/Ember.LinkView.html) for a\n complete list of overrideable properties. Be sure to also\n check out inherited properties of `LinkView`.\n\n ### Overriding Application-wide Defaults\n ``{{link-to}}`` creates an instance of Ember.LinkView\n for rendering. To override options for your entire\n application, reopen Ember.LinkView and supply the\n desired values:\n\n ``` javascript\n Ember.LinkView.reopen({\n activeClass: \"is-active\",\n tagName: 'li'\n })\n ```\n\n It is also possible to override the default event in\n this manner:\n\n ``` javascript\n Ember.LinkView.reopen({\n eventName: 'customEventName'\n });\n ```\n\n @method link-to\n @for Ember.Handlebars.helpers\n @param {String} routeName\n @param {Object} [context]*\n @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkView\n @return {String} HTML string\n @see {Ember.LinkView}\n */\n function linkToHelper(name) {\n var options = slice.call(arguments, -1)[0],\n params = slice.call(arguments, 0, -1),\n hash = options.hash;\n\n if (params[params.length - 1] instanceof QueryParams) {\n hash.queryParamsObject = params.pop();\n }\n\n hash.disabledBinding = hash.disabledWhen;\n\n if (!options.fn) {\n var linkTitle = params.shift();\n var linkType = options.types.shift();\n var context = this;\n if (linkType === 'ID') {\n options.linkTextPath = linkTitle;\n options.fn = function() {\n return EmberHandlebars.getEscaped(context, linkTitle, options);\n };\n } else {\n options.fn = function() {\n return linkTitle;\n };\n }\n }\n\n hash.parameters = {\n context: this,\n options: options,\n params: params\n };\n\n options.helperName = options.helperName || 'link-to';\n\n return viewHelper.call(this, LinkView, options);\n };\n\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n EmberHandlebars.registerHelper('query-params', function queryParamsHelper(options) {\n Ember.assert(fmt(\"The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName='%@') as opposed to just (query-params '%@')\", [options, options]), arguments.length === 1);\n\n return QueryParams.create({\n values: options.hash,\n types: options.hashTypes\n });\n });\n }\n\n /**\n See [link-to](/api/classes/Ember.Handlebars.helpers.html#method_link-to)\n\n @method linkTo\n @for Ember.Handlebars.helpers\n @deprecated\n @param {String} routeName\n @param {Object} [context]*\n @return {String} HTML string\n */\n function deprecatedLinkToHelper() {\n Ember.warn(\"The 'linkTo' view helper is deprecated in favor of 'link-to'\");\n return linkToHelper.apply(this, arguments);\n };\n\n __exports__.LinkView = LinkView;\n __exports__.deprecatedLinkToHelper = deprecatedLinkToHelper;\n __exports__.linkToHelper = linkToHelper;\n });\ndefine(\"ember-routing/helpers/outlet\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/lazy_load\",\"ember-views/views/container_view\",\"ember-handlebars/views/metamorph_view\",\"ember-handlebars/helpers/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var onLoad = __dependency4__.onLoad;\n var ContainerView = __dependency5__[\"default\"];\n var _Metamorph = __dependency6__._Metamorph;\n var viewHelper = __dependency7__.viewHelper;\n\n // requireModule('ember-handlebars');\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var OutletView = ContainerView.extend(_Metamorph);\n\n /**\n The `outlet` helper is a placeholder that the router will fill in with\n the appropriate template based on the current state of the application.\n\n ``` handlebars\n {{outlet}}\n ```\n\n By default, a template based on Ember's naming conventions will be rendered\n into the `outlet` (e.g. `App.PostsRoute` will render the `posts` template).\n\n You can render a different template by using the `render()` method in the\n route's `renderTemplate` hook. The following will render the `favoritePost`\n template into the `outlet`.\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost');\n }\n });\n ```\n\n You can create custom named outlets for more control.\n\n ``` handlebars\n {{outlet 'favoritePost'}}\n {{outlet 'posts'}}\n ```\n\n Then you can define what template is rendered into each outlet in your\n route.\n\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost', { outlet: 'favoritePost' });\n this.render('posts', { outlet: 'posts' });\n }\n });\n ```\n\n You can specify the view that the outlet uses to contain and manage the\n templates rendered into it.\n\n ``` handlebars\n {{outlet view='sectionContainer'}}\n ```\n\n ``` javascript\n App.SectionContainer = Ember.ContainerView.extend({\n tagName: 'section',\n classNames: ['special']\n });\n ```\n\n @method outlet\n @for Ember.Handlebars.helpers\n @param {String} property the property on the controller\n that holds the view for this outlet\n @return {String} HTML string\n */\n function outletHelper(property, options) {\n\n var outletSource,\n container,\n viewName,\n viewClass,\n viewFullName;\n\n if (property && property.data && property.data.isRenderData) {\n options = property;\n property = 'main';\n }\n\n container = options.data.view.container;\n\n outletSource = options.data.view;\n while (!outletSource.get('template.isTop')) {\n outletSource = outletSource.get('_parentView');\n }\n\n // provide controller override\n viewName = options.hash.view;\n\n if (viewName) {\n viewFullName = 'view:' + viewName;\n Ember.assert(\"Using a quoteless view parameter with {{outlet}} is not supported. Please update to quoted usage '{{outlet \\\"\" + viewName + \"\\\"}}.\", options.hashTypes.view !== 'ID');\n Ember.assert(\"The view name you supplied '\" + viewName + \"' did not resolve to a view.\", container.has(viewFullName));\n }\n\n viewClass = viewName ? container.lookupFactory(viewFullName) : options.hash.viewClass || OutletView;\n\n options.data.view.set('outletSource', outletSource);\n options.hash.currentViewBinding = '_view.outletSource._outlets.' + property;\n\n options.helperName = options.helperName || 'outlet';\n\n return viewHelper.call(this, viewClass, options);\n };\n\n __exports__.outletHelper = outletHelper;\n __exports__.OutletView = OutletView;\n });\ndefine(\"ember-routing/helpers/render\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/string\",\"ember-routing/system/controller_for\",\"ember-handlebars/ext\",\"ember-handlebars/helpers/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // assert, deprecate\n var EmberError = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var camelize = __dependency5__.camelize;\n var generateControllerFactory = __dependency6__.generateControllerFactory;\n var generateController = __dependency6__.generateController;\n var handlebarsGet = __dependency7__.handlebarsGet;\n var viewHelper = __dependency8__.viewHelper;\n\n\n // requireModule('ember-handlebars');\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n Calling ``{{render}}`` from within a template will insert another\n template that matches the provided name. The inserted template will\n access its properties on its own controller (rather than the controller\n of the parent template).\n\n If a view class with the same name exists, the view class also will be used.\n\n Note: A given controller may only be used *once* in your app in this manner.\n A singleton instance of the controller will be created for you.\n\n Example:\n\n ```javascript\n App.NavigationController = Ember.Controller.extend({\n who: \"world\"\n });\n ```\n\n ```handlebars\n <!-- navigation.hbs -->\n Hello, {{who}}.\n ```\n\n ```handelbars\n <!-- application.hbs -->\n <h1>My great app</h1>\n {{render \"navigation\"}}\n ```\n\n ```html\n <h1>My great app</h1>\n <div class='ember-view'>\n Hello, world.\n </div>\n ```\n\n Optionally you may provide a second argument: a property path\n that will be bound to the `model` property of the controller.\n\n If a `model` property path is specified, then a new instance of the\n controller will be created and `{{render}}` can be used multiple times\n with the same name.\n\n For example if you had this `author` template.\n\n ```handlebars\n <div class=\"author\">\n Written by {{firstName}} {{lastName}}.\n Total Posts: {{postCount}}\n </div>\n ```\n\n You could render it inside the `post` template using the `render` helper.\n\n ```handlebars\n <div class=\"post\">\n <h1>{{title}}</h1>\n <div>{{body}}</div>\n {{render \"author\" author}}\n </div>\n ```\n\n @method render\n @for Ember.Handlebars.helpers\n @param {String} name\n @param {Object?} contextString\n @param {Hash} options\n @return {String} HTML string\n */\n function renderHelper(name, contextString, options) {\n var length = arguments.length;\n\n var contextProvided = length === 3,\n container, router, controller, view, context, lookupOptions;\n\n container = (options || contextString).data.keywords.controller.container;\n router = container.lookup('router:main');\n\n if (length === 2) {\n // use the singleton controller\n options = contextString;\n contextString = undefined;\n Ember.assert(\"You can only use the {{render}} helper once without a model object as its second argument, as in {{render \\\"post\\\" post}}.\", !router || !router._lookupActiveView(name));\n } else if (length === 3) {\n // create a new controller\n context = handlebarsGet(options.contexts[1], contextString, options);\n } else {\n throw EmberError(\"You must pass a templateName to render\");\n }\n\n Ember.deprecate(\"Using a quoteless parameter with {{render}} is deprecated. Please update to quoted usage '{{render \\\"\" + name + \"\\\"}}.\", options.types[0] !== 'ID');\n\n // # legacy namespace\n name = name.replace(/\\//g, '.');\n // \\ legacy slash as namespace support\n\n\n view = container.lookup('view:' + name) || container.lookup('view:default');\n\n // provide controller override\n var controllerName = options.hash.controller || name;\n var controllerFullName = 'controller:' + controllerName;\n\n if (options.hash.controller) {\n Ember.assert(\"The controller name you supplied '\" + controllerName + \"' did not resolve to a controller.\", container.has(controllerFullName));\n }\n\n var parentController = options.data.keywords.controller;\n\n // choose name\n if (length > 2) {\n var factory = container.lookupFactory(controllerFullName) ||\n generateControllerFactory(container, controllerName, context);\n\n controller = factory.create({\n model: context,\n parentController: parentController,\n target: parentController\n });\n\n view.one('willDestroyElement', function() {\n controller.destroy();\n });\n } else {\n controller = container.lookup(controllerFullName) ||\n generateController(container, controllerName);\n\n controller.setProperties({\n target: parentController,\n parentController: parentController\n });\n }\n\n var root = options.contexts[1];\n\n if (root) {\n view.registerObserver(root, contextString, function() {\n controller.set('model', handlebarsGet(root, contextString, options));\n });\n }\n\n options.hash.viewName = camelize(name);\n\n var templateName = 'template:' + name;\n Ember.assert(\"You used `{{render '\" + name + \"'}}`, but '\" + name + \"' can not be found as either a template or a view.\", container.has(\"view:\" + name) || container.has(templateName) || options.fn);\n options.hash.template = container.lookup(templateName);\n\n options.hash.controller = controller;\n\n if (router && !context) {\n router._connectActiveView(name, view);\n }\n\n options.helperName = options.helperName || ('render \"' + name + '\"');\n\n viewHelper.call(this, view, options);\n };\n\n __exports__[\"default\"] = renderHelper;\n });\ndefine(\"ember-routing/helpers/shared\",\n [\"ember-metal/property_get\",\"ember-metal/array\",\"ember-runtime/system/lazy_load\",\"ember-runtime/controllers/controller\",\"ember-routing/system/router\",\"ember-handlebars/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var map = __dependency2__.map;\n var onLoad = __dependency3__.onLoad;\n var ControllerMixin = __dependency4__.ControllerMixin;\n var EmberRouter = __dependency5__[\"default\"];\n var handlebarsResolve = __dependency6__.resolveParams;\n var handlebarsGet = __dependency6__.handlebarsGet;\n\n function resolveParams(context, params, options) {\n return map.call(resolvePaths(context, params, options), function(path, i) {\n if (null === path) {\n // Param was string/number, not a path, so just return raw string/number.\n return params[i];\n } else {\n return handlebarsGet(context, path, options);\n }\n });\n }\n\n function resolvePaths(context, params, options) {\n var resolved = handlebarsResolve(context, params, options),\n types = options.types;\n\n return map.call(resolved, function(object, i) {\n if (types[i] === 'ID') {\n return unwrap(object, params[i]);\n } else {\n return null;\n }\n });\n\n function unwrap(object, path) {\n if (path === 'controller') { return path; }\n\n if (ControllerMixin.detect(object)) {\n return unwrap(get(object, 'model'), path ? path + '.model' : 'model');\n } else {\n return path;\n }\n }\n }\n\n __exports__.resolveParams = resolveParams;\n __exports__.resolvePaths = resolvePaths;\n });\ndefine(\"ember-routing/location/api\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // deprecate, assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n ## Implementations\n\n You can pass an implementation name (`hash`, `history`, `none`) to force a\n particular implementation to be used in your application.\n\n ### HashLocation\n\n Using `HashLocation` results in URLs with a `#` (hash sign) separating the\n server side URL portion of the URL from the portion that is used by Ember.\n This relies upon the `hashchange` event existing in the browser.\n\n Example:\n\n ```javascript\n App.Router.map(function() {\n this.resource('posts', function() {\n this.route('new');\n });\n });\n\n App.Router.reopen({\n location: 'hash'\n });\n ```\n\n This will result in a posts.new url of `/#/posts/new`.\n\n ### HistoryLocation\n\n Using `HistoryLocation` results in URLs that are indistinguishable from a\n standard URL. This relies upon the browser's `history` API.\n\n Example:\n\n ```javascript\n App.Router.map(function() {\n this.resource('posts', function() {\n this.route('new');\n });\n });\n\n App.Router.reopen({\n location: 'history'\n });\n ```\n\n This will result in a posts.new url of `/posts/new`.\n\n Keep in mind that your server must serve the Ember app at all the routes you\n define.\n\n ### AutoLocation\n\n Using `AutoLocation`, the router will use the best Location class supported by\n the browser it is running in.\n\n Browsers that support the `history` API will use `HistoryLocation`, those that\n do not, but still support the `hashchange` event will use `HashLocation`, and\n in the rare case neither is supported will use `NoneLocation`.\n\n Example:\n\n ```javascript\n App.Router.map(function() {\n this.resource('posts', function() {\n this.route('new');\n });\n });\n\n App.Router.reopen({\n location: 'auto'\n });\n ```\n\n This will result in a posts.new url of `/posts/new` for modern browsers that\n support the `history` api or `/#/posts/new` for older ones, like Internet\n Explorer 9 and below.\n\n When a user visits a link to your application, they will be automatically\n upgraded or downgraded to the appropriate `Location` class, with the URL\n transformed accordingly, if needed.\n\n Keep in mind that since some of your users will use `HistoryLocation`, your\n server must serve the Ember app at all the routes you define.\n\n ### NoneLocation\n\n Using `NoneLocation` causes Ember to not store the applications URL state\n in the actual URL. This is generally used for testing purposes, and is one\n of the changes made when calling `App.setupForTesting()`.\n\n ## Location API\n\n Each location implementation must provide the following methods:\n\n * implementation: returns the string name used to reference the implementation.\n * getURL: returns the current URL.\n * setURL(path): sets the current URL.\n * replaceURL(path): replace the current URL (optional).\n * onUpdateURL(callback): triggers the callback when the URL changes.\n * formatURL(url): formats `url` to be placed into `href` attribute.\n\n Calling setURL or replaceURL will not trigger onUpdateURL callbacks.\n\n @class Location\n @namespace Ember\n @static\n */\n var EmberLocation = {\n /**\n This is deprecated in favor of using the container to lookup the location\n implementation as desired.\n\n For example:\n\n ```javascript\n // Given a location registered as follows:\n container.register('location:history-test', HistoryTestLocation);\n\n // You could create a new instance via:\n container.lookup('location:history-test');\n ```\n\n @method create\n @param {Object} options\n @return {Object} an instance of an implementation of the `location` API\n @deprecated Use the container to lookup the location implementation that you\n need.\n */\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n /**\n This is deprecated in favor of using the container to register the\n location implementation as desired.\n\n Example:\n\n ```javascript\n Application.initializer({\n name: \"history-test-location\",\n\n initialize: function(container, application) {\n application.register('location:history-test', HistoryTestLocation);\n }\n });\n ```\n\n @method registerImplementation\n @param {String} name\n @param {Object} implementation of the `location` API\n @deprecated Register your custom location implementation with the\n container directly.\n */\n registerImplementation: function(name, implementation) {\n Ember.deprecate('Using the Ember.Location.registerImplementation is no longer supported. Register your custom location implementation with the container instead.', false);\n\n this.implementations[name] = implementation;\n },\n\n implementations: {},\n _location: window.location,\n\n /**\n Returns the current `location.hash` by parsing location.href since browsers\n inconsistently URL-decode `location.hash`.\n\n https://bugzilla.mozilla.org/show_bug.cgi?id=483304\n\n @private\n @method getHash\n @since 1.4.0\n */\n _getHash: function () {\n // AutoLocation has it at _location, HashLocation at .location.\n // Being nice and not changing\n var href = (this._location || this.location).href,\n hashIndex = href.indexOf('#');\n\n if (hashIndex === -1) {\n return '';\n } else {\n return href.substr(hashIndex);\n }\n }\n };\n\n __exports__[\"default\"] = EmberLocation;\n });\ndefine(\"ember-routing/location/auto_location\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-routing/location/api\",\"ember-routing/location/history_location\",\"ember-routing/location/hash_location\",\"ember-routing/location/none_location\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n\n var EmberLocation = __dependency4__[\"default\"];\n var HistoryLocation = __dependency5__[\"default\"];\n var HashLocation = __dependency6__[\"default\"];\n var NoneLocation = __dependency7__[\"default\"];\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n Ember.AutoLocation will select the best location option based off browser\n support with the priority order: history, hash, none.\n\n Clean pushState paths accessed by hashchange-only browsers will be redirected\n to the hash-equivalent and vice versa so future transitions are consistent.\n\n Keep in mind that since some of your users will use `HistoryLocation`, your\n server must serve the Ember app at all the routes you define.\n\n @class AutoLocation\n @namespace Ember\n @static\n */\n var AutoLocation = {\n\n /**\n @private\n\n This property is used by router:main to know whether to cancel the routing\n setup process, which is needed while we redirect the browser.\n\n @since 1.5.1\n @property cancelRouterSetup\n @default false\n */\n cancelRouterSetup: false,\n\n /**\n @private\n\n Will be pre-pended to path upon state change.\n\n @since 1.5.1\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _window\n @default window\n */\n _window: window,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @property location\n @default window.location\n */\n _location: window.location,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _history\n @default window.history\n */\n _history: window.history,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _HistoryLocation\n @default Ember.HistoryLocation\n */\n _HistoryLocation: HistoryLocation,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _HashLocation\n @default Ember.HashLocation\n */\n _HashLocation: HashLocation,\n\n /**\n @private\n\n Attached for mocking in tests\n\n @since 1.5.1\n @property _NoneLocation\n @default Ember.NoneLocation\n */\n _NoneLocation: NoneLocation,\n\n /**\n @private\n\n Returns location.origin or builds it if device doesn't support it.\n\n @method _getOrigin\n */\n _getOrigin: function () {\n var location = this._location,\n origin = location.origin;\n\n // Older browsers, especially IE, don't have origin\n if (!origin) {\n origin = location.protocol + '//' + location.hostname;\n\n if (location.port) {\n origin += ':' + location.port;\n }\n }\n\n return origin;\n },\n\n /**\n @private\n\n We assume that if the history object has a pushState method, the host should\n support HistoryLocation.\n\n @method _getSupportsHistory\n */\n _getSupportsHistory: function () {\n // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n // The stock browser on Android 2.2 & 2.3 returns positive on history support\n // Unfortunately support is really buggy and there is no clean way to detect\n // these bugs, so we fall back to a user agent sniff :(\n var userAgent = this._window.navigator.userAgent;\n\n // We only want Android 2, stock browser, and not Chrome which identifies\n // itself as 'Mobile Safari' as well\n if (userAgent.indexOf('Android 2') !== -1 &&\n userAgent.indexOf('Mobile Safari') !== -1 &&\n userAgent.indexOf('Chrome') === -1) {\n return false;\n }\n\n return !!(this._history && 'pushState' in this._history);\n },\n\n /**\n @private\n\n IE8 running in IE7 compatibility mode gives false positive, so we must also\n check documentMode.\n\n @method _getSupportsHashChange\n */\n _getSupportsHashChange: function () {\n var _window = this._window,\n documentMode = _window.document.documentMode;\n\n return ('onhashchange' in _window && (documentMode === undefined || documentMode > 7 ));\n },\n\n /**\n @private\n\n Redirects the browser using location.replace, prepending the locatin.origin\n to prevent phishing attempts\n\n @method _replacePath\n */\n _replacePath: function (path) {\n this._location.replace(this._getOrigin() + path);\n },\n\n /**\n @since 1.5.1\n @private\n @method _getRootURL\n */\n _getRootURL: function () {\n return this.rootURL;\n },\n\n /**\n @private\n\n Returns the current `location.pathname`, normalized for IE inconsistencies.\n\n @method _getPath\n */\n _getPath: function () {\n var pathname = this._location.pathname;\n // Various versions of IE/Opera don't always return a leading slash\n if (pathname.charAt(0) !== '/') {\n pathname = '/' + pathname;\n }\n\n return pathname;\n },\n\n /**\n @private\n\n Returns normalized location.hash as an alias to Ember.Location._getHash\n\n @since 1.5.1\n @method _getHash\n */\n _getHash: EmberLocation._getHash,\n\n /**\n @private\n\n Returns location.search\n\n @since 1.5.1\n @method _getQuery\n */\n _getQuery: function () {\n return this._location.search;\n },\n\n /**\n @private\n\n Returns the full pathname including query and hash\n\n @method _getFullPath\n */\n _getFullPath: function () {\n return this._getPath() + this._getQuery() + this._getHash();\n },\n\n /**\n @private\n\n Returns the current path as it should appear for HistoryLocation supported\n browsers. This may very well differ from the real current path (e.g. if it\n starts off as a hashed URL)\n\n @method _getHistoryPath\n */\n _getHistoryPath: function () {\n var rootURL = this._getRootURL(),\n path = this._getPath(),\n hash = this._getHash(),\n query = this._getQuery(),\n rootURLIndex = path.indexOf(rootURL),\n routeHash, hashParts;\n\n Ember.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0);\n\n // By convention, Ember.js routes using HashLocation are required to start\n // with `#/`. Anything else should NOT be considered a route and should\n // be passed straight through, without transformation.\n if (hash.substr(0, 2) === '#/') {\n // There could be extra hash segments after the route\n hashParts = hash.substr(1).split('#');\n // The first one is always the route url\n routeHash = hashParts.shift();\n\n // If the path already has a trailing slash, remove the one\n // from the hashed route so we don't double up.\n if (path.slice(-1) === '/') {\n routeHash = routeHash.substr(1);\n }\n\n // This is the \"expected\" final order\n path += routeHash;\n path += query;\n\n if (hashParts.length) {\n path += '#' + hashParts.join('#');\n }\n } else {\n path += query;\n path += hash;\n }\n\n return path;\n },\n\n /**\n @private\n\n Returns the current path as it should appear for HashLocation supported\n browsers. This may very well differ from the real current path.\n\n @method _getHashPath\n */\n _getHashPath: function () {\n var rootURL = this._getRootURL(),\n path = rootURL,\n historyPath = this._getHistoryPath(),\n routePath = historyPath.substr(rootURL.length);\n\n if (routePath !== '') {\n if (routePath.charAt(0) !== '/') {\n routePath = '/' + routePath;\n }\n\n path += '#' + routePath;\n }\n\n return path;\n },\n\n /**\n Selects the best location option based off browser support and returns an\n instance of that Location class.\n\n @see Ember.AutoLocation\n @method create\n */\n create: function (options) {\n if (options && options.rootURL) {\n Ember.assert('rootURL must end with a trailing forward slash e.g. \"/app/\"', options.rootURL.charAt(options.rootURL.length-1) === '/');\n this.rootURL = options.rootURL;\n }\n\n var historyPath, hashPath,\n cancelRouterSetup = false,\n implementationClass = this._NoneLocation,\n currentPath = this._getFullPath();\n\n if (this._getSupportsHistory()) {\n historyPath = this._getHistoryPath();\n\n // Since we support history paths, let's be sure we're using them else\n // switch the location over to it.\n if (currentPath === historyPath) {\n implementationClass = this._HistoryLocation;\n } else {\n cancelRouterSetup = true;\n this._replacePath(historyPath);\n }\n\n } else if (this._getSupportsHashChange()) {\n hashPath = this._getHashPath();\n\n // Be sure we're using a hashed path, otherwise let's switch over it to so\n // we start off clean and consistent. We'll count an index path with no\n // hash as \"good enough\" as well.\n if (currentPath === hashPath || (currentPath === '/' && hashPath === '/#/')) {\n implementationClass = this._HashLocation;\n } else {\n // Our URL isn't in the expected hash-supported format, so we want to\n // cancel the router setup and replace the URL to start off clean\n cancelRouterSetup = true;\n this._replacePath(hashPath);\n }\n }\n\n var implementation = implementationClass.create.apply(implementationClass, arguments);\n\n if (cancelRouterSetup) {\n set(implementation, 'cancelRouterSetup', true);\n }\n\n return implementation;\n }\n };\n\n __exports__[\"default\"] = AutoLocation;\n });\ndefine(\"ember-routing/location/hash_location\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/run_loop\",\"ember-metal/utils\",\"ember-runtime/system/object\",\"ember-routing/location/api\",\"ember-views/system/jquery\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var run = __dependency3__[\"default\"];\n var guidFor = __dependency4__.guidFor;\n\n var EmberObject = __dependency5__[\"default\"];\n var EmberLocation = __dependency6__[\"default\"];\n var jQuery = __dependency7__[\"default\"];\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n `Ember.HashLocation` implements the location API using the browser's\n hash. At present, it relies on a `hashchange` event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n */\n var HashLocation = EmberObject.extend({\n implementation: 'hash',\n\n init: function() {\n set(this, 'location', get(this, '_location') || window.location);\n },\n\n /**\n @private\n\n Returns normalized location.hash\n\n @since 1.5.1\n @method getHash\n */\n getHash: EmberLocation._getHash,\n\n /**\n Returns the current `location.hash`, minus the '#' at the front.\n\n @private\n @method getURL\n */\n getURL: function() {\n return this.getHash().substr(1);\n },\n\n /**\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @private\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n Uses location.replace to update the url without a page reload\n or history modification.\n\n @private\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n get(this, 'location').replace('#' + path);\n set(this, 'lastSetURL', path);\n },\n\n /**\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @private\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = guidFor(this);\n\n jQuery(window).on('hashchange.ember-location-'+guid, function() {\n run(function() {\n var path = self.getURL();\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(path);\n });\n });\n },\n\n /**\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @private\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n /**\n Cleans up the HashLocation event listener.\n\n @private\n @method willDestroy\n */\n willDestroy: function() {\n var guid = guidFor(this);\n\n jQuery(window).off('hashchange.ember-location-'+guid);\n }\n });\n\n __exports__[\"default\"] = HashLocation;\n });\ndefine(\"ember-routing/location/history_location\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-runtime/system/object\",\"ember-views/system/jquery\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n\n var EmberObject = __dependency5__[\"default\"];\n var jQuery = __dependency6__[\"default\"];\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var popstateFired = false;\n var supportsHistoryState = window.history && 'state' in window.history;\n\n /**\n Ember.HistoryLocation implements the location API using the browser's\n history.pushState API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n */\n var HistoryLocation = EmberObject.extend({\n implementation: 'history',\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n set(this, 'baseURL', jQuery('base').attr('href') || '');\n },\n\n /**\n Used to set state on first call to setURL\n\n @private\n @method initState\n */\n initState: function() {\n set(this, 'history', get(this, 'history') || window.history);\n this.replaceState(this.formatURL(this.getURL()));\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n Returns the current `location.pathname` without `rootURL` or `baseURL`\n\n @private\n @method getURL\n @return url {String}\n */\n getURL: function() {\n var rootURL = get(this, 'rootURL'),\n location = get(this, 'location'),\n path = location.pathname,\n baseURL = get(this, 'baseURL');\n\n rootURL = rootURL.replace(/\\/$/, '');\n baseURL = baseURL.replace(/\\/$/, '');\n var url = path.replace(baseURL, '').replace(rootURL, '');\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n var search = location.search || '';\n url += search;\n }\n\n return url;\n },\n\n /**\n Uses `history.pushState` to update the url without a page reload.\n\n @private\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n var state = this.getState();\n path = this.formatURL(path);\n\n if (!state || state.path !== path) {\n this.pushState(path);\n }\n },\n\n /**\n Uses `history.replaceState` to update the url without a page reload\n or history modification.\n\n @private\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n var state = this.getState();\n path = this.formatURL(path);\n\n if (!state || state.path !== path) {\n this.replaceState(path);\n }\n },\n\n /**\n Get the current `history.state`. Checks for if a polyfill is\n required and if so fetches this._historyState. The state returned\n from getState may be null if an iframe has changed a window's\n history.\n\n @private\n @method getState\n @return state {Object}\n */\n getState: function() {\n return supportsHistoryState ? get(this, 'history').state : this._historyState;\n },\n\n /**\n Pushes a new state.\n\n @private\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n var state = { path: path };\n\n get(this, 'history').pushState(state, null, path);\n\n // store state if browser doesn't support `history.state`\n if (!supportsHistoryState) {\n this._historyState = state;\n }\n\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n Replaces the current state.\n\n @private\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n var state = { path: path };\n\n get(this, 'history').replaceState(state, null, path);\n\n // store state if browser doesn't support `history.state`\n if (!supportsHistoryState) {\n this._historyState = state;\n }\n\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @private\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = guidFor(this),\n self = this;\n\n jQuery(window).on('popstate.ember-location-'+guid, function(e) {\n // Ignore initial page load popstate event in Chrome\n if (!popstateFired) {\n popstateFired = true;\n if (self.getURL() === self._previousURL) { return; }\n }\n callback(self.getURL());\n });\n },\n\n /**\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @private\n @method formatURL\n @param url {String}\n @return formatted url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL'),\n baseURL = get(this, 'baseURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n baseURL = baseURL.replace(/\\/$/, '');\n } else if(baseURL.match(/^\\//) && rootURL.match(/^\\//)) {\n baseURL = baseURL.replace(/\\/$/, '');\n }\n\n return baseURL + rootURL + url;\n },\n\n /**\n Cleans up the HistoryLocation event listener.\n\n @private\n @method willDestroy\n */\n willDestroy: function() {\n var guid = guidFor(this);\n\n jQuery(window).off('popstate.ember-location-'+guid);\n }\n });\n\n __exports__[\"default\"] = HistoryLocation;\n });\ndefine(\"ember-routing/location/none_location\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var EmberObject = __dependency3__[\"default\"];\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n Ember.NoneLocation does not interact with the browser. It is useful for\n testing, or when you need to manage state with your Router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n */\n var NoneLocation = EmberObject.extend({\n implementation: 'none',\n path: '',\n\n /**\n Returns the current path.\n\n @private\n @method getURL\n @return {String} path\n */\n getURL: function() {\n return get(this, 'path');\n },\n\n /**\n Set the path and remembers what was set. Using this method\n to change the path will not invoke the `updateURL` callback.\n\n @private\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n /**\n Register a callback to be invoked when the path changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @private\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n this.updateCallback = callback;\n },\n\n /**\n Sets the path and calls the `updateURL` callback.\n\n @private\n @method handleURL\n @param callback {Function}\n */\n handleURL: function(url) {\n set(this, 'path', url);\n this.updateCallback(url);\n },\n\n /**\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @private\n @method formatURL\n @param url {String}\n @return {String} url\n */\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n });\n\n __exports__[\"default\"] = NoneLocation;\n });\ndefine(\"ember-routing\",\n [\"ember-handlebars\",\"ember-metal/core\",\"ember-routing/ext/run_loop\",\"ember-routing/ext/controller\",\"ember-routing/ext/view\",\"ember-routing/helpers/shared\",\"ember-routing/helpers/link_to\",\"ember-routing/location/api\",\"ember-routing/location/none_location\",\"ember-routing/location/hash_location\",\"ember-routing/location/history_location\",\"ember-routing/location/auto_location\",\"ember-routing/system/controller_for\",\"ember-routing/system/dsl\",\"ember-routing/system/router\",\"ember-routing/system/route\",\"ember-routing/helpers/outlet\",\"ember-routing/helpers/render\",\"ember-routing/helpers/action\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __exports__) {\n \"use strict\";\n // require('ember-runtime');\n // require('ember-views');\n // require('ember-handlebars');\n\n /**\n Ember Routing\n\n @module ember\n @submodule ember-routing\n @requires ember-views\n */\n\n var EmberHandlebars = __dependency1__[\"default\"];\n var Ember = __dependency2__[\"default\"];\n\n // ES6TODO: Cleanup modules with side-effects below\n\n var resolvePaths = __dependency6__.resolvePaths;\n var resolveParams = __dependency6__.resolveParams;\n var deprecatedLinkToHelper = __dependency7__.deprecatedLinkToHelper;\n var linkToHelper = __dependency7__.linkToHelper;\n var LinkView = __dependency7__.LinkView;\n\n\n // require('ember-views');\n var EmberLocation = __dependency8__[\"default\"];\n var NoneLocation = __dependency9__[\"default\"];\n var HashLocation = __dependency10__[\"default\"];\n var HistoryLocation = __dependency11__[\"default\"];\n var AutoLocation = __dependency12__[\"default\"];\n\n var controllerFor = __dependency13__.controllerFor;\n var generateControllerFactory = __dependency13__.generateControllerFactory;\n var generateController = __dependency13__.generateController;\n var RouterDSL = __dependency14__[\"default\"];\n var Router = __dependency15__[\"default\"];\n var Route = __dependency16__[\"default\"];\n var outletHelper = __dependency17__.outletHelper;\n var OutletView = __dependency17__.OutletView;\n var renderHelper = __dependency18__[\"default\"];\n var ActionHelper = __dependency19__.ActionHelper;\n var actionHelper = __dependency19__.actionHelper;\n\n\n Ember.Location = EmberLocation;\n Ember.AutoLocation = AutoLocation;\n Ember.HashLocation = HashLocation;\n Ember.HistoryLocation = HistoryLocation;\n Ember.NoneLocation = NoneLocation;\n\n Ember.controllerFor = controllerFor;\n Ember.generateControllerFactory = generateControllerFactory;\n Ember.generateController = generateController;\n Ember.RouterDSL = RouterDSL;\n Ember.Router = Router;\n Ember.Route = Route;\n Ember.LinkView = LinkView;\n\n Router.resolveParams = resolveParams;\n Router.resolvePaths = resolvePaths;\n\n EmberHandlebars.ActionHelper = ActionHelper;\n EmberHandlebars.OutletView = OutletView;\n\n EmberHandlebars.registerHelper('render', renderHelper)\n EmberHandlebars.registerHelper('action', actionHelper);\n EmberHandlebars.registerHelper('outlet', outletHelper);\n EmberHandlebars.registerHelper('link-to', linkToHelper);\n EmberHandlebars.registerHelper('linkTo', deprecatedLinkToHelper);\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-routing/system/controller_for\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Logger\n var get = __dependency2__.get;\n var isArray = __dependency3__.isArray;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n /**\n\n Finds a controller instance.\n\n @for Ember\n @method controllerFor\n @private\n */\n var controllerFor = function(container, controllerName, lookupOptions) {\n return container.lookup('controller:' + controllerName, lookupOptions);\n };\n\n /**\n Generates a controller factory\n\n The type of the generated controller factory is derived\n from the context. If the context is an array an array controller\n is generated, if an object, an object controller otherwise, a basic\n controller is generated.\n\n You can customize your generated controllers by defining\n `App.ObjectController` or `App.ArrayController`.\n\n @for Ember\n @method generateControllerFactory\n @private\n */\n var generateControllerFactory = function(container, controllerName, context) {\n var Factory, fullName, instance, name, factoryName, controllerType;\n\n if (context && isArray(context)) {\n controllerType = 'array';\n } else if (context) {\n controllerType = 'object';\n } else {\n controllerType = 'basic';\n }\n\n factoryName = 'controller:' + controllerType;\n\n Factory = container.lookupFactory(factoryName).extend({\n isGenerated: true,\n toString: function() {\n return \"(generated \" + controllerName + \" controller)\";\n }\n });\n\n fullName = 'controller:' + controllerName;\n\n container.register(fullName, Factory);\n\n return Factory;\n };\n\n /**\n Generates and instantiates a controller.\n\n The type of the generated controller factory is derived\n from the context. If the context is an array an array controller\n is generated, if an object, an object controller otherwise, a basic\n controller is generated.\n\n @for Ember\n @method generateController\n @private\n @since 1.3.0\n */\n var generateController = function(container, controllerName, context) {\n generateControllerFactory(container, controllerName, context);\n var fullName = 'controller:' + controllerName;\n var instance = container.lookup(fullName);\n\n if (get(instance, 'namespace.LOG_ACTIVE_GENERATION')) {\n Ember.Logger.info(\"generated -> \" + fullName, { fullName: fullName });\n }\n\n return instance;\n };\n\n __exports__.controllerFor = controllerFor;\n __exports__.generateControllerFactory = generateControllerFactory;\n __exports__.generateController = generateController;\n });\ndefine(\"ember-routing/system/dsl\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, assert\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n function DSL(name) {\n this.parent = name;\n this.matches = [];\n }\n\n DSL.prototype = {\n resource: function(name, options, callback) {\n Ember.assert(\"'basic' cannot be used as a resource name.\", name !== 'basic');\n\n if (arguments.length === 2 && typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n if (arguments.length === 1) {\n options = {};\n }\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (callback) {\n var dsl = new DSL(name);\n route(dsl, 'loading');\n route(dsl, 'error', { path: \"/_unused_dummy_error_path_route_\" + name + \"/:error\" });\n callback.call(dsl);\n this.push(options.path, name, dsl.generate());\n } else {\n this.push(options.path, name, null);\n }\n\n\n if (Ember.FEATURES.isEnabled(\"ember-routing-named-substates\")) {\n // For namespace-preserving nested resource (e.g. resource('foo.bar') within\n // resource('foo')) we only want to use the last route name segment to determine\n // the names of the error/loading substates (e.g. 'bar_loading')\n name = name.split('.').pop();\n route(this, name + '_loading');\n route(this, name + '_error', { path: \"/_unused_dummy_error_path_route_\" + name + \"/:error\" });\n }\n },\n\n push: function(url, name, callback) {\n var parts = name.split('.');\n if (url === \"\" || url === \"/\" || parts[parts.length-1] === \"index\") { this.explicitIndex = true; }\n\n this.matches.push([url, name, callback]);\n },\n\n route: function(name, options) {\n Ember.assert(\"'basic' cannot be used as a route name.\", name !== 'basic');\n\n route(this, name, options);\n if (Ember.FEATURES.isEnabled(\"ember-routing-named-substates\")) {\n route(this, name + '_loading');\n route(this, name + '_error', { path: \"/_unused_dummy_error_path_route_\" + name + \"/:error\" });\n }\n },\n\n generate: function() {\n var dslMatches = this.matches;\n\n if (!this.explicitIndex) {\n this.route(\"index\", { path: \"/\" });\n }\n\n return function(match) {\n for (var i=0, l=dslMatches.length; i<l; i++) {\n var dslMatch = dslMatches[i];\n var matchObj = match(dslMatch[0]).to(dslMatch[1], dslMatch[2]);\n }\n };\n }\n };\n\n function route(dsl, name, options) {\n Ember.assert(\"You must use `this.resource` to nest\", typeof options !== 'function');\n\n options = options || {};\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (dsl.parent && dsl.parent !== 'application') {\n name = dsl.parent + \".\" + name;\n }\n\n dsl.push(options.path, name, null);\n }\n\n DSL.map = function(callback) {\n var dsl = new DSL();\n callback.call(dsl);\n return dsl;\n };\n\n __exports__[\"default\"] = DSL;\n });\ndefine(\"ember-routing/system/route\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/get_properties\",\"ember-metal/enumerable_utils\",\"ember-metal/is_none\",\"ember-metal/computed\",\"ember-metal/utils\",\"ember-metal/run_loop\",\"ember-runtime/keys\",\"ember-runtime/copy\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-runtime/mixins/action_handler\",\"ember-routing/system/controller_for\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, K, A, deprecate, assert, Logger\n var EmberError = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var getProperties = __dependency5__[\"default\"];\n var EnumerableUtils = __dependency6__[\"default\"];\n var isNone = __dependency7__.isNone;\n var computed = __dependency8__.computed;\n var typeOf = __dependency9__.typeOf;\n var run = __dependency10__[\"default\"];\n\n var keys = __dependency11__[\"default\"];\n var copy = __dependency12__[\"default\"];\n var classify = __dependency13__.classify;\n var fmt = __dependency13__.fmt;\n var EmberObject = __dependency14__[\"default\"];\n var ActionHandler = __dependency15__[\"default\"];\n var generateController = __dependency16__.generateController;\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n var a_forEach = EnumerableUtils.forEach,\n a_replace = EnumerableUtils.replace;\n\n /**\n The `Ember.Route` class is used to define individual routes. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Route\n @namespace Ember\n @extends Ember.Object\n @uses Ember.ActionHandler\n */\n var Route = EmberObject.extend(ActionHandler, {\n\n /**\n @private\n\n @method exit\n */\n exit: function() {\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n toggleQueryParamObservers(this, this.controller, false);\n }\n this.deactivate();\n this.teardownViews();\n },\n\n /**\n @private\n\n @method enter\n */\n enter: function() {\n this.activate();\n },\n\n /**\n The name of the view to use by default when rendering this routes template.\n\n When rendering a template, the route will, by default, determine the\n template and view to use from the name of the route itself. If you need to\n define a specific view, set this property.\n\n This is useful when multiple routes would benefit from using the same view\n because it doesn't require a custom `renderTemplate` method. For example,\n the following routes will all render using the `App.PostsListView` view:\n\n ```js\n var PostsList = Ember.Route.extend({\n viewName: 'postsList',\n });\n\n App.PostsIndexRoute = PostsList.extend();\n App.PostsArchivedRoute = PostsList.extend();\n ```\n\n @property viewName\n @type String\n @default null\n @since 1.4.0\n */\n viewName: null,\n\n /**\n The name of the template to use by default when rendering this routes\n template.\n\n This is similar with `viewName`, but is useful when you just want a custom\n template without a view.\n\n ```js\n var PostsList = Ember.Route.extend({\n templateName: 'posts/list'\n });\n\n App.PostsIndexRoute = PostsList.extend();\n App.PostsArchivedRoute = PostsList.extend();\n ```\n\n @property templateName\n @type String\n @default null\n @since 1.4.0\n */\n templateName: null,\n\n /**\n The name of the controller to associate with this route.\n\n By default, Ember will lookup a route's controller that matches the name\n of the route (i.e. `App.PostController` for `App.PostRoute`). However,\n if you would like to define a specific controller to use, you can do so\n using this property.\n\n This is useful in many ways, as the controller specified will be:\n\n * passed to the `setupController` method.\n * used as the controller for the view being rendered by the route.\n * returned from a call to `controllerFor` for the route.\n\n @property controllerName\n @type String\n @default null\n @since 1.4.0\n */\n controllerName: null,\n\n /**\n The `willTransition` action is fired at the beginning of any\n attempted transition with a `Transition` object as the sole\n argument. This action can be used for aborting, redirecting,\n or decorating the transition from the currently active routes.\n\n A good example is preventing navigation when a form is\n half-filled out:\n\n ```js\n App.ContactFormRoute = Ember.Route.extend({\n actions: {\n willTransition: function(transition) {\n if (this.controller.get('userHasEnteredData')) {\n this.controller.displayNavigationConfirm();\n transition.abort();\n }\n }\n }\n });\n ```\n\n You can also redirect elsewhere by calling\n `this.transitionTo('elsewhere')` from within `willTransition`.\n Note that `willTransition` will not be fired for the\n redirecting `transitionTo`, since `willTransition` doesn't\n fire when there is already a transition underway. If you want\n subsequent `willTransition` actions to fire for the redirecting\n transition, you must first explicitly call\n `transition.abort()`.\n\n @event willTransition\n @param {Transition} transition\n */\n\n /**\n The `didTransition` action is fired after a transition has\n successfully been completed. This occurs after the normal model\n hooks (`beforeModel`, `model`, `afterModel`, `setupController`)\n have resolved. The `didTransition` action has no arguments,\n however, it can be useful for tracking page views or resetting\n state on the controller.\n\n ```js\n App.LoginRoute = Ember.Route.extend({\n actions: {\n didTransition: function() {\n this.controller.get('errors.base').clear();\n return true; // Bubble the didTransition event\n }\n }\n });\n ```\n\n @event didTransition\n @since 1.2.0\n */\n\n /**\n The `loading` action is fired on the route when a route's `model`\n hook returns a promise that is not already resolved. The current\n `Transition` object is the first parameter and the route that\n triggered the loading event is the second parameter.\n\n ```js\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n loading: function(transition, route) {\n var view = Ember.View.create({\n classNames: ['app-loading']\n })\n .append();\n\n this.router.one('didTransition', function () {\n view.destroy();\n });\n return true; // Bubble the loading event\n }\n }\n });\n ```\n\n @event loading\n @param {Transition} transition\n @param {Ember.Route} route The route that triggered the loading event\n @since 1.2.0\n */\n\n /**\n When attempting to transition into a route, any of the hooks\n may return a promise that rejects, at which point an `error`\n action will be fired on the partially-entered routes, allowing\n for per-route error handling logic, or shared error handling\n logic defined on a parent route.\n\n Here is an example of an error handler that will be invoked\n for rejected promises from the various hooks on the route,\n as well as any unhandled errors from child routes:\n\n ```js\n App.AdminRoute = Ember.Route.extend({\n beforeModel: function() {\n return Ember.RSVP.reject(\"bad things!\");\n },\n\n actions: {\n error: function(error, transition) {\n // Assuming we got here due to the error in `beforeModel`,\n // we can expect that error === \"bad things!\",\n // but a promise model rejecting would also\n // call this hook, as would any errors encountered\n // in `afterModel`.\n\n // The `error` hook is also provided the failed\n // `transition`, which can be stored and later\n // `.retry()`d if desired.\n\n this.transitionTo('login');\n }\n }\n });\n ```\n\n `error` actions that bubble up all the way to `ApplicationRoute`\n will fire a default error handler that logs the error. You can\n specify your own global default error handler by overriding the\n `error` handler on `ApplicationRoute`:\n\n ```js\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n error: function(error, transition) {\n this.controllerFor('banner').displayError(error.message);\n }\n }\n });\n ```\n @event error\n @param {Error} error\n @param {Transition} transition\n */\n\n /**\n The controller associated with this route.\n\n Example\n\n ```javascript\n App.FormRoute = Ember.Route.extend({\n actions: {\n willTransition: function(transition) {\n if (this.controller.get('userHasEnteredData') &&\n !confirm(\"Are you sure you want to abandon progress?\")) {\n transition.abort();\n } else {\n // Bubble the `willTransition` action so that\n // parent routes can decide whether or not to abort.\n return true;\n }\n }\n }\n });\n ```\n\n @property controller\n @type Ember.Controller\n @since 1.6.0\n */\n\n _actions: {\n\n queryParamsDidChange: function(changed, totalPresent, removed) {\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n var totalChanged = keys(changed).concat(keys(removed));\n for (var i = 0, len = totalChanged.length; i < len; ++i) {\n var urlKey = totalChanged[i],\n options = get(this.queryParams, urlKey) || {};\n if (get(options, 'refreshModel')) {\n this.refresh();\n }\n }\n return true;\n }\n },\n\n finalizeQueryParamChange: function(params, finalParams, transition) {\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n // In this hook we receive all the current values of\n // serialized query params. We need to take these values\n // and distribute them in their deserialized form into\n // controllers and remove any that no longer belong in\n // this route hierarchy.\n\n var controller = this.controller,\n changes = controller._queryParamChangesDuringSuspension,\n qpMeta = get(this, '_qp');\n\n // Loop through all the query params that\n // this controller knows about.\n\n if (qpMeta) {\n for (var i = 0, len = qpMeta.qps.length; i < len; ++i) {\n var qp = qpMeta.qps[i],\n qpProvided = qp.urlKey in params;\n\n // Do a reverse lookup to see if the changed query\n // param URL key corresponds to a QP property on\n // this controller.\n var value, svalue;\n if (changes && qp.urlKey in changes) {\n // Controller overrode this value in setupController\n svalue = get(controller, qp.prop);\n value = this.deserializeQueryParam(svalue, qp.urlKey, qp.type);\n } else {\n if (qpProvided) {\n svalue = params[qp.urlKey];\n value = this.deserializeQueryParam(svalue, qp.urlKey, qp.type);\n } else {\n // No QP provided; use default value.\n svalue = qp.sdef;\n value = qp.def;\n }\n }\n\n // Delete from params so that parent routes\n // don't also try to respond to changes to\n // non-fully-qualified query param name changes\n // (e.g. if two controllers in the same hiearchy\n // specify a `page` query param)\n delete params[qp.urlKey];\n\n // Now check if this value actually changed.\n if (svalue !== qp.svalue) {\n var options = get(this.queryParams, qp.urlKey) || {};\n if (get(options, 'replace')) {\n transition.method('replace');\n }\n\n // Update QP cache\n qp.svalue = svalue;\n qp.value = value;\n\n // Update controller without firing QP observers.\n controller._finalizingQueryParams = true;\n set(controller, qp.prop, qp.value);\n controller._finalizingQueryParams = false;\n }\n\n finalParams.push({\n value: qp.svalue,\n visible: qp.svalue !== qp.sdef,\n key: qp.urlKey\n });\n }\n controller._queryParamChangesDuringSuspension = null;\n }\n // Bubble so that parent routes can claim QPs.\n return true;\n }\n }\n },\n\n /**\n @deprecated\n\n Please use `actions` instead.\n @method events\n */\n events: null,\n\n mergedProperties: ['events'],\n\n /**\n This hook is executed when the router completely exits this route. It is\n not executed when the model for the route changes.\n\n @method deactivate\n */\n deactivate: Ember.K,\n\n /**\n This hook is executed when the router enters the route. It is not executed\n when the model for the route changes.\n\n @method activate\n */\n activate: Ember.K,\n\n /**\n Transition the application into another route. The route may\n be either a single route or route path:\n\n ```javascript\n this.transitionTo('blogPosts');\n this.transitionTo('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n this.transitionTo('blogPost', aPost);\n ```\n\n If a literal is passed (such as a number or a string), it will\n be treated as an identifier instead. In this case, the `model`\n hook of the route will be triggered:\n\n ```javascript\n this.transitionTo('blogPost', 1);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n App.Router.map(function() {\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n });\n\n this.transitionTo('blogComment', aPost, aComment);\n this.transitionTo('blogComment', 1, 13);\n ```\n\n It is also possible to pass a URL (a string that starts with a\n `/`). This is intended for testing and debugging purposes and\n should rarely be used in production code.\n\n ```javascript\n this.transitionTo('/');\n this.transitionTo('/blog/post/1/comment/13');\n ```\n\n See also 'replaceWith'.\n\n Simple Transition Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.route(\"secret\");\n this.route(\"fourOhFour\", { path: \"*:\"});\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n moveToSecret: function(context){\n if (authorized()){\n this.transitionTo('secret', context);\n }\n this.transitionTo('fourOhFour');\n }\n }\n });\n ```\n\n Transition to a nested route\n\n ```javascript\n App.Router.map(function() {\n this.resource('articles', { path: '/articles' }, function() {\n this.route('new');\n });\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n transitionToNewArticle: function() {\n this.transitionTo('articles.new');\n }\n }\n });\n ```\n\n Multiple Models Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.resource('breakfast', {path:':breakfastId'}, function(){\n this.resource('cereal', {path: ':cerealId'});\n });\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n moveToChocolateCereal: function(){\n var cereal = { cerealId: \"ChocolateYumminess\"},\n breakfast = {breakfastId: \"CerealAndMilk\"};\n\n this.transitionTo('cereal', breakfast, cereal);\n }\n }\n });\n ```\n\n @method transitionTo\n @param {String} name the name of the route or a URL\n @param {...Object} models the model(s) or identifier(s) to be used while\n transitioning to the route.\n @return {Transition} the transition object associated with this\n attempted transition\n */\n transitionTo: function(name, context) {\n var router = this.router;\n return router.transitionTo.apply(router, arguments);\n },\n\n /**\n Perform a synchronous transition into another route without attempting\n to resolve promises, update the URL, or abort any currently active\n asynchronous transitions (i.e. regular transitions caused by\n `transitionTo` or URL changes).\n\n This method is handy for performing intermediate transitions on the\n way to a final destination route, and is called internally by the\n default implementations of the `error` and `loading` handlers.\n\n @method intermediateTransitionTo\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n @since 1.2.0\n */\n intermediateTransitionTo: function() {\n var router = this.router;\n router.intermediateTransitionTo.apply(router, arguments);\n },\n\n /**\n Refresh the model on this route and any child routes, firing the\n `beforeModel`, `model`, and `afterModel` hooks in a similar fashion\n to how routes are entered when transitioning in from other route.\n The current route params (e.g. `article_id`) will be passed in\n to the respective model hooks, and if a different model is returned,\n `setupController` and associated route hooks will re-fire as well.\n\n An example usage of this method is re-querying the server for the\n latest information using the same parameters as when the route\n was first entered.\n\n Note that this will cause `model` hooks to fire even on routes\n that were provided a model object when the route was initially\n entered.\n\n @method refresh\n @return {Transition} the transition object associated with this\n attempted transition\n @since 1.4.0\n */\n refresh: function() {\n return this.router.router.refresh(this);\n },\n\n /**\n Transition into another route while replacing the current URL, if possible.\n This will replace the current history entry instead of adding a new one.\n Beside that, it is identical to `transitionTo` in all other respects. See\n 'transitionTo' for additional information regarding multiple models.\n\n Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.route(\"secret\");\n });\n\n App.SecretRoute = Ember.Route.extend({\n afterModel: function() {\n if (!authorized()){\n this.replaceWith('index');\n }\n }\n });\n ```\n\n @method replaceWith\n @param {String} name the name of the route or a URL\n @param {...Object} models the model(s) or identifier(s) to be used while\n transitioning to the route.\n @return {Transition} the transition object associated with this\n attempted transition\n */\n replaceWith: function() {\n var router = this.router;\n return router.replaceWith.apply(router, arguments);\n },\n\n /**\n Sends an action to the router, which will delegate it to the currently\n active route hierarchy per the bubbling rules explained under `actions`.\n\n Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n });\n\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n track: function(arg) {\n console.log(arg, 'was clicked');\n }\n }\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n trackIfDebug: function(arg) {\n if (debug) {\n this.send('track', arg);\n }\n }\n }\n });\n ```\n\n @method send\n @param {String} name the name of the action to trigger\n @param {...*} args\n */\n send: function() {\n return this.router.send.apply(this.router, arguments);\n },\n\n /**\n This hook is the entry point for router.js\n\n @private\n @method setup\n */\n setup: function(context, transition) {\n var controllerName = this.controllerName || this.routeName,\n controller = this.controllerFor(controllerName, true);\n if (!controller) {\n controller = this.generateController(controllerName, context);\n }\n\n // Assign the route's controller so that it can more easily be\n // referenced in action handlers\n this.controller = controller;\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n toggleQueryParamObservers(this, controller, true);\n }\n\n if (this.setupControllers) {\n Ember.deprecate(\"Ember.Route.setupControllers is deprecated. Please use Ember.Route.setupController(controller, model) instead.\");\n this.setupControllers(controller, context);\n } else {\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n // Prevent updates to query params in setupController\n // from firing another transition. Updating QPs in\n // setupController will only affect the final\n // generated URL.\n controller._finalizingQueryParams = true;\n controller._queryParamChangesDuringSuspension = {};\n this.setupController(controller, context, transition);\n controller._finalizingQueryParams = false;\n } else {\n this.setupController(controller, context);\n }\n }\n\n if (this.renderTemplates) {\n Ember.deprecate(\"Ember.Route.renderTemplates is deprecated. Please use Ember.Route.renderTemplate(controller, model) instead.\");\n this.renderTemplates(context);\n } else {\n this.renderTemplate(controller, context);\n }\n },\n\n /**\n This hook is the first of the route entry validation hooks\n called when an attempt is made to transition into a route\n or one of its children. It is called before `model` and\n `afterModel`, and is appropriate for cases when:\n\n 1) A decision can be made to redirect elsewhere without\n needing to resolve the model first.\n 2) Any async operations need to occur first before the\n model is attempted to be resolved.\n\n This hook is provided the current `transition` attempt\n as a parameter, which can be used to `.abort()` the transition,\n save it for a later `.retry()`, or retrieve values set\n on it from a previous hook. You can also just call\n `this.transitionTo` to another route to implicitly\n abort the `transition`.\n\n You can return a promise from this hook to pause the\n transition until the promise resolves (or rejects). This could\n be useful, for instance, for retrieving async code from\n the server that is required to enter a route.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n beforeModel: function(transition) {\n if (!App.Post) {\n return Ember.$.getScript('/models/post.js');\n }\n }\n });\n ```\n\n If `App.Post` doesn't exist in the above example,\n `beforeModel` will use jQuery's `getScript`, which\n returns a promise that resolves after the server has\n successfully retrieved and executed the code from the\n server. Note that if an error were to occur, it would\n be passed to the `error` hook on `Ember.Route`, but\n it's also possible to handle errors specific to\n `beforeModel` right from within the hook (to distinguish\n from the shared error handling behavior of the `error`\n hook):\n\n ```js\n App.PostRoute = Ember.Route.extend({\n beforeModel: function(transition) {\n if (!App.Post) {\n var self = this;\n return Ember.$.getScript('post.js').then(null, function(e) {\n self.transitionTo('help');\n\n // Note that the above transitionTo will implicitly\n // halt the transition. If you were to return\n // nothing from this promise reject handler,\n // according to promise semantics, that would\n // convert the reject into a resolve and the\n // transition would continue. To propagate the\n // error so that it'd be handled by the `error`\n // hook, you would have to either\n return Ember.RSVP.reject(e);\n });\n }\n }\n });\n ```\n\n @method beforeModel\n @param {Transition} transition\n @param {Object} queryParams the active query params for this route\n @return {Promise} if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.\n */\n beforeModel: Ember.K,\n\n /**\n This hook is called after this route's model has resolved.\n It follows identical async/promise semantics to `beforeModel`\n but is provided the route's resolved model in addition to\n the `transition`, and is therefore suited to performing\n logic that can only take place after the model has already\n resolved.\n\n ```js\n App.PostsRoute = Ember.Route.extend({\n afterModel: function(posts, transition) {\n if (posts.get('length') === 1) {\n this.transitionTo('post.show', posts.get('firstObject'));\n }\n }\n });\n ```\n\n Refer to documentation for `beforeModel` for a description\n of transition-pausing semantics when a promise is returned\n from this hook.\n\n @method afterModel\n @param {Object} resolvedModel the value returned from `model`,\n or its resolved value if it was a promise\n @param {Transition} transition\n @param {Object} queryParams the active query params for this handler\n @return {Promise} if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.\n */\n afterModel: Ember.K,\n\n /**\n A hook you can implement to optionally redirect to another route.\n\n If you call `this.transitionTo` from inside of this hook, this route\n will not be entered in favor of the other hook.\n\n `redirect` and `afterModel` behave very similarly and are\n called almost at the same time, but they have an important\n distinction in the case that, from one of these hooks, a\n redirect into a child route of this route occurs: redirects\n from `afterModel` essentially invalidate the current attempt\n to enter this route, and will result in this route's `beforeModel`,\n `model`, and `afterModel` hooks being fired again within\n the new, redirecting transition. Redirects that occur within\n the `redirect` hook, on the other hand, will _not_ cause\n these hooks to be fired again the second time around; in\n other words, by the time the `redirect` hook has been called,\n both the resolved model and attempted entry into this route\n are considered to be fully validated.\n\n @method redirect\n @param {Object} model the model for this route\n */\n redirect: Ember.K,\n\n /**\n Called when the context is changed by router.js.\n\n @private\n @method contextDidChange\n */\n contextDidChange: function() {\n this.currentModel = this.context;\n },\n\n /**\n A hook you can implement to convert the URL into the model for\n this route.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n The model for the `post` route is `App.Post.find(params.post_id)`.\n\n By default, if your route has a dynamic segment ending in `_id`:\n\n * The model class is determined from the segment (`post_id`'s\n class is `App.Post`)\n * The find method is called on the model class with the value of\n the dynamic segment.\n\n Note that for routes with dynamic segments, this hook is only\n executed when entered via the URL. If the route is entered\n through a transition (e.g. when using the `link-to` Handlebars\n helper), then a model context is already provided and this hook\n is not called. Routes without dynamic segments will always\n execute the model hook.\n\n This hook follows the asynchronous/promise semantics\n described in the documentation for `beforeModel`. In particular,\n if a promise returned from `model` fails, the error will be\n handled by the `error` hook on `Ember.Route`.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n return App.Post.find(params.post_id);\n }\n });\n ```\n\n @method model\n @param {Object} params the parameters extracted from the URL\n @param {Transition} transition\n @param {Object} queryParams the query params for this route\n @return {Object|Promise} the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.\n */\n model: function(params, transition) {\n var match, name, sawParams, value;\n\n for (var prop in params) {\n if (prop === 'queryParams') { continue; }\n\n if (match = prop.match(/^(.*)_id$/)) {\n name = match[1];\n value = params[prop];\n }\n sawParams = true;\n }\n\n if (!name && sawParams) { return copy(params); }\n else if (!name) {\n if (transition.resolveIndex !== transition.state.handlerInfos.length-1) { return; }\n\n var parentModel = transition.state.handlerInfos[transition.resolveIndex-1].context;\n\n return parentModel;\n }\n\n return this.findModel(name, value);\n },\n\n /**\n @private\n @method deserialize\n @param {Object} params the parameters extracted from the URL\n @param {Transition} transition\n @return {Object|Promise} the model for this route.\n\n Router.js hook.\n */\n deserialize: function(params, transition) {\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n return this.model(this.paramsFor(this.routeName), transition);\n } else {\n return this.model(params, transition);\n }\n },\n\n /**\n\n @method findModel\n @param {String} type the model type\n @param {Object} value the value passed to find\n */\n findModel: function(){\n var store = get(this, 'store');\n return store.find.apply(store, arguments);\n },\n\n /**\n Store property provides a hook for data persistence libraries to inject themselves.\n\n By default, this store property provides the exact same functionality previously\n in the model hook.\n\n Currently, the required interface is:\n\n `store.find(modelName, findArguments)`\n\n @method store\n @param {Object} store\n */\n store: computed(function(){\n var container = this.container;\n var routeName = this.routeName;\n var namespace = get(this, 'router.namespace');\n\n return {\n find: function(name, value) {\n var modelClass = container.lookupFactory('model:' + name);\n\n Ember.assert(\"You used the dynamic segment \" + name + \"_id in your route \" +\n routeName + \", but \" + namespace + \".\" + classify(name) +\n \" did not exist and you did not override your route's `model` \" +\n \"hook.\", modelClass);\n\n if (!modelClass) { return; }\n\n Ember.assert(classify(name) + ' has no method `find`.', typeof modelClass.find === 'function');\n\n return modelClass.find(value);\n }\n };\n }),\n\n /**\n A hook you can implement to convert the route's model into parameters\n for the URL.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n // the server returns `{ id: 12 }`\n return jQuery.getJSON(\"/posts/\" + params.post_id);\n },\n\n serialize: function(model) {\n // this will make the URL `/posts/12`\n return { post_id: model.id };\n }\n });\n ```\n\n The default `serialize` method will insert the model's `id` into the\n route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.\n If the route has multiple dynamic segments or does not contain '_id', `serialize`\n will return `Ember.getProperties(model, params)`\n\n This method is called when `transitionTo` is called with a context\n in order to populate the URL.\n\n @method serialize\n @param {Object} model the route's model\n @param {Array} params an Array of parameter names for the current\n route (in the example, `['post_id']`.\n @return {Object} the serialized parameters\n */\n serialize: function(model, params) {\n if (params.length < 1) { return; }\n if (!model) { return; }\n\n var name = params[0], object = {};\n\n if (/_id$/.test(name) && params.length === 1) {\n object[name] = get(model, \"id\");\n } else {\n object = getProperties(model, params);\n }\n\n return object;\n },\n\n /**\n A hook you can use to setup the controller for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook.\n\n By default, the `setupController` hook sets the `content` property of\n the controller to the `model`.\n\n If you implement the `setupController` hook in your Route, it will\n prevent this default behavior. If you want to preserve that behavior\n when implementing your `setupController` function, make sure to call\n `_super`:\n\n ```js\n App.PhotosRoute = Ember.Route.extend({\n model: function() {\n return App.Photo.find();\n },\n\n setupController: function (controller, model) {\n // Call _super for default behavior\n this._super(controller, model);\n // Implement your custom setup after\n this.controllerFor('application').set('showingPhotos', true);\n }\n });\n ```\n\n This means that your template will get a proxy for the model as its\n context, and you can act as though the model itself was the context.\n\n The provided controller will be one resolved based on the name\n of this route.\n\n If no explicit controller is defined, Ember will automatically create\n an appropriate controller for the model.\n\n * if the model is an `Ember.Array` (including record arrays from Ember\n Data), the controller is an `Ember.ArrayController`.\n * otherwise, the controller is an `Ember.ObjectController`.\n\n As an example, consider the router:\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n For the `post` route, a controller named `App.PostController` would\n be used if it is defined. If it is not defined, an `Ember.ObjectController`\n instance would be used.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, model) {\n controller.set('model', model);\n }\n });\n ```\n\n @method setupController\n @param {Controller} controller instance\n @param {Object} model\n */\n setupController: function(controller, context, transition) {\n if (controller && (context !== undefined)) {\n set(controller, 'model', context);\n }\n },\n\n /**\n Returns the controller for a particular route or name.\n\n The controller instance must already have been created, either through entering the\n associated route or using `generateController`.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.controllerFor('posts').set('currentPost', post);\n }\n });\n ```\n\n @method controllerFor\n @param {String} name the name of the route or controller\n @return {Ember.Controller}\n */\n controllerFor: function(name, _skipAssert) {\n var container = this.container,\n route = container.lookup('route:'+name),\n controller;\n\n if (route && route.controllerName) {\n name = route.controllerName;\n }\n\n controller = container.lookup('controller:' + name);\n\n // NOTE: We're specifically checking that skipAssert is true, because according\n // to the old API the second parameter was model. We do not want people who\n // passed a model to skip the assertion.\n Ember.assert(\"The controller named '\"+name+\"' could not be found. Make sure \" +\n \"that this route exists and has already been entered at least \" +\n \"once. If you are accessing a controller not associated with a \" +\n \"route, make sure the controller class is explicitly defined.\",\n controller || _skipAssert === true);\n\n return controller;\n },\n\n /**\n Generates a controller for a route.\n\n If the optional model is passed then the controller type is determined automatically,\n e.g., an ArrayController for arrays.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.generateController('posts', post);\n }\n });\n ```\n\n @method generateController\n @param {String} name the name of the controller\n @param {Object} model the model to infer the type of the controller (optional)\n */\n generateController: function(name, model) {\n var container = this.container;\n\n model = model || this.modelFor(name);\n\n return generateController(container, name, model);\n },\n\n /**\n Returns the model of a parent (or any ancestor) route\n in a route hierarchy. During a transition, all routes\n must resolve a model object, and if a route\n needs access to a parent route's model in order to\n resolve a model (or just reuse the model from a parent),\n it can call `this.modelFor(theNameOfParentRoute)` to\n retrieve it.\n\n Example\n\n ```js\n App.Router.map(function() {\n this.resource('post', { path: '/post/:post_id' }, function() {\n this.resource('comments');\n });\n });\n\n App.CommentsRoute = Ember.Route.extend({\n afterModel: function() {\n this.set('post', this.modelFor('post'));\n }\n });\n ```\n\n @method modelFor\n @param {String} name the name of the route\n @return {Object} the model object\n */\n modelFor: function(name) {\n var route = this.container.lookup('route:' + name),\n transition = this.router ? this.router.router.activeTransition : null;\n\n // If we are mid-transition, we want to try and look up\n // resolved parent contexts on the current transitionEvent.\n if (transition) {\n var modelLookupName = (route && route.routeName) || name;\n if (transition.resolvedModels.hasOwnProperty(modelLookupName)) {\n return transition.resolvedModels[modelLookupName];\n }\n }\n\n return route && route.currentModel;\n },\n\n /**\n A hook you can use to render the template for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook. By default, it renders the route's\n template, configured with the controller for the route.\n\n This method can be overridden to set up and render additional or\n alternative templates.\n\n ```js\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function(controller, model) {\n var favController = this.controllerFor('favoritePost');\n\n // Render the `favoritePost` template into\n // the outlet `posts`, and display the `favoritePost`\n // controller.\n this.render('favoritePost', {\n outlet: 'posts',\n controller: favController\n });\n }\n });\n ```\n\n @method renderTemplate\n @param {Object} controller the route's controller\n @param {Object} model the route's model\n */\n renderTemplate: function(controller, model) {\n this.render();\n },\n\n /**\n Renders a template into an outlet.\n\n This method has a number of defaults, based on the name of the\n route specified in the router.\n\n For example:\n\n ```js\n App.Router.map(function() {\n this.route('index');\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render();\n }\n });\n ```\n\n The name of the `PostRoute`, as defined by the router, is `post`.\n\n By default, render will:\n\n * render the `post` template\n * with the `post` view (`PostView`) for event handling, if one exists\n * and the `post` controller (`PostController`), if one exists\n * into the `main` outlet of the `application` template\n\n You can override this behavior:\n\n ```js\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render('myPost', { // the template to render\n into: 'index', // the template to render into\n outlet: 'detail', // the name of the outlet in that template\n controller: 'blogPost' // the controller to use for the template\n });\n }\n });\n ```\n\n Remember that the controller's `content` will be the route's model. In\n this case, the default model will be `App.Post.find(params.post_id)`.\n\n @method render\n @param {String} name the name of the template to render\n @param {Object} options the options\n */\n render: function(name, options) {\n Ember.assert(\"The name in the given arguments is undefined\", arguments.length > 0 ? !isNone(arguments[0]) : true);\n\n var namePassed = typeof name === 'string' && !!name;\n\n if (typeof name === 'object' && !options) {\n options = name;\n name = this.routeName;\n }\n\n options = options || {};\n\n var templateName;\n\n if (name) {\n name = name.replace(/\\//g, '.');\n templateName = name;\n } else {\n name = this.routeName;\n templateName = this.templateName || name;\n }\n\n var viewName = options.view || namePassed && name || this.viewName || name;\n\n var container = this.container,\n view = container.lookup('view:' + viewName),\n template = view ? view.get('template') : null;\n\n if (!template) {\n template = container.lookup('template:' + templateName);\n }\n\n if (!view && !template) {\n Ember.assert(\"Could not find \\\"\" + name + \"\\\" template or view.\", Ember.isEmpty(arguments[0]));\n if (get(this.router, 'namespace.LOG_VIEW_LOOKUPS')) {\n Ember.Logger.info(\"Could not find \\\"\" + name + \"\\\" template or view. Nothing will be rendered\", { fullName: 'template:' + name });\n }\n return;\n }\n\n options = normalizeOptions(this, name, template, options);\n view = setupView(view, container, options);\n\n if (options.outlet === 'main') { this.lastRenderedTemplate = name; }\n\n appendView(this, view, options);\n },\n\n /**\n Disconnects a view that has been rendered into an outlet.\n\n You may pass any or all of the following options to `disconnectOutlet`:\n\n * `outlet`: the name of the outlet to clear (default: 'main')\n * `parentView`: the name of the view containing the outlet to clear\n (default: the view rendered by the parent route)\n\n Example:\n\n ```js\n App.ApplicationRoute = App.Route.extend({\n actions: {\n showModal: function(evt) {\n this.render(evt.modalName, {\n outlet: 'modal',\n into: 'application'\n });\n },\n hideModal: function(evt) {\n this.disconnectOutlet({\n outlet: 'modal',\n parentView: 'application'\n });\n }\n }\n });\n ```\n\n Alternatively, you can pass the `outlet` name directly as a string.\n\n Example:\n\n ```js\n hideModal: function(evt) {\n this.disconnectOutlet('modal');\n }\n ```\n\n @method disconnectOutlet\n @param {Object|String} options the options hash or outlet name\n */\n disconnectOutlet: function(options) {\n if (!options || typeof options === \"string\") {\n var outletName = options;\n options = {};\n options.outlet = outletName;\n }\n options.parentView = options.parentView ? options.parentView.replace(/\\//g, '.') : parentTemplate(this);\n options.outlet = options.outlet || 'main';\n\n var parentView = this.router._lookupActiveView(options.parentView);\n if (parentView) { parentView.disconnectOutlet(options.outlet); }\n },\n\n willDestroy: function() {\n this.teardownViews();\n },\n\n /**\n @private\n\n @method teardownViews\n */\n teardownViews: function() {\n // Tear down the top level view\n if (this.teardownTopLevelView) { this.teardownTopLevelView(); }\n\n // Tear down any outlets rendered with 'into'\n var teardownOutletViews = this.teardownOutletViews || [];\n a_forEach(teardownOutletViews, function(teardownOutletView) {\n teardownOutletView();\n });\n\n delete this.teardownTopLevelView;\n delete this.teardownOutletViews;\n delete this.lastRenderedTemplate;\n }\n });\n\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n Route.reopen({\n /**\n Configuration hash for this route's queryParams. The possible\n configuration options and their defaults are as follows\n (assuming a query param whose URL key is `page`):\n\n ```js\n queryParams: {\n page: {\n // By default, controller query param properties don't\n // cause a full transition when they are changed, but\n // rather only cause the URL to update. Setting\n // `refreshModel` to true will cause an \"in-place\"\n // transition to occur, whereby the model hooks for\n // this route (and any child routes) will re-fire, allowing\n // you to reload models (e.g., from the server) using the\n // updated query param values.\n refreshModel: false,\n\n // By default, changes to controller query param properties\n // cause the URL to update via `pushState`, which means an\n // item will be added to the browser's history, allowing\n // you to use the back button to restore the app to the\n // previous state before the query param property was changed.\n // Setting `replace` to true will use `replaceState` (or its\n // hash location equivalent), which causes no browser history\n // item to be added. This options name and default value are\n // the same as the `link-to` helper's `replace` option.\n replace: false\n }\n }\n ```\n\n @property queryParams\n @for Ember.Route\n @type Hash\n */\n queryParams: {},\n\n _qp: computed(function() {\n var controllerName = this.controllerName || this.routeName,\n fullName = this.container.normalize('controller:' + controllerName),\n controllerClass = this.container.lookupFactory(fullName);\n\n if (!controllerClass) { return; }\n\n var controllerProto = controllerClass.proto(),\n queryParams = get(controllerProto, 'queryParams');\n\n if (!queryParams || queryParams.length === 0) { return; }\n\n var qps = [], map = {};\n for (var i = 0, len = queryParams.length; i < len; ++i) {\n var queryParamMapping = queryParams[i],\n parts = queryParamMapping.split(':'),\n propName = parts[0],\n urlKey = parts[1] || propName,\n defaultValue = get(controllerProto, propName),\n type = typeOf(defaultValue),\n defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type),\n qp = {\n def: defaultValue,\n sdef: defaultValueSerialized,\n type: type,\n urlKey: urlKey,\n prop: propName,\n ctrl: controllerName,\n value: defaultValue,\n svalue: defaultValueSerialized,\n route: this\n };\n\n // Construct all the different ways this query param\n // can be referenced, either from link-to or transitionTo:\n // - {{link-to (query-params page=5)}}\n // - {{link-to (query-params articles:page=5)}}\n // - {{link-to (query-params articles_page=5)}}\n // - {{link-to (query-params articles:articles_page=5)}}\n // - transitionTo({ queryParams: { page: 5 } })\n // ... etc.\n\n map[propName] = map[urlKey] = map[controllerName + ':' + propName] = qp;\n qps.push(qp);\n }\n\n return {\n qps: qps,\n map: map\n };\n }),\n\n mergedProperties: ['queryParams'],\n\n paramsFor: function(name) {\n var route = this.container.lookup('route:' + name);\n\n if (!route) {\n return {};\n }\n\n var transition = this.router.router.activeTransition,\n params, queryParams;\n\n if (transition) {\n params = transition.params[name] || {};\n queryParams = transition.queryParams;\n } else {\n var state = this.router.router.state;\n params = state.params[name] || {};\n queryParams = state.queryParams;\n }\n\n var qpMeta = get(route, '_qp');\n\n if (!qpMeta) {\n // No query params specified on the controller.\n return params;\n }\n\n var qps = qpMeta.qps, map = qpMeta.map, qp;\n\n // Loop through all the query params defined on the controller\n for (var i = 0, len = qps.length; i < len; ++i) {\n // Put deserialized qp on params hash.\n qp = qps[i];\n params[qp.urlKey] = qp.value;\n }\n\n // Override params hash values with any input query params\n // from the transition attempt.\n for (var urlKey in queryParams) {\n // Ignore any params not for this route.\n if (!(urlKey in map)) { continue; }\n\n var svalue = queryParams[urlKey];\n qp = map[urlKey];\n if (svalue === null) {\n // Query param was removed from address bar.\n svalue = qp.sdef;\n }\n\n // Deserialize and stash on params.\n params[urlKey] = route.deserializeQueryParam(svalue, urlKey, qp.type);\n }\n\n return params;\n },\n\n serializeQueryParam: function(value, urlKey, defaultValueType) {\n // urlKey isn't used here, but anyone overriding\n // can use it to provide serialization specific\n // to a certain query param.\n if (defaultValueType === 'array') {\n return JSON.stringify(value);\n }\n return '' + value;\n },\n\n deserializeQueryParam: function(value, urlKey, defaultValueType) {\n // urlKey isn't used here, but anyone overriding\n // can use it to provide deserialization specific\n // to a certain query param.\n\n // Use the defaultValueType of the default value (the initial value assigned to a\n // controller query param property), to intelligently deserialize and cast.\n if (defaultValueType === 'boolean') {\n return (value === 'true') ? true : false;\n } else if (defaultValueType === 'number') {\n return (Number(value)).valueOf();\n } else if (defaultValueType === 'array') {\n return Ember.A(JSON.parse(value));\n }\n return value;\n },\n\n _qpChanged: function(controller, propName) {\n // Normalize array observer firings.\n if (propName.slice(propName.length - 3) === '.[]') {\n propName = propName.substr(0, propName.length-3);\n }\n\n var qpMeta = get(this, '_qp'),\n qp = qpMeta.map[propName];\n\n if (controller._finalizingQueryParams) {\n var changes = controller._queryParamChangesDuringSuspension;\n if (changes) {\n changes[qp.urlKey] = true;\n }\n return;\n }\n\n var value = copy(get(controller, propName));\n\n this.router._queuedQPChanges[qp.prop] = value;\n run.once(this, this._fireQueryParamTransition);\n },\n\n _fireQueryParamTransition: function() {\n this.transitionTo({ queryParams: this.router._queuedQPChanges });\n this.router._queuedQPChanges = {};\n }\n });\n }\n\n function parentRoute(route) {\n var handlerInfos = route.router.router.state.handlerInfos;\n\n if (!handlerInfos) { return; }\n\n var parent, current;\n\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n current = handlerInfos[i].handler;\n if (current === route) { return parent; }\n parent = current;\n }\n }\n\n function parentTemplate(route) {\n var parent = parentRoute(route), template;\n\n if (!parent) { return; }\n\n if (template = parent.lastRenderedTemplate) {\n return template;\n } else {\n return parentTemplate(parent);\n }\n }\n\n function normalizeOptions(route, name, template, options) {\n options = options || {};\n options.into = options.into ? options.into.replace(/\\//g, '.') : parentTemplate(route);\n options.outlet = options.outlet || 'main';\n options.name = name;\n options.template = template;\n options.LOG_VIEW_LOOKUPS = get(route.router, 'namespace.LOG_VIEW_LOOKUPS');\n\n Ember.assert(\"An outlet (\"+options.outlet+\") was specified but was not found.\", options.outlet === 'main' || options.into);\n\n var controller = options.controller,\n model = options.model,\n namedController;\n\n if (options.controller) {\n controller = options.controller;\n } else if (namedController = route.container.lookup('controller:' + name)) {\n controller = namedController;\n } else {\n controller = route.controllerName || route.routeName;\n }\n\n if (typeof controller === 'string') {\n var controllerName = controller;\n controller = route.container.lookup('controller:' + controllerName);\n if (!controller) {\n throw new EmberError(\"You passed `controller: '\" + controllerName + \"'` into the `render` method, but no such controller could be found.\");\n }\n }\n\n if (model) {\n controller.set('model', model);\n }\n\n options.controller = controller;\n\n return options;\n }\n\n function setupView(view, container, options) {\n if (view) {\n if (options.LOG_VIEW_LOOKUPS) {\n Ember.Logger.info(\"Rendering \" + options.name + \" with \" + view, { fullName: 'view:' + options.name });\n }\n } else {\n var defaultView = options.into ? 'view:default' : 'view:toplevel';\n view = container.lookup(defaultView);\n if (options.LOG_VIEW_LOOKUPS) {\n Ember.Logger.info(\"Rendering \" + options.name + \" with default view \" + view, { fullName: 'view:' + options.name });\n }\n }\n\n if (!get(view, 'templateName')) {\n set(view, 'template', options.template);\n\n set(view, '_debugTemplateName', options.name);\n }\n\n set(view, 'renderedName', options.name);\n set(view, 'controller', options.controller);\n\n return view;\n }\n\n function appendView(route, view, options) {\n if (options.into) {\n var parentView = route.router._lookupActiveView(options.into);\n var teardownOutletView = generateOutletTeardown(parentView, options.outlet);\n if (!route.teardownOutletViews) { route.teardownOutletViews = []; }\n a_replace(route.teardownOutletViews, 0, 0, [teardownOutletView]);\n parentView.connectOutlet(options.outlet, view);\n } else {\n var rootElement = get(route, 'router.namespace.rootElement');\n // tear down view if one is already rendered\n if (route.teardownTopLevelView) {\n route.teardownTopLevelView();\n }\n route.router._connectActiveView(options.name, view);\n route.teardownTopLevelView = generateTopLevelTeardown(view);\n view.appendTo(rootElement);\n }\n }\n\n function generateTopLevelTeardown(view) {\n return function() { view.destroy(); };\n }\n\n function generateOutletTeardown(parentView, outlet) {\n return function() { parentView.disconnectOutlet(outlet); };\n }\n\n function toggleQueryParamObservers(route, controller, enable) {\n var queryParams = get(controller, 'queryParams'), i, len,\n method = enable ? 'addObserver' : 'removeObserver';\n\n for (i = 0, len = queryParams.length; i < len; ++i) {\n var prop = queryParams[i].split(':')[0];\n controller[method](prop, route, route._qpChanged);\n controller[method](prop + '.[]', route, route._qpChanged);\n }\n }\n\n __exports__[\"default\"] = Route;\n });\ndefine(\"ember-routing/system/router\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/array\",\"ember-metal/properties\",\"ember-metal/computed\",\"ember-metal/merge\",\"ember-metal/run_loop\",\"ember-metal/enumerable_utils\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-runtime/mixins/evented\",\"ember-routing/system/dsl\",\"ember-views/views/view\",\"ember-routing/location/api\",\"ember-handlebars/views/metamorph_view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // FEATURES, Logger, K, assert\n var EmberError = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var forEach = __dependency5__.forEach;\n var defineProperty = __dependency6__.defineProperty;\n var computed = __dependency7__.computed;\n var merge = __dependency8__[\"default\"];\n var run = __dependency9__[\"default\"];\n var EnumerableUtils = __dependency10__[\"default\"];\n\n var fmt = __dependency11__.fmt;\n var EmberObject = __dependency12__[\"default\"];\n var Evented = __dependency13__[\"default\"];\n var EmberRouterDSL = __dependency14__[\"default\"];\n var EmberView = __dependency15__.View;\n var EmberLocation = __dependency16__[\"default\"];\n var _MetamorphView = __dependency17__._MetamorphView;\n\n // requireModule(\"ember-handlebars\");\n // requireModule(\"ember-runtime\");\n // requireModule(\"ember-views\");\n\n /**\n @module ember\n @submodule ember-routing\n */\n\n // // side effect of loading some Ember globals, for now\n // requireModule(\"ember-handlebars\");\n // requireModule(\"ember-runtime\");\n // requireModule(\"ember-views\");\n\n var Router = requireModule(\"router\")['default'];\n var Transition = requireModule(\"router/transition\").Transition;\n\n var slice = [].slice;\n var forEach = EnumerableUtils.forEach;\n\n var DefaultView = _MetamorphView;\n\n /**\n The `Ember.Router` class manages the application state and URLs. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Router\n @namespace Ember\n @extends Ember.Object\n */\n var EmberRouter = EmberObject.extend(Evented, {\n /**\n The `location` property determines the type of URL's that your\n application will use.\n\n The following location types are currently available:\n\n * `hash`\n * `history`\n * `none`\n\n @property location\n @default 'hash'\n @see {Ember.Location}\n */\n location: 'hash',\n\n /**\n Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n init: function() {\n this.router = this.constructor.router || this.constructor.map(Ember.K);\n this._activeViews = {};\n this._setupLocation();\n this._qpCache = {};\n this._queuedQPChanges = {};\n\n if (get(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) {\n this.router.log = Ember.Logger.debug;\n }\n },\n\n /**\n Represents the current URL.\n\n @method url\n @return {String} The current URL.\n */\n url: computed(function() {\n return get(this, 'location').getURL();\n }),\n\n /**\n Initializes the current router instance and sets up the change handling\n event listeners used by the instances `location` implementation.\n\n A property named `initialURL` will be used to determine the initial URL.\n If no value is found `/` will be used.\n\n @method startRouting\n @private\n */\n startRouting: function() {\n this.router = this.router || this.constructor.map(Ember.K);\n\n var router = this.router,\n location = get(this, 'location'),\n container = this.container,\n self = this,\n initialURL = get(this, 'initialURL');\n\n // Allow the Location class to cancel the router setup while it refreshes\n // the page\n if (get(location, 'cancelRouterSetup')) {\n return;\n }\n\n this._setupRouter(router, location);\n\n container.register('view:default', DefaultView);\n container.register('view:toplevel', EmberView.extend());\n\n location.onUpdateURL(function(url) {\n self.handleURL(url);\n });\n\n if (typeof initialURL === \"undefined\") {\n initialURL = location.getURL();\n }\n\n this.handleURL(initialURL);\n },\n\n /**\n Handles updating the paths and notifying any listeners of the URL\n change.\n\n Triggers the router level `didTransition` hook.\n\n @method didTransition\n @private\n @since 1.2.0\n */\n didTransition: function(infos) {\n updatePaths(this);\n\n this._cancelLoadingEvent();\n\n this.notifyPropertyChange('url');\n\n // Put this in the runloop so url will be accurate. Seems\n // less surprising than didTransition being out of sync.\n run.once(this, this.trigger, 'didTransition');\n\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Transitioned into '\" + EmberRouter._routePath(infos) + \"'\");\n }\n },\n\n handleURL: function(url) {\n return this._doTransition('handleURL', [url]);\n },\n\n transitionTo: function() {\n return this._doTransition('transitionTo', arguments);\n },\n\n intermediateTransitionTo: function() {\n this.router.intermediateTransitionTo.apply(this.router, arguments);\n\n updatePaths(this);\n\n var infos = this.router.currentHandlerInfos;\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Intermediate-transitioned into '\" + EmberRouter._routePath(infos) + \"'\");\n }\n },\n\n replaceWith: function() {\n return this._doTransition('replaceWith', arguments);\n },\n\n generate: function() {\n var url = this.router.generate.apply(this.router, arguments);\n return this.location.formatURL(url);\n },\n\n /**\n Determines if the supplied route is currently active.\n\n @method isActive\n @param routeName\n @return {Boolean}\n @private\n */\n isActive: function(routeName) {\n var router = this.router;\n return router.isActive.apply(router, arguments);\n },\n\n send: function(name, context) {\n this.router.trigger.apply(this.router, arguments);\n },\n\n /**\n Does this router instance have the given route.\n\n @method hasRoute\n @return {Boolean}\n @private\n */\n hasRoute: function(route) {\n return this.router.hasRoute(route);\n },\n\n /**\n Resets the state of the router by clearing the current route\n handlers and deactivating them.\n\n @private\n @method reset\n */\n reset: function() {\n this.router.reset();\n },\n\n _lookupActiveView: function(templateName) {\n var active = this._activeViews[templateName];\n return active && active[0];\n },\n\n _connectActiveView: function(templateName, view) {\n var existing = this._activeViews[templateName];\n\n if (existing) {\n existing[0].off('willDestroyElement', this, existing[1]);\n }\n\n function disconnectActiveView() {\n delete this._activeViews[templateName];\n }\n\n this._activeViews[templateName] = [view, disconnectActiveView];\n view.one('willDestroyElement', this, disconnectActiveView);\n },\n\n _setupLocation: function() {\n var location = get(this, 'location'),\n rootURL = get(this, 'rootURL');\n\n if (rootURL && !this.container.has('-location-setting:root-url')) {\n this.container.register('-location-setting:root-url', rootURL, { instantiate: false });\n }\n\n if ('string' === typeof location && this.container) {\n var resolvedLocation = this.container.lookup('location:' + location);\n\n if ('undefined' !== typeof resolvedLocation) {\n location = set(this, 'location', resolvedLocation);\n } else {\n // Allow for deprecated registration of custom location API's\n var options = {implementation: location};\n\n location = set(this, 'location', EmberLocation.create(options));\n }\n }\n\n if (rootURL && typeof rootURL === 'string') {\n location.rootURL = rootURL;\n }\n\n // ensure that initState is called AFTER the rootURL is set on\n // the location instance\n if (typeof location.initState === 'function') { location.initState(); }\n },\n\n _getHandlerFunction: function() {\n var seen = {}, container = this.container,\n DefaultRoute = container.lookupFactory('route:basic'),\n self = this;\n\n return function(name) {\n var routeName = 'route:' + name,\n handler = container.lookup(routeName);\n\n if (seen[name]) { return handler; }\n\n seen[name] = true;\n\n if (!handler) {\n container.register(routeName, DefaultRoute.extend());\n handler = container.lookup(routeName);\n\n if (get(self, 'namespace.LOG_ACTIVE_GENERATION')) {\n Ember.Logger.info(\"generated -> \" + routeName, { fullName: routeName });\n }\n }\n\n handler.routeName = name;\n return handler;\n };\n },\n\n _setupRouter: function(router, location) {\n var lastURL, emberRouter = this;\n\n router.getHandler = this._getHandlerFunction();\n\n var doUpdateURL = function() {\n location.setURL(lastURL);\n };\n\n router.updateURL = function(path) {\n lastURL = path;\n run.once(doUpdateURL);\n };\n\n if (location.replaceURL) {\n var doReplaceURL = function() {\n location.replaceURL(lastURL);\n };\n\n router.replaceURL = function(path) {\n lastURL = path;\n run.once(doReplaceURL);\n };\n }\n\n router.didTransition = function(infos) {\n emberRouter.didTransition(infos);\n };\n },\n\n _doTransition: function(method, args) {\n // Normalize blank route to root URL.\n args = slice.call(args);\n args[0] = args[0] || '/';\n\n var name = args[0], self = this,\n isQueryParamsOnly = false, queryParams;\n\n if (Ember.FEATURES.isEnabled(\"query-params-new\")) {\n\n var possibleQueryParamArg = args[args.length - 1];\n if (possibleQueryParamArg && possibleQueryParamArg.hasOwnProperty('queryParams')) {\n if (args.length === 1) {\n isQueryParamsOnly = true;\n name = null;\n }\n queryParams = args[args.length - 1].queryParams;\n }\n }\n\n if (!isQueryParamsOnly && name.charAt(0) !== '/') {\n Ember.assert(\"The route \" + name + \" was not found\", this.router.hasRoute(name));\n }\n\n if (queryParams) {\n // router.js expects queryParams to be passed in in\n // their final serialized form, so we need to translate.\n\n if (!name) {\n // Need to determine destination route name.\n var handlerInfos = this.router.activeTransition ?\n this.router.activeTransition.state.handlerInfos :\n this.router.state.handlerInfos;\n name = handlerInfos[handlerInfos.length - 1].name;\n args.unshift(name);\n }\n\n var qpCache = this._queryParamsFor(name), qps = qpCache.qps;\n\n var finalParams = {};\n for (var key in queryParams) {\n if (!queryParams.hasOwnProperty(key)) { continue; }\n var inputValue = queryParams[key],\n qp = qpCache.map[key];\n\n if (!qp) {\n throw new EmberError(\"Unrecognized query param \" + key + \" provided as transition argument\");\n }\n finalParams[qp.urlKey] = qp.route.serializeQueryParam(inputValue, qp.urlKey, qp.type);\n }\n\n // Perform any necessary serialization.\n args[args.length-1].queryParams = finalParams;\n }\n\n var transitionPromise = this.router[method].apply(this.router, args);\n\n transitionPromise.then(null, function(error) {\n if (!error || !error.name) { return; }\n\n if (error.name === \"UnrecognizedURLError\") {\n Ember.assert(\"The URL '\" + error.message + \"' did not match any routes in your application\");\n } else if (error.name === 'TransitionAborted') {\n // just ignore TransitionAborted here\n } else {\n logError(error);\n }\n\n return error;\n }, 'Ember: Process errors from Router');\n\n // We want to return the configurable promise object\n // so that callers of this function can use `.method()` on it,\n // which obviously doesn't exist for normal RSVP promises.\n return transitionPromise;\n },\n\n _queryParamsFor: function(leafRouteName) {\n if (this._qpCache[leafRouteName]) {\n return this._qpCache[leafRouteName];\n }\n\n var map = {}, qps = [], qpCache = this._qpCache[leafRouteName] = {\n map: map,\n qps: qps\n };\n\n var routerjs = this.router,\n recogHandlerInfos = routerjs.recognizer.handlersFor(leafRouteName);\n\n for (var i = 0, len = recogHandlerInfos.length; i < len; ++i) {\n var recogHandler = recogHandlerInfos[i],\n route = routerjs.getHandler(recogHandler.handler),\n qpMeta = get(route, '_qp');\n\n if (!qpMeta) { continue; }\n\n merge(map, qpMeta.map);\n qps.push.apply(qps, qpMeta.qps);\n }\n\n return {\n qps: qps,\n map: map\n };\n },\n\n _scheduleLoadingEvent: function(transition, originRoute) {\n this._cancelLoadingEvent();\n this._loadingStateTimer = run.scheduleOnce('routerTransitions', this, '_fireLoadingEvent', transition, originRoute);\n },\n\n _fireLoadingEvent: function(transition, originRoute) {\n if (!this.router.activeTransition) {\n // Don't fire an event if we've since moved on from\n // the transition that put us in a loading state.\n return;\n }\n\n transition.trigger(true, 'loading', transition, originRoute);\n },\n\n _cancelLoadingEvent: function () {\n if (this._loadingStateTimer) {\n run.cancel(this._loadingStateTimer);\n }\n this._loadingStateTimer = null;\n }\n });\n\n function controllerOrProtoFor(controllerName, container, getProto) {\n var fullName = container.normalize('controller:' + controllerName);\n if (!getProto && container.cache.has(fullName)) {\n return container.lookup(fullName);\n } else {\n // Controller hasn't been instantiated yet; just return its proto.\n var controllerClass = container.lookupFactory(fullName);\n if (controllerClass && typeof controllerClass.proto === 'function') {\n return controllerClass.proto();\n } else {\n return {};\n }\n }\n }\n\n /*\n Helper function for iterating root-ward, starting\n from (but not including) the provided `originRoute`.\n\n Returns true if the last callback fired requested\n to bubble upward.\n\n @private\n */\n function forEachRouteAbove(originRoute, transition, callback) {\n var handlerInfos = transition.state.handlerInfos,\n originRouteFound = false;\n\n for (var i = handlerInfos.length - 1; i >= 0; --i) {\n var handlerInfo = handlerInfos[i],\n route = handlerInfo.handler;\n\n if (!originRouteFound) {\n if (originRoute === route) {\n originRouteFound = true;\n }\n continue;\n }\n\n if (callback(route, handlerInfos[i + 1].handler) !== true) {\n return false;\n }\n }\n return true;\n }\n\n // These get invoked when an action bubbles above ApplicationRoute\n // and are not meant to be overridable.\n var defaultActionHandlers = {\n\n willResolveModel: function(transition, originRoute) {\n originRoute.router._scheduleLoadingEvent(transition, originRoute);\n },\n\n error: function(error, transition, originRoute) {\n // Attempt to find an appropriate error substate to enter.\n var router = originRoute.router;\n\n var tryTopLevel = forEachRouteAbove(originRoute, transition, function(route, childRoute) {\n var childErrorRouteName = findChildRouteName(route, childRoute, 'error');\n if (childErrorRouteName) {\n router.intermediateTransitionTo(childErrorRouteName, error);\n return;\n }\n return true;\n });\n\n if (tryTopLevel) {\n // Check for top-level error state to enter.\n if (routeHasBeenDefined(originRoute.router, 'application_error')) {\n router.intermediateTransitionTo('application_error', error);\n return;\n }\n } else {\n // Don't fire an assertion if we found an error substate.\n return;\n }\n\n logError(error, 'Error while processing route: ' + transition.targetName);\n },\n\n loading: function(transition, originRoute) {\n // Attempt to find an appropriate loading substate to enter.\n var router = originRoute.router;\n\n var tryTopLevel = forEachRouteAbove(originRoute, transition, function(route, childRoute) {\n var childLoadingRouteName = findChildRouteName(route, childRoute, 'loading');\n\n if (childLoadingRouteName) {\n router.intermediateTransitionTo(childLoadingRouteName);\n return;\n }\n\n // Don't bubble above pivot route.\n if (transition.pivotHandler !== route) {\n return true;\n }\n });\n\n if (tryTopLevel) {\n // Check for top-level loading state to enter.\n if (routeHasBeenDefined(originRoute.router, 'application_loading')) {\n router.intermediateTransitionTo('application_loading');\n return;\n }\n }\n }\n };\n\n function logError(error, initialMessage) {\n var errorArgs = [];\n\n if (initialMessage) { errorArgs.push(initialMessage); }\n\n if (error) {\n if (error.message) { errorArgs.push(error.message); }\n if (error.stack) { errorArgs.push(error.stack); }\n\n if (typeof error === \"string\") { errorArgs.push(error); }\n }\n\n Ember.Logger.error.apply(this, errorArgs);\n }\n\n function findChildRouteName(parentRoute, originatingChildRoute, name) {\n var router = parentRoute.router,\n childName,\n targetChildRouteName = originatingChildRoute.routeName.split('.').pop(),\n namespace = parentRoute.routeName === 'application' ? '' : parentRoute.routeName + '.';\n\n if (Ember.FEATURES.isEnabled(\"ember-routing-named-substates\")) {\n // First, try a named loading state, e.g. 'foo_loading'\n childName = namespace + targetChildRouteName + '_' + name;\n if (routeHasBeenDefined(router, childName)) {\n return childName;\n }\n }\n\n // Second, try general loading state, e.g. 'loading'\n childName = namespace + name;\n if (routeHasBeenDefined(router, childName)) {\n return childName;\n }\n }\n\n function routeHasBeenDefined(router, name) {\n var container = router.container;\n return router.hasRoute(name) &&\n (container.has('template:' + name) || container.has('route:' + name));\n }\n\n function triggerEvent(handlerInfos, ignoreFailure, args) {\n var name = args.shift();\n\n if (!handlerInfos) {\n if (ignoreFailure) { return; }\n throw new EmberError(\"Can't trigger action '\" + name + \"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.\");\n }\n\n var eventWasHandled = false;\n\n for (var i = handlerInfos.length - 1; i >= 0; i--) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler._actions && handler._actions[name]) {\n if (handler._actions[name].apply(handler, args) === true) {\n eventWasHandled = true;\n } else {\n return;\n }\n }\n }\n\n if (defaultActionHandlers[name]) {\n defaultActionHandlers[name].apply(null, args);\n return;\n }\n\n if (!eventWasHandled && !ignoreFailure) {\n throw new EmberError(\"Nothing handled the action '\" + name + \"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.\");\n }\n }\n\n function updatePaths(router) {\n var appController = router.container.lookup('controller:application');\n\n if (!appController) {\n // appController might not exist when top-level loading/error\n // substates have been entered since ApplicationRoute hasn't\n // actually been entered at that point.\n return;\n }\n\n var infos = router.router.currentHandlerInfos,\n path = EmberRouter._routePath(infos);\n\n if (!('currentPath' in appController)) {\n defineProperty(appController, 'currentPath');\n }\n\n set(appController, 'currentPath', path);\n\n if (!('currentRouteName' in appController)) {\n defineProperty(appController, 'currentRouteName');\n }\n\n set(appController, 'currentRouteName', infos[infos.length - 1].name);\n }\n\n EmberRouter.reopenClass({\n router: null,\n map: function(callback) {\n var router = this.router;\n if (!router) {\n router = new Router();\n router.callbacks = [];\n router.triggerEvent = triggerEvent;\n this.reopenClass({ router: router });\n }\n\n var dsl = EmberRouterDSL.map(function() {\n this.resource('application', { path: \"/\" }, function() {\n for (var i=0; i < router.callbacks.length; i++) {\n router.callbacks[i].call(this);\n }\n callback.call(this);\n });\n });\n\n router.callbacks.push(callback);\n router.map(dsl.generate());\n return router;\n },\n\n _routePath: function(handlerInfos) {\n var path = [];\n\n // We have to handle coalescing resource names that\n // are prefixed with their parent's names, e.g.\n // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz'\n\n function intersectionMatches(a1, a2) {\n for (var i = 0, len = a1.length; i < len; ++i) {\n if (a1[i] !== a2[i]) {\n return false;\n }\n }\n return true;\n }\n\n for (var i=1, l=handlerInfos.length; i<l; i++) {\n var name = handlerInfos[i].name,\n nameParts = name.split(\".\"),\n oldNameParts = slice.call(path);\n\n while (oldNameParts.length) {\n if (intersectionMatches(oldNameParts, nameParts)) {\n break;\n }\n oldNameParts.shift();\n }\n\n path.push.apply(path, nameParts.slice(oldNameParts.length));\n }\n\n return path.join(\".\");\n }\n });\n\n __exports__[\"default\"] = EmberRouter;\n });\ndefine(\"route-recognizer\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var specials = [\n '/', '.', '*', '+', '?', '|',\n '(', ')', '[', ']', '{', '}', '\\\\'\n ];\n\n var escapeRegex = new RegExp('(\\\\' + specials.join('|\\\\') + ')', 'g');\n\n function isArray(test) {\n return Object.prototype.toString.call(test) === \"[object Array]\";\n }\n\n // A Segment represents a segment in the original route description.\n // Each Segment type provides an `eachChar` and `regex` method.\n //\n // The `eachChar` method invokes the callback with one or more character\n // specifications. A character specification consumes one or more input\n // characters.\n //\n // The `regex` method returns a regex fragment for the segment. If the\n // segment is a dynamic of star segment, the regex fragment also includes\n // a capture.\n //\n // A character specification contains:\n //\n // * `validChars`: a String with a list of all valid characters, or\n // * `invalidChars`: a String with a list of all invalid characters\n // * `repeat`: true if the character specification can repeat\n\n function StaticSegment(string) { this.string = string; }\n StaticSegment.prototype = {\n eachChar: function(callback) {\n var string = this.string, ch;\n\n for (var i=0, l=string.length; i<l; i++) {\n ch = string.charAt(i);\n callback({ validChars: ch });\n }\n },\n\n regex: function() {\n return this.string.replace(escapeRegex, '\\\\$1');\n },\n\n generate: function() {\n return this.string;\n }\n };\n\n function DynamicSegment(name) { this.name = name; }\n DynamicSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"/\", repeat: true });\n },\n\n regex: function() {\n return \"([^/]+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function StarSegment(name) { this.name = name; }\n StarSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"\", repeat: true });\n },\n\n regex: function() {\n return \"(.+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function EpsilonSegment() {}\n EpsilonSegment.prototype = {\n eachChar: function() {},\n regex: function() { return \"\"; },\n generate: function() { return \"\"; }\n };\n\n function parse(route, names, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.charAt(0) === \"/\") { route = route.substr(1); }\n\n var segments = route.split(\"/\"), results = [];\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i], match;\n\n if (match = segment.match(/^:([^\\/]+)$/)) {\n results.push(new DynamicSegment(match[1]));\n names.push(match[1]);\n types.dynamics++;\n } else if (match = segment.match(/^\\*([^\\/]+)$/)) {\n results.push(new StarSegment(match[1]));\n names.push(match[1]);\n types.stars++;\n } else if(segment === \"\") {\n results.push(new EpsilonSegment());\n } else {\n results.push(new StaticSegment(segment));\n types.statics++;\n }\n }\n\n return results;\n }\n\n // A State has a character specification and (`charSpec`) and a list of possible\n // subsequent states (`nextStates`).\n //\n // If a State is an accepting state, it will also have several additional\n // properties:\n //\n // * `regex`: A regular expression that is used to extract parameters from paths\n // that reached this accepting state.\n // * `handlers`: Information on how to convert the list of captures into calls\n // to registered handlers with the specified parameters\n // * `types`: How many static, dynamic or star segments in this route. Used to\n // decide which route to use if multiple registered routes match a path.\n //\n // Currently, State is implemented naively by looping over `nextStates` and\n // comparing a character specification against a character. A more efficient\n // implementation would use a hash of keys pointing at one or more next states.\n\n function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }\n\n State.prototype = {\n get: function(charSpec) {\n var nextStates = this.nextStates;\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n var child = nextStates[i];\n\n var isEqual = child.charSpec.validChars === charSpec.validChars;\n isEqual = isEqual && child.charSpec.invalidChars === charSpec.invalidChars;\n\n if (isEqual) { return child; }\n }\n },\n\n put: function(charSpec) {\n var state;\n\n // If the character specification already exists in a child of the current\n // state, just return that state.\n if (state = this.get(charSpec)) { return state; }\n\n // Make a new state for the character spec\n state = new State(charSpec);\n\n // Insert the new state as a child of the current state\n this.nextStates.push(state);\n\n // If this character specification repeats, insert the new state as a child\n // of itself. Note that this will not trigger an infinite loop because each\n // transition during recognition consumes a character.\n if (charSpec.repeat) {\n state.nextStates.push(state);\n }\n\n // Return the new state\n return state;\n },\n\n // Find a list of child states matching the next character\n match: function(ch) {\n // DEBUG \"Processing `\" + ch + \"`:\"\n var nextStates = this.nextStates,\n child, charSpec, chars;\n\n // DEBUG \" \" + debugState(this)\n var returned = [];\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n child = nextStates[i];\n\n charSpec = child.charSpec;\n\n if (typeof (chars = charSpec.validChars) !== 'undefined') {\n if (chars.indexOf(ch) !== -1) { returned.push(child); }\n } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') {\n if (chars.indexOf(ch) === -1) { returned.push(child); }\n }\n }\n\n return returned;\n }\n\n /** IF DEBUG\n , debug: function() {\n var charSpec = this.charSpec,\n debug = \"[\",\n chars = charSpec.validChars || charSpec.invalidChars;\n\n if (charSpec.invalidChars) { debug += \"^\"; }\n debug += chars;\n debug += \"]\";\n\n if (charSpec.repeat) { debug += \"+\"; }\n\n return debug;\n }\n END IF **/\n };\n\n /** IF DEBUG\n function debug(log) {\n console.log(log);\n }\n\n function debugState(state) {\n return state.nextStates.map(function(n) {\n if (n.nextStates.length === 0) { return \"( \" + n.debug() + \" [accepting] )\"; }\n return \"( \" + n.debug() + \" <then> \" + n.nextStates.map(function(s) { return s.debug() }).join(\" or \") + \" )\";\n }).join(\", \")\n }\n END IF **/\n\n // This is a somewhat naive strategy, but should work in a lot of cases\n // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id.\n //\n // This strategy generally prefers more static and less dynamic matching.\n // Specifically, it\n //\n // * prefers fewer stars to more, then\n // * prefers using stars for less of the match to more, then\n // * prefers fewer dynamic segments to more, then\n // * prefers more static segments to more\n function sortSolutions(states) {\n return states.sort(function(a, b) {\n if (a.types.stars !== b.types.stars) { return a.types.stars - b.types.stars; }\n\n if (a.types.stars) {\n if (a.types.statics !== b.types.statics) { return b.types.statics - a.types.statics; }\n if (a.types.dynamics !== b.types.dynamics) { return b.types.dynamics - a.types.dynamics; }\n }\n\n if (a.types.dynamics !== b.types.dynamics) { return a.types.dynamics - b.types.dynamics; }\n if (a.types.statics !== b.types.statics) { return b.types.statics - a.types.statics; }\n\n return 0;\n });\n }\n\n function recognizeChar(states, ch) {\n var nextStates = [];\n\n for (var i=0, l=states.length; i<l; i++) {\n var state = states[i];\n\n nextStates = nextStates.concat(state.match(ch));\n }\n\n return nextStates;\n }\n\n var oCreate = Object.create || function(proto) {\n function F() {}\n F.prototype = proto;\n return new F();\n };\n\n function RecognizeResults(queryParams) {\n this.queryParams = queryParams || {};\n }\n RecognizeResults.prototype = oCreate({\n splice: Array.prototype.splice,\n slice: Array.prototype.slice,\n push: Array.prototype.push,\n length: 0,\n queryParams: null\n });\n\n function findHandler(state, path, queryParams) {\n var handlers = state.handlers, regex = state.regex;\n var captures = path.match(regex), currentCapture = 1;\n var result = new RecognizeResults(queryParams);\n\n for (var i=0, l=handlers.length; i<l; i++) {\n var handler = handlers[i], names = handler.names, params = {};\n\n for (var j=0, m=names.length; j<m; j++) {\n params[names[j]] = captures[currentCapture++];\n }\n\n result.push({ handler: handler.handler, params: params, isDynamic: !!names.length });\n }\n\n return result;\n }\n\n function addSegment(currentState, segment) {\n segment.eachChar(function(ch) {\n var state;\n\n currentState = currentState.put(ch);\n });\n\n return currentState;\n }\n\n // The main interface\n\n var RouteRecognizer = function() {\n this.rootState = new State();\n this.names = {};\n };\n\n\n RouteRecognizer.prototype = {\n add: function(routes, options) {\n var currentState = this.rootState, regex = \"^\",\n types = { statics: 0, dynamics: 0, stars: 0 },\n handlers = [], allSegments = [], name;\n\n var isEmpty = true;\n\n for (var i=0, l=routes.length; i<l; i++) {\n var route = routes[i], names = [];\n\n var segments = parse(route.path, names, types);\n\n allSegments = allSegments.concat(segments);\n\n for (var j=0, m=segments.length; j<m; j++) {\n var segment = segments[j];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n isEmpty = false;\n\n // Add a \"/\" for the new segment\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n\n // Add a representation of the segment to the NFA and regex\n currentState = addSegment(currentState, segment);\n regex += segment.regex();\n }\n\n var handler = { handler: route.handler, names: names };\n handlers.push(handler);\n }\n\n if (isEmpty) {\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n }\n\n currentState.handlers = handlers;\n currentState.regex = new RegExp(regex + \"$\");\n currentState.types = types;\n\n if (name = options && options.as) {\n this.names[name] = {\n segments: allSegments,\n handlers: handlers\n };\n }\n },\n\n handlersFor: function(name) {\n var route = this.names[name], result = [];\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n for (var i=0, l=route.handlers.length; i<l; i++) {\n result.push(route.handlers[i]);\n }\n\n return result;\n },\n\n hasRoute: function(name) {\n return !!this.names[name];\n },\n\n generate: function(name, params) {\n var route = this.names[name], output = \"\";\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n var segments = route.segments;\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n output += \"/\";\n output += segment.generate(params);\n }\n\n if (output.charAt(0) !== '/') { output = '/' + output; }\n\n if (params && params.queryParams) {\n output += this.generateQueryString(params.queryParams, route.handlers);\n }\n\n return output;\n },\n\n generateQueryString: function(params, handlers) {\n var pairs = [];\n var keys = [];\n for(var key in params) {\n if (params.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n keys.sort();\n for (var i = 0, len = keys.length; i < len; i++) {\n key = keys[i];\n var value = params[key];\n if (value == null) {\n continue;\n }\n var pair = key;\n if (isArray(value)) {\n for (var j = 0, l = value.length; j < l; j++) {\n var arrayPair = key + '[]' + '=' + encodeURIComponent(value[j]);\n pairs.push(arrayPair);\n }\n } else {\n pair += \"=\" + encodeURIComponent(value);\n pairs.push(pair);\n }\n }\n\n if (pairs.length === 0) { return ''; }\n\n return \"?\" + pairs.join(\"&\");\n },\n\n parseQueryString: function(queryString) {\n var pairs = queryString.split(\"&\"), queryParams = {};\n for(var i=0; i < pairs.length; i++) {\n var pair = pairs[i].split('='),\n key = decodeURIComponent(pair[0]),\n keyLength = key.length,\n isArray = false,\n value;\n if (pair.length === 1) {\n value = 'true';\n } else {\n //Handle arrays\n if (keyLength > 2 && key.slice(keyLength -2) === '[]') {\n isArray = true;\n key = key.slice(0, keyLength - 2);\n if(!queryParams[key]) {\n queryParams[key] = [];\n }\n }\n value = pair[1] ? decodeURIComponent(pair[1]) : '';\n }\n if (isArray) {\n queryParams[key].push(value);\n } else {\n queryParams[key] = decodeURIComponent(value);\n }\n }\n return queryParams;\n },\n\n recognize: function(path) {\n var states = [ this.rootState ],\n pathLen, i, l, queryStart, queryParams = {},\n isSlashDropped = false;\n\n path = decodeURI(path);\n\n queryStart = path.indexOf('?');\n if (queryStart !== -1) {\n var queryString = path.substr(queryStart + 1, path.length);\n path = path.substr(0, queryStart);\n queryParams = this.parseQueryString(queryString);\n }\n\n // DEBUG GROUP path\n\n if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\n pathLen = path.length;\n if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n path = path.substr(0, pathLen - 1);\n isSlashDropped = true;\n }\n\n for (i=0, l=path.length; i<l; i++) {\n states = recognizeChar(states, path.charAt(i));\n if (!states.length) { break; }\n }\n\n // END DEBUG GROUP\n\n var solutions = [];\n for (i=0, l=states.length; i<l; i++) {\n if (states[i].handlers) { solutions.push(states[i]); }\n }\n\n states = sortSolutions(solutions);\n\n var state = solutions[0];\n\n if (state && state.handlers) {\n // if a trailing slash was dropped and a star segment is the last segment\n // specified, put the trailing slash back\n if (isSlashDropped && state.regex.source.slice(-5) === \"(.+)$\") {\n path = path + \"/\";\n }\n return findHandler(state, path, queryParams);\n }\n }\n };\n\n __exports__[\"default\"] = RouteRecognizer;\n\n function Target(path, matcher, delegate) {\n this.path = path;\n this.matcher = matcher;\n this.delegate = delegate;\n }\n\n Target.prototype = {\n to: function(target, callback) {\n var delegate = this.delegate;\n\n if (delegate && delegate.willAddRoute) {\n target = delegate.willAddRoute(this.matcher.target, target);\n }\n\n this.matcher.add(this.path, target);\n\n if (callback) {\n if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n this.matcher.addChild(this.path, target, callback, this.delegate);\n }\n return this;\n }\n };\n\n function Matcher(target) {\n this.routes = {};\n this.children = {};\n this.target = target;\n }\n\n Matcher.prototype = {\n add: function(path, handler) {\n this.routes[path] = handler;\n },\n\n addChild: function(path, target, callback, delegate) {\n var matcher = new Matcher(target);\n this.children[path] = matcher;\n\n var match = generateMatch(path, matcher, delegate);\n\n if (delegate && delegate.contextEntered) {\n delegate.contextEntered(target, match);\n }\n\n callback(match);\n }\n };\n\n function generateMatch(startingPath, matcher, delegate) {\n return function(path, nestedCallback) {\n var fullPath = startingPath + path;\n\n if (nestedCallback) {\n nestedCallback(generateMatch(fullPath, matcher, delegate));\n } else {\n return new Target(startingPath + path, matcher, delegate);\n }\n };\n }\n\n function addRoute(routeArray, path, handler) {\n var len = 0;\n for (var i=0, l=routeArray.length; i<l; i++) {\n len += routeArray[i].path.length;\n }\n\n path = path.substr(len);\n var route = { path: path, handler: handler };\n routeArray.push(route);\n }\n\n function eachRoute(baseRoute, matcher, callback, binding) {\n var routes = matcher.routes;\n\n for (var path in routes) {\n if (routes.hasOwnProperty(path)) {\n var routeArray = baseRoute.slice();\n addRoute(routeArray, path, routes[path]);\n\n if (matcher.children[path]) {\n eachRoute(routeArray, matcher.children[path], callback, binding);\n } else {\n callback.call(binding, routeArray);\n }\n }\n }\n }\n\n RouteRecognizer.prototype.map = function(callback, addRouteCallback) {\n var matcher = new Matcher();\n\n callback(generateMatch(\"\", matcher, this.delegate));\n\n eachRoute([], matcher, function(route) {\n if (addRouteCallback) { addRouteCallback(this, route); }\n else { this.add(route); }\n }, this);\n };\n });\n\ndefine(\"router/handler-info\", \n [\"./utils\",\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var bind = __dependency1__.bind;\n var merge = __dependency1__.merge;\n var serialize = __dependency1__.serialize;\n var promiseLabel = __dependency1__.promiseLabel;\n var Promise = __dependency2__[\"default\"];\n\n function HandlerInfo(_props) {\n var props = _props || {};\n merge(this, props);\n this.initialize(props);\n }\n\n HandlerInfo.prototype = {\n name: null,\n handler: null,\n params: null,\n context: null,\n\n // Injected by the handler info factory.\n factory: null,\n\n initialize: function() {},\n\n log: function(payload, message) {\n if (payload.log) {\n payload.log(this.name + ': ' + message);\n }\n },\n\n promiseLabel: function(label) {\n return promiseLabel(\"'\" + this.name + \"' \" + label);\n },\n\n getUnresolved: function() {\n return this;\n },\n\n serialize: function() {\n return this.params || {};\n },\n\n resolve: function(shouldContinue, payload) {\n var checkForAbort = bind(this, this.checkForAbort, shouldContinue),\n beforeModel = bind(this, this.runBeforeModelHook, payload),\n model = bind(this, this.getModel, payload),\n afterModel = bind(this, this.runAfterModelHook, payload),\n becomeResolved = bind(this, this.becomeResolved, payload);\n\n return Promise.resolve(undefined, this.promiseLabel(\"Start handler\"))\n .then(checkForAbort, null, this.promiseLabel(\"Check for abort\"))\n .then(beforeModel, null, this.promiseLabel(\"Before model\"))\n .then(checkForAbort, null, this.promiseLabel(\"Check if aborted during 'beforeModel' hook\"))\n .then(model, null, this.promiseLabel(\"Model\"))\n .then(checkForAbort, null, this.promiseLabel(\"Check if aborted in 'model' hook\"))\n .then(afterModel, null, this.promiseLabel(\"After model\"))\n .then(checkForAbort, null, this.promiseLabel(\"Check if aborted in 'afterModel' hook\"))\n .then(becomeResolved, null, this.promiseLabel(\"Become resolved\"));\n },\n\n runBeforeModelHook: function(payload) {\n if (payload.trigger) {\n payload.trigger(true, 'willResolveModel', payload, this.handler);\n }\n return this.runSharedModelHook(payload, 'beforeModel', []);\n },\n\n runAfterModelHook: function(payload, resolvedModel) {\n // Stash the resolved model on the payload.\n // This makes it possible for users to swap out\n // the resolved model in afterModel.\n var name = this.name;\n this.stashResolvedModel(payload, resolvedModel);\n\n return this.runSharedModelHook(payload, 'afterModel', [resolvedModel])\n .then(function() {\n // Ignore the fulfilled value returned from afterModel.\n // Return the value stashed in resolvedModels, which\n // might have been swapped out in afterModel.\n return payload.resolvedModels[name];\n }, null, this.promiseLabel(\"Ignore fulfillment value and return model value\"));\n },\n\n runSharedModelHook: function(payload, hookName, args) {\n this.log(payload, \"calling \" + hookName + \" hook\");\n\n if (this.queryParams) {\n args.push(this.queryParams);\n }\n args.push(payload);\n\n var handler = this.handler;\n var result = handler[hookName] && handler[hookName].apply(handler, args);\n\n if (result && result.isTransition) {\n result = null;\n }\n\n return Promise.resolve(result, null, this.promiseLabel(\"Resolve value returned from one of the model hooks\"));\n },\n\n // overridden by subclasses\n getModel: null,\n\n checkForAbort: function(shouldContinue, promiseValue) {\n return Promise.resolve(shouldContinue(), this.promiseLabel(\"Check for abort\")).then(function() {\n // We don't care about shouldContinue's resolve value;\n // pass along the original value passed to this fn.\n return promiseValue;\n }, null, this.promiseLabel(\"Ignore fulfillment value and continue\"));\n },\n\n stashResolvedModel: function(payload, resolvedModel) {\n payload.resolvedModels = payload.resolvedModels || {};\n payload.resolvedModels[this.name] = resolvedModel;\n },\n\n becomeResolved: function(payload, resolvedContext) {\n var params = this.serialize(resolvedContext);\n\n if (payload) {\n this.stashResolvedModel(payload, resolvedContext);\n payload.params = payload.params || {};\n payload.params[this.name] = params;\n }\n\n return this.factory('resolved', {\n context: resolvedContext,\n name: this.name,\n handler: this.handler,\n params: params\n });\n },\n\n shouldSupercede: function(other) {\n // Prefer this newer handlerInfo over `other` if:\n // 1) The other one doesn't exist\n // 2) The names don't match\n // 3) This handler has a context that doesn't match\n // the other one (or the other one doesn't have one).\n // 4) This handler has parameters that don't match the other.\n if (!other) { return true; }\n\n var contextsMatch = (other.context === this.context);\n return other.name !== this.name ||\n (this.hasOwnProperty('context') && !contextsMatch) ||\n (this.hasOwnProperty('params') && !paramsMatch(this.params, other.params));\n }\n };\n\n function paramsMatch(a, b) {\n if ((!a) ^ (!b)) {\n // Only one is null.\n return false;\n }\n\n if (!a) {\n // Both must be null.\n return true;\n }\n\n // Note: this assumes that both params have the same\n // number of keys, but since we're comparing the\n // same handlers, they should.\n for (var k in a) {\n if (a.hasOwnProperty(k) && a[k] !== b[k]) {\n return false;\n }\n }\n return true;\n }\n\n __exports__[\"default\"] = HandlerInfo;\n });\ndefine(\"router/handler-info/factory\", \n [\"router/handler-info/resolved-handler-info\",\"router/handler-info/unresolved-handler-info-by-object\",\"router/handler-info/unresolved-handler-info-by-param\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var ResolvedHandlerInfo = __dependency1__[\"default\"];\n var UnresolvedHandlerInfoByObject = __dependency2__[\"default\"];\n var UnresolvedHandlerInfoByParam = __dependency3__[\"default\"];\n\n handlerInfoFactory.klasses = {\n resolved: ResolvedHandlerInfo,\n param: UnresolvedHandlerInfoByParam,\n object: UnresolvedHandlerInfoByObject\n };\n\n function handlerInfoFactory(name, props) {\n var Ctor = handlerInfoFactory.klasses[name],\n handlerInfo = new Ctor(props || {});\n handlerInfo.factory = handlerInfoFactory;\n return handlerInfo;\n }\n\n __exports__[\"default\"] = handlerInfoFactory;\n });\ndefine(\"router/handler-info/resolved-handler-info\", \n [\"../handler-info\",\"router/utils\",\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var HandlerInfo = __dependency1__[\"default\"];\n var subclass = __dependency2__.subclass;\n var promiseLabel = __dependency2__.promiseLabel;\n var Promise = __dependency3__[\"default\"];\n\n var ResolvedHandlerInfo = subclass(HandlerInfo, {\n resolve: function(shouldContinue, payload) {\n // A ResolvedHandlerInfo just resolved with itself.\n if (payload && payload.resolvedModels) {\n payload.resolvedModels[this.name] = this.context;\n }\n return Promise.resolve(this, this.promiseLabel(\"Resolve\"));\n },\n\n getUnresolved: function() {\n return this.factory('param', {\n name: this.name,\n handler: this.handler,\n params: this.params\n });\n },\n\n isResolved: true\n });\n\n __exports__[\"default\"] = ResolvedHandlerInfo;\n });\ndefine(\"router/handler-info/unresolved-handler-info-by-object\", \n [\"../handler-info\",\"router/utils\",\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var HandlerInfo = __dependency1__[\"default\"];\n var merge = __dependency2__.merge;\n var subclass = __dependency2__.subclass;\n var promiseLabel = __dependency2__.promiseLabel;\n var isParam = __dependency2__.isParam;\n var Promise = __dependency3__[\"default\"];\n\n var UnresolvedHandlerInfoByObject = subclass(HandlerInfo, {\n getModel: function(payload) {\n this.log(payload, this.name + \": resolving provided model\");\n return Promise.resolve(this.context);\n },\n\n initialize: function(props) {\n this.names = props.names || [];\n this.context = props.context;\n },\n\n /**\n @private\n\n Serializes a handler using its custom `serialize` method or\n by a default that looks up the expected property name from\n the dynamic segment.\n\n @param {Object} model the model to be serialized for this handler\n */\n serialize: function(_model) {\n var model = _model || this.context,\n names = this.names,\n handler = this.handler;\n\n var object = {};\n if (isParam(model)) {\n object[names[0]] = model;\n return object;\n }\n\n // Use custom serialize if it exists.\n if (handler.serialize) {\n return handler.serialize(model, names);\n }\n\n if (names.length !== 1) { return; }\n\n var name = names[0];\n\n if (/_id$/.test(name)) {\n object[name] = model.id;\n } else {\n object[name] = model;\n }\n return object;\n }\n });\n\n __exports__[\"default\"] = UnresolvedHandlerInfoByObject;\n });\ndefine(\"router/handler-info/unresolved-handler-info-by-param\", \n [\"../handler-info\",\"router/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var HandlerInfo = __dependency1__[\"default\"];\n var merge = __dependency2__.merge;\n var subclass = __dependency2__.subclass;\n var promiseLabel = __dependency2__.promiseLabel;\n\n // Generated by URL transitions and non-dynamic route segments in named Transitions.\n var UnresolvedHandlerInfoByParam = subclass (HandlerInfo, {\n initialize: function(props) {\n this.params = props.params || {};\n },\n\n getModel: function(payload) {\n var fullParams = this.params;\n if (payload && payload.queryParams) {\n fullParams = {};\n merge(fullParams, this.params);\n fullParams.queryParams = payload.queryParams;\n }\n\n var hookName = typeof this.handler.deserialize === 'function' ?\n 'deserialize' : 'model';\n\n return this.runSharedModelHook(payload, hookName, [fullParams]);\n }\n });\n\n __exports__[\"default\"] = UnresolvedHandlerInfoByParam;\n });\ndefine(\"router/router\", \n [\"route-recognizer\",\"rsvp/promise\",\"./utils\",\"./transition-state\",\"./transition\",\"./transition-intent/named-transition-intent\",\"./transition-intent/url-transition-intent\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var RouteRecognizer = __dependency1__[\"default\"];\n var Promise = __dependency2__[\"default\"];\n var trigger = __dependency3__.trigger;\n var log = __dependency3__.log;\n var slice = __dependency3__.slice;\n var forEach = __dependency3__.forEach;\n var merge = __dependency3__.merge;\n var serialize = __dependency3__.serialize;\n var extractQueryParams = __dependency3__.extractQueryParams;\n var getChangelist = __dependency3__.getChangelist;\n var promiseLabel = __dependency3__.promiseLabel;\n var TransitionState = __dependency4__[\"default\"];\n var logAbort = __dependency5__.logAbort;\n var Transition = __dependency5__.Transition;\n var TransitionAborted = __dependency5__.TransitionAborted;\n var NamedTransitionIntent = __dependency6__[\"default\"];\n var URLTransitionIntent = __dependency7__[\"default\"];\n\n var pop = Array.prototype.pop;\n\n function Router() {\n this.recognizer = new RouteRecognizer();\n this.reset();\n }\n\n Router.prototype = {\n\n /**\n The main entry point into the router. The API is essentially\n the same as the `map` method in `route-recognizer`.\n\n This method extracts the String handler at the last `.to()`\n call and uses it as the name of the whole route.\n\n @param {Function} callback\n */\n map: function(callback) {\n this.recognizer.delegate = this.delegate;\n\n this.recognizer.map(callback, function(recognizer, routes) {\n for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) {\n var route = routes[i];\n recognizer.add(routes, { as: route.handler });\n proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index';\n }\n });\n },\n\n hasRoute: function(route) {\n return this.recognizer.hasRoute(route);\n },\n\n // NOTE: this doesn't really belong here, but here\n // it shall remain until our ES6 transpiler can\n // handle cyclical deps.\n transitionByIntent: function(intent, isIntermediate) {\n\n var wasTransitioning = !!this.activeTransition;\n var oldState = wasTransitioning ? this.activeTransition.state : this.state;\n var newTransition;\n var router = this;\n\n try {\n var newState = intent.applyToState(oldState, this.recognizer, this.getHandler, isIntermediate);\n\n if (handlerInfosEqual(newState.handlerInfos, oldState.handlerInfos)) {\n\n // This is a no-op transition. See if query params changed.\n var queryParamChangelist = getChangelist(oldState.queryParams, newState.queryParams);\n if (queryParamChangelist) {\n\n // This is a little hacky but we need some way of storing\n // changed query params given that no activeTransition\n // is guaranteed to have occurred.\n this._changedQueryParams = queryParamChangelist.changed;\n for (var k in queryParamChangelist.removed) {\n if (queryParamChangelist.removed.hasOwnProperty(k)) {\n this._changedQueryParams[k] = null;\n }\n }\n trigger(this, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]);\n this._changedQueryParams = null;\n\n if (!wasTransitioning && this.activeTransition) {\n // One of the handlers in queryParamsDidChange\n // caused a transition. Just return that transition.\n return this.activeTransition;\n } else {\n // Running queryParamsDidChange didn't change anything.\n // Just update query params and be on our way.\n\n // We have to return a noop transition that will\n // perform a URL update at the end. This gives\n // the user the ability to set the url update\n // method (default is replaceState).\n newTransition = new Transition(this);\n\n oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition);\n\n newTransition.promise = newTransition.promise.then(function(result) {\n updateURL(newTransition, oldState, true);\n if (router.didTransition) {\n router.didTransition(router.currentHandlerInfos);\n }\n return result;\n }, null, promiseLabel(\"Transition complete\"));\n return newTransition;\n }\n }\n\n // No-op. No need to create a new transition.\n return new Transition(this);\n }\n\n if (isIntermediate) {\n setupContexts(this, newState);\n return;\n }\n\n // Create a new transition to the destination route.\n newTransition = new Transition(this, intent, newState);\n\n // Abort and usurp any previously active transition.\n if (this.activeTransition) {\n this.activeTransition.abort();\n }\n this.activeTransition = newTransition;\n\n // Transition promises by default resolve with resolved state.\n // For our purposes, swap out the promise to resolve\n // after the transition has been finalized.\n newTransition.promise = newTransition.promise.then(function(result) {\n return finalizeTransition(newTransition, result.state);\n }, null, promiseLabel(\"Settle transition promise when transition is finalized\"));\n\n if (!wasTransitioning) {\n trigger(this, this.state.handlerInfos, true, ['willTransition', newTransition]);\n }\n\n return newTransition;\n } catch(e) {\n return new Transition(this, intent, null, e);\n }\n },\n\n /**\n Clears the current and target route handlers and triggers exit\n on each of them starting at the leaf and traversing up through\n its ancestors.\n */\n reset: function() {\n if (this.state) {\n forEach(this.state.handlerInfos, function(handlerInfo) {\n var handler = handlerInfo.handler;\n if (handler.exit) {\n handler.exit();\n }\n });\n }\n\n this.state = new TransitionState();\n this.currentHandlerInfos = null;\n },\n\n activeTransition: null,\n\n /**\n var handler = handlerInfo.handler;\n The entry point for handling a change to the URL (usually\n via the back and forward button).\n\n Returns an Array of handlers and the parameters associated\n with those parameters.\n\n @param {String} url a URL to process\n\n @return {Array} an Array of `[handler, parameter]` tuples\n */\n handleURL: function(url) {\n // Perform a URL-based transition, but don't change\n // the URL afterward, since it already happened.\n var args = slice.call(arguments);\n if (url.charAt(0) !== '/') { args[0] = '/' + url; }\n\n return doTransition(this, args).method(null);\n },\n\n /**\n Hook point for updating the URL.\n\n @param {String} url a URL to update to\n */\n updateURL: function() {\n throw new Error(\"updateURL is not implemented\");\n },\n\n /**\n Hook point for replacing the current URL, i.e. with replaceState\n\n By default this behaves the same as `updateURL`\n\n @param {String} url a URL to update to\n */\n replaceURL: function(url) {\n this.updateURL(url);\n },\n\n /**\n Transition into the specified named route.\n\n If necessary, trigger the exit callback on any handlers\n that are no longer represented by the target route.\n\n @param {String} name the name of the route\n */\n transitionTo: function(name) {\n return doTransition(this, arguments);\n },\n\n intermediateTransitionTo: function(name) {\n doTransition(this, arguments, true);\n },\n\n refresh: function(pivotHandler) {\n\n\n var state = this.activeTransition ? this.activeTransition.state : this.state;\n var handlerInfos = state.handlerInfos;\n var params = {};\n for (var i = 0, len = handlerInfos.length; i < len; ++i) {\n var handlerInfo = handlerInfos[i];\n params[handlerInfo.name] = handlerInfo.params || {};\n }\n\n log(this, \"Starting a refresh transition\");\n var intent = new NamedTransitionIntent({\n name: handlerInfos[handlerInfos.length - 1].name,\n pivotHandler: pivotHandler || handlerInfos[0].handler,\n contexts: [], // TODO collect contexts...?\n queryParams: this._changedQueryParams || state.queryParams || {}\n });\n\n return this.transitionByIntent(intent, false);\n },\n\n /**\n Identical to `transitionTo` except that the current URL will be replaced\n if possible.\n\n This method is intended primarily for use with `replaceState`.\n\n @param {String} name the name of the route\n */\n replaceWith: function(name) {\n return doTransition(this, arguments).method('replace');\n },\n\n /**\n Take a named route and context objects and generate a\n URL.\n\n @param {String} name the name of the route to generate\n a URL for\n @param {...Object} objects a list of objects to serialize\n\n @return {String} a URL\n */\n generate: function(handlerName) {\n\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1)),\n suppliedParams = partitionedArgs[0],\n queryParams = partitionedArgs[1];\n\n // Construct a TransitionIntent with the provided params\n // and apply it to the present state of the router.\n var intent = new NamedTransitionIntent({ name: handlerName, contexts: suppliedParams });\n var state = intent.applyToState(this.state, this.recognizer, this.getHandler);\n var params = {};\n\n for (var i = 0, len = state.handlerInfos.length; i < len; ++i) {\n var handlerInfo = state.handlerInfos[i];\n var handlerParams = handlerInfo.serialize();\n merge(params, handlerParams);\n }\n params.queryParams = queryParams;\n\n return this.recognizer.generate(handlerName, params);\n },\n\n isActive: function(handlerName) {\n\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1)),\n contexts = partitionedArgs[0],\n queryParams = partitionedArgs[1],\n activeQueryParams = this.state.queryParams;\n\n var targetHandlerInfos = this.state.handlerInfos,\n found = false, names, object, handlerInfo, handlerObj, i, len;\n\n if (!targetHandlerInfos.length) { return false; }\n\n var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name;\n var recogHandlers = this.recognizer.handlersFor(targetHandler);\n\n var index = 0;\n for (len = recogHandlers.length; index < len; ++index) {\n handlerInfo = targetHandlerInfos[index];\n if (handlerInfo.name === handlerName) { break; }\n }\n\n if (index === recogHandlers.length) {\n // The provided route name isn't even in the route hierarchy.\n return false;\n }\n\n var state = new TransitionState();\n state.handlerInfos = targetHandlerInfos.slice(0, index + 1);\n recogHandlers = recogHandlers.slice(0, index + 1);\n\n var intent = new NamedTransitionIntent({\n name: targetHandler,\n contexts: contexts\n });\n\n var newState = intent.applyToHandlers(state, recogHandlers, this.getHandler, targetHandler, true, true);\n\n // Get a hash of QPs that will still be active on new route\n var activeQPsOnNewHandler = {};\n merge(activeQPsOnNewHandler, queryParams);\n for (var key in activeQueryParams) {\n if (activeQueryParams.hasOwnProperty(key) &&\n activeQPsOnNewHandler.hasOwnProperty(key)) {\n activeQPsOnNewHandler[key] = activeQueryParams[key];\n }\n }\n\n return handlerInfosEqual(newState.handlerInfos, state.handlerInfos) &&\n !getChangelist(activeQPsOnNewHandler, queryParams);\n },\n\n trigger: function(name) {\n var args = slice.call(arguments);\n trigger(this, this.currentHandlerInfos, false, args);\n },\n\n /**\n Hook point for logging transition status updates.\n\n @param {String} message The message to log.\n */\n log: null\n };\n\n /**\n @private\n\n Takes an Array of `HandlerInfo`s, figures out which ones are\n exiting, entering, or changing contexts, and calls the\n proper handler hooks.\n\n For example, consider the following tree of handlers. Each handler is\n followed by the URL segment it handles.\n\n ```\n |~index (\"/\")\n | |~posts (\"/posts\")\n | | |-showPost (\"/:id\")\n | | |-newPost (\"/new\")\n | | |-editPost (\"/edit\")\n | |~about (\"/about/:id\")\n ```\n\n Consider the following transitions:\n\n 1. A URL transition to `/posts/1`.\n 1. Triggers the `*model` callbacks on the\n `index`, `posts`, and `showPost` handlers\n 2. Triggers the `enter` callback on the same\n 3. Triggers the `setup` callback on the same\n 2. A direct transition to `newPost`\n 1. Triggers the `exit` callback on `showPost`\n 2. Triggers the `enter` callback on `newPost`\n 3. Triggers the `setup` callback on `newPost`\n 3. A direct transition to `about` with a specified\n context object\n 1. Triggers the `exit` callback on `newPost`\n and `posts`\n 2. Triggers the `serialize` callback on `about`\n 3. Triggers the `enter` callback on `about`\n 4. Triggers the `setup` callback on `about`\n\n @param {Router} transition\n @param {TransitionState} newState\n */\n function setupContexts(router, newState, transition) {\n var partition = partitionHandlers(router.state, newState);\n\n forEach(partition.exited, function(handlerInfo) {\n var handler = handlerInfo.handler;\n delete handler.context;\n if (handler.exit) { handler.exit(); }\n });\n\n var oldState = router.oldState = router.state;\n router.state = newState;\n var currentHandlerInfos = router.currentHandlerInfos = partition.unchanged.slice();\n\n try {\n forEach(partition.updatedContext, function(handlerInfo) {\n return handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, false, transition);\n });\n\n forEach(partition.entered, function(handlerInfo) {\n return handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, true, transition);\n });\n } catch(e) {\n router.state = oldState;\n router.currentHandlerInfos = oldState.handlerInfos;\n throw e;\n }\n\n router.state.queryParams = finalizeQueryParamChange(router, currentHandlerInfos, newState.queryParams, transition);\n }\n\n\n /**\n @private\n\n Helper method used by setupContexts. Handles errors or redirects\n that may happen in enter/setup.\n */\n function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transition) {\n\n var handler = handlerInfo.handler,\n context = handlerInfo.context;\n\n if (enter && handler.enter) { handler.enter(transition); }\n if (transition && transition.isAborted) {\n throw new TransitionAborted();\n }\n\n handler.context = context;\n if (handler.contextDidChange) { handler.contextDidChange(); }\n\n if (handler.setup) { handler.setup(context, transition); }\n if (transition && transition.isAborted) {\n throw new TransitionAborted();\n }\n\n currentHandlerInfos.push(handlerInfo);\n\n return true;\n }\n\n\n /**\n @private\n\n This function is called when transitioning from one URL to\n another to determine which handlers are no longer active,\n which handlers are newly active, and which handlers remain\n active but have their context changed.\n\n Take a list of old handlers and new handlers and partition\n them into four buckets:\n\n * unchanged: the handler was active in both the old and\n new URL, and its context remains the same\n * updated context: the handler was active in both the\n old and new URL, but its context changed. The handler's\n `setup` method, if any, will be called with the new\n context.\n * exited: the handler was active in the old URL, but is\n no longer active.\n * entered: the handler was not active in the old URL, but\n is now active.\n\n The PartitionedHandlers structure has four fields:\n\n * `updatedContext`: a list of `HandlerInfo` objects that\n represent handlers that remain active but have a changed\n context\n * `entered`: a list of `HandlerInfo` objects that represent\n handlers that are newly active\n * `exited`: a list of `HandlerInfo` objects that are no\n longer active.\n * `unchanged`: a list of `HanderInfo` objects that remain active.\n\n @param {Array[HandlerInfo]} oldHandlers a list of the handler\n information for the previous URL (or `[]` if this is the\n first handled transition)\n @param {Array[HandlerInfo]} newHandlers a list of the handler\n information for the new URL\n\n @return {Partition}\n */\n function partitionHandlers(oldState, newState) {\n var oldHandlers = oldState.handlerInfos;\n var newHandlers = newState.handlerInfos;\n\n var handlers = {\n updatedContext: [],\n exited: [],\n entered: [],\n unchanged: []\n };\n\n var handlerChanged, contextChanged, queryParamsChanged, i, l;\n\n for (i=0, l=newHandlers.length; i<l; i++) {\n var oldHandler = oldHandlers[i], newHandler = newHandlers[i];\n\n if (!oldHandler || oldHandler.handler !== newHandler.handler) {\n handlerChanged = true;\n }\n\n if (handlerChanged) {\n handlers.entered.push(newHandler);\n if (oldHandler) { handlers.exited.unshift(oldHandler); }\n } else if (contextChanged || oldHandler.context !== newHandler.context || queryParamsChanged) {\n contextChanged = true;\n handlers.updatedContext.push(newHandler);\n } else {\n handlers.unchanged.push(oldHandler);\n }\n }\n\n for (i=newHandlers.length, l=oldHandlers.length; i<l; i++) {\n handlers.exited.unshift(oldHandlers[i]);\n }\n\n return handlers;\n }\n\n function updateURL(transition, state, inputUrl) {\n var urlMethod = transition.urlMethod;\n\n if (!urlMethod) {\n return;\n }\n\n var router = transition.router,\n handlerInfos = state.handlerInfos,\n handlerName = handlerInfos[handlerInfos.length - 1].name,\n params = {};\n\n for (var i = handlerInfos.length - 1; i >= 0; --i) {\n var handlerInfo = handlerInfos[i];\n merge(params, handlerInfo.params);\n if (handlerInfo.handler.inaccessibleByURL) {\n urlMethod = null;\n }\n }\n\n if (urlMethod) {\n params.queryParams = transition._visibleQueryParams || state.queryParams;\n var url = router.recognizer.generate(handlerName, params);\n\n if (urlMethod === 'replace') {\n router.replaceURL(url);\n } else {\n router.updateURL(url);\n }\n }\n }\n\n /**\n @private\n\n Updates the URL (if necessary) and calls `setupContexts`\n to update the router's array of `currentHandlerInfos`.\n */\n function finalizeTransition(transition, newState) {\n\n try {\n log(transition.router, transition.sequence, \"Resolved all models on destination route; finalizing transition.\");\n\n var router = transition.router,\n handlerInfos = newState.handlerInfos,\n seq = transition.sequence;\n\n // Run all the necessary enter/setup/exit hooks\n setupContexts(router, newState, transition);\n\n // Check if a redirect occurred in enter/setup\n if (transition.isAborted) {\n // TODO: cleaner way? distinguish b/w targetHandlerInfos?\n router.state.handlerInfos = router.currentHandlerInfos;\n return Promise.reject(logAbort(transition));\n }\n\n updateURL(transition, newState, transition.intent.url);\n\n transition.isActive = false;\n router.activeTransition = null;\n\n trigger(router, router.currentHandlerInfos, true, ['didTransition']);\n\n if (router.didTransition) {\n router.didTransition(router.currentHandlerInfos);\n }\n\n log(router, transition.sequence, \"TRANSITION COMPLETE.\");\n\n // Resolve with the final handler.\n return handlerInfos[handlerInfos.length - 1].handler;\n } catch(e) {\n if (!(e instanceof TransitionAborted)) {\n //var erroneousHandler = handlerInfos.pop();\n var infos = transition.state.handlerInfos;\n transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler);\n transition.abort();\n }\n\n throw e;\n }\n }\n\n /**\n @private\n\n Begins and returns a Transition based on the provided\n arguments. Accepts arguments in the form of both URL\n transitions and named transitions.\n\n @param {Router} router\n @param {Array[Object]} args arguments passed to transitionTo,\n replaceWith, or handleURL\n */\n function doTransition(router, args, isIntermediate) {\n // Normalize blank transitions to root URL transitions.\n var name = args[0] || '/';\n\n var lastArg = args[args.length-1];\n var queryParams = {};\n if (lastArg && lastArg.hasOwnProperty('queryParams')) {\n queryParams = pop.call(args).queryParams;\n }\n\n var intent;\n if (args.length === 0) {\n\n log(router, \"Updating query params\");\n\n // A query param update is really just a transition\n // into the route you're already on.\n var handlerInfos = router.state.handlerInfos;\n intent = new NamedTransitionIntent({\n name: handlerInfos[handlerInfos.length - 1].name,\n contexts: [],\n queryParams: queryParams\n });\n\n } else if (name.charAt(0) === '/') {\n\n log(router, \"Attempting URL transition to \" + name);\n intent = new URLTransitionIntent({ url: name });\n\n } else {\n\n log(router, \"Attempting transition to \" + name);\n intent = new NamedTransitionIntent({\n name: args[0],\n contexts: slice.call(args, 1),\n queryParams: queryParams\n });\n }\n\n return router.transitionByIntent(intent, isIntermediate);\n }\n\n function handlerInfosEqual(handlerInfos, otherHandlerInfos) {\n if (handlerInfos.length !== otherHandlerInfos.length) {\n return false;\n }\n\n for (var i = 0, len = handlerInfos.length; i < len; ++i) {\n if (handlerInfos[i] !== otherHandlerInfos[i]) {\n return false;\n }\n }\n return true;\n }\n\n function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) {\n // We fire a finalizeQueryParamChange event which\n // gives the new route hierarchy a chance to tell\n // us which query params it's consuming and what\n // their final values are. If a query param is\n // no longer consumed in the final route hierarchy,\n // its serialized segment will be removed\n // from the URL.\n\n for (var k in newQueryParams) {\n if (newQueryParams.hasOwnProperty(k) &&\n newQueryParams[k] === null) {\n delete newQueryParams[k];\n }\n }\n\n var finalQueryParamsArray = [];\n trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]);\n\n if (transition) {\n transition._visibleQueryParams = {};\n }\n\n var finalQueryParams = {};\n for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) {\n var qp = finalQueryParamsArray[i];\n finalQueryParams[qp.key] = qp.value;\n if (transition && qp.visible !== false) {\n transition._visibleQueryParams[qp.key] = qp.value;\n }\n }\n return finalQueryParams;\n }\n\n __exports__[\"default\"] = Router;\n });\ndefine(\"router/transition-intent\", \n [\"./utils\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var merge = __dependency1__.merge;\n\n function TransitionIntent(props) {\n this.initialize(props);\n\n // TODO: wat\n this.data = this.data || {};\n }\n\n TransitionIntent.prototype = {\n initialize: null,\n applyToState: null\n };\n\n __exports__[\"default\"] = TransitionIntent;\n });\ndefine(\"router/transition-intent/named-transition-intent\", \n [\"../transition-intent\",\"../transition-state\",\"../handler-info/factory\",\"../utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var TransitionIntent = __dependency1__[\"default\"];\n var TransitionState = __dependency2__[\"default\"];\n var handlerInfoFactory = __dependency3__[\"default\"];\n var isParam = __dependency4__.isParam;\n var extractQueryParams = __dependency4__.extractQueryParams;\n var merge = __dependency4__.merge;\n var subclass = __dependency4__.subclass;\n\n __exports__[\"default\"] = subclass(TransitionIntent, {\n name: null,\n pivotHandler: null,\n contexts: null,\n queryParams: null,\n\n initialize: function(props) {\n this.name = props.name;\n this.pivotHandler = props.pivotHandler;\n this.contexts = props.contexts || [];\n this.queryParams = props.queryParams;\n },\n\n applyToState: function(oldState, recognizer, getHandler, isIntermediate) {\n\n var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)),\n pureArgs = partitionedArgs[0],\n queryParams = partitionedArgs[1],\n handlers = recognizer.handlersFor(pureArgs[0]);\n\n var targetRouteName = handlers[handlers.length-1].handler;\n\n return this.applyToHandlers(oldState, handlers, getHandler, targetRouteName, isIntermediate);\n },\n\n applyToHandlers: function(oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive) {\n\n var i;\n var newState = new TransitionState();\n var objects = this.contexts.slice(0);\n\n var invalidateIndex = handlers.length;\n\n // Pivot handlers are provided for refresh transitions\n if (this.pivotHandler) {\n for (i = 0; i < handlers.length; ++i) {\n if (getHandler(handlers[i].handler) === this.pivotHandler) {\n invalidateIndex = i;\n break;\n }\n }\n }\n\n var pivotHandlerFound = !this.pivotHandler;\n\n for (i = handlers.length - 1; i >= 0; --i) {\n var result = handlers[i];\n var name = result.handler;\n var handler = getHandler(name);\n\n var oldHandlerInfo = oldState.handlerInfos[i];\n var newHandlerInfo = null;\n\n if (result.names.length > 0) {\n if (i >= invalidateIndex) {\n newHandlerInfo = this.createParamHandlerInfo(name, handler, result.names, objects, oldHandlerInfo);\n } else {\n newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, handler, result.names, objects, oldHandlerInfo, targetRouteName, i);\n }\n } else {\n // This route has no dynamic segment.\n // Therefore treat as a param-based handlerInfo\n // with empty params. This will cause the `model`\n // hook to be called with empty params, which is desirable.\n newHandlerInfo = this.createParamHandlerInfo(name, handler, result.names, objects, oldHandlerInfo);\n }\n\n if (checkingIfActive) {\n // If we're performing an isActive check, we want to\n // serialize URL params with the provided context, but\n // ignore mismatches between old and new context.\n newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context);\n var oldContext = oldHandlerInfo && oldHandlerInfo.context;\n if (result.names.length > 0 && newHandlerInfo.context === oldContext) {\n // If contexts match in isActive test, assume params also match.\n // This allows for flexibility in not requiring that every last\n // handler provide a `serialize` method\n newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params;\n }\n newHandlerInfo.context = oldContext;\n }\n\n var handlerToUse = oldHandlerInfo;\n if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) {\n invalidateIndex = Math.min(i, invalidateIndex);\n handlerToUse = newHandlerInfo;\n }\n\n if (isIntermediate && !checkingIfActive) {\n handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context);\n }\n\n newState.handlerInfos.unshift(handlerToUse);\n }\n\n if (objects.length > 0) {\n throw new Error(\"More context objects were passed than there are dynamic segments for the route: \" + targetRouteName);\n }\n\n if (!isIntermediate) {\n this.invalidateChildren(newState.handlerInfos, invalidateIndex);\n }\n\n merge(newState.queryParams, oldState.queryParams);\n merge(newState.queryParams, this.queryParams || {});\n\n return newState;\n },\n\n invalidateChildren: function(handlerInfos, invalidateIndex) {\n for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) {\n var handlerInfo = handlerInfos[i];\n handlerInfos[i] = handlerInfos[i].getUnresolved();\n }\n },\n\n getHandlerInfoForDynamicSegment: function(name, handler, names, objects, oldHandlerInfo, targetRouteName, i) {\n\n var numNames = names.length;\n var objectToUse;\n if (objects.length > 0) {\n\n // Use the objects provided for this transition.\n objectToUse = objects[objects.length - 1];\n if (isParam(objectToUse)) {\n return this.createParamHandlerInfo(name, handler, names, objects, oldHandlerInfo);\n } else {\n objects.pop();\n }\n } else if (oldHandlerInfo && oldHandlerInfo.name === name) {\n // Reuse the matching oldHandlerInfo\n return oldHandlerInfo;\n } else {\n if (this.preTransitionState) {\n var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i];\n objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context;\n } else {\n // Ideally we should throw this error to provide maximal\n // information to the user that not enough context objects\n // were provided, but this proves too cumbersome in Ember\n // in cases where inner template helpers are evaluated\n // before parent helpers un-render, in which cases this\n // error somewhat prematurely fires.\n //throw new Error(\"Not enough context objects were provided to complete a transition to \" + targetRouteName + \". Specifically, the \" + name + \" route needs an object that can be serialized into its dynamic URL segments [\" + names.join(', ') + \"]\");\n return oldHandlerInfo;\n }\n }\n\n return handlerInfoFactory('object', {\n name: name,\n handler: handler,\n context: objectToUse,\n names: names\n });\n },\n\n createParamHandlerInfo: function(name, handler, names, objects, oldHandlerInfo) {\n var params = {};\n\n // Soak up all the provided string/numbers\n var numNames = names.length;\n while (numNames--) {\n\n // Only use old params if the names match with the new handler\n var oldParams = (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {};\n\n var peek = objects[objects.length - 1];\n var paramName = names[numNames];\n if (isParam(peek)) {\n params[paramName] = \"\" + objects.pop();\n } else {\n // If we're here, this means only some of the params\n // were string/number params, so try and use a param\n // value from a previous handler.\n if (oldParams.hasOwnProperty(paramName)) {\n params[paramName] = oldParams[paramName];\n } else {\n throw new Error(\"You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route \" + name);\n }\n }\n }\n\n return handlerInfoFactory('param', {\n name: name,\n handler: handler,\n params: params\n });\n }\n });\n });\ndefine(\"router/transition-intent/url-transition-intent\", \n [\"../transition-intent\",\"../transition-state\",\"../handler-info/factory\",\"../utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var TransitionIntent = __dependency1__[\"default\"];\n var TransitionState = __dependency2__[\"default\"];\n var handlerInfoFactory = __dependency3__[\"default\"];\n var oCreate = __dependency4__.oCreate;\n var merge = __dependency4__.merge;\n var subclass = __dependency4__.subclass;\n\n __exports__[\"default\"] = subclass(TransitionIntent, {\n url: null,\n\n initialize: function(props) {\n this.url = props.url;\n },\n\n applyToState: function(oldState, recognizer, getHandler) {\n var newState = new TransitionState();\n\n var results = recognizer.recognize(this.url),\n queryParams = {},\n i, len;\n\n if (!results) {\n throw new UnrecognizedURLError(this.url);\n }\n\n var statesDiffer = false;\n\n for (i = 0, len = results.length; i < len; ++i) {\n var result = results[i];\n var name = result.handler;\n var handler = getHandler(name);\n\n if (handler.inaccessibleByURL) {\n throw new UnrecognizedURLError(this.url);\n }\n\n var newHandlerInfo = handlerInfoFactory('param', {\n name: name,\n handler: handler,\n params: result.params\n });\n\n var oldHandlerInfo = oldState.handlerInfos[i];\n if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) {\n statesDiffer = true;\n newState.handlerInfos[i] = newHandlerInfo;\n } else {\n newState.handlerInfos[i] = oldHandlerInfo;\n }\n }\n\n merge(newState.queryParams, results.queryParams);\n\n return newState;\n }\n });\n\n /**\n Promise reject reasons passed to promise rejection\n handlers for failed transitions.\n */\n function UnrecognizedURLError(message) {\n this.message = (message || \"UnrecognizedURLError\");\n this.name = \"UnrecognizedURLError\";\n }\n });\ndefine(\"router/transition-state\", \n [\"./handler-info\",\"./utils\",\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var ResolvedHandlerInfo = __dependency1__.ResolvedHandlerInfo;\n var forEach = __dependency2__.forEach;\n var promiseLabel = __dependency2__.promiseLabel;\n var Promise = __dependency3__[\"default\"];\n\n function TransitionState(other) {\n this.handlerInfos = [];\n this.queryParams = {};\n this.params = {};\n }\n\n TransitionState.prototype = {\n handlerInfos: null,\n queryParams: null,\n params: null,\n\n promiseLabel: function(label) {\n var targetName = '';\n forEach(this.handlerInfos, function(handlerInfo) {\n if (targetName !== '') {\n targetName += '.';\n }\n targetName += handlerInfo.name;\n });\n return promiseLabel(\"'\" + targetName + \"': \" + label);\n },\n\n resolve: function(shouldContinue, payload) {\n var self = this;\n // First, calculate params for this state. This is useful\n // information to provide to the various route hooks.\n var params = this.params;\n forEach(this.handlerInfos, function(handlerInfo) {\n params[handlerInfo.name] = handlerInfo.params || {};\n });\n\n payload = payload || {};\n payload.resolveIndex = 0;\n\n var currentState = this;\n var wasAborted = false;\n\n // The prelude RSVP.resolve() asyncs us into the promise land.\n return Promise.resolve(null, this.promiseLabel(\"Start transition\"))\n .then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error'));\n\n function innerShouldContinue() {\n return Promise.resolve(shouldContinue(), promiseLabel(\"Check if should continue\"))['catch'](function(reason) {\n // We distinguish between errors that occurred\n // during resolution (e.g. beforeModel/model/afterModel),\n // and aborts due to a rejecting promise from shouldContinue().\n wasAborted = true;\n return Promise.reject(reason);\n }, promiseLabel(\"Handle abort\"));\n }\n\n function handleError(error) {\n // This is the only possible\n // reject value of TransitionState#resolve\n var handlerInfos = currentState.handlerInfos;\n var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ?\n handlerInfos.length - 1 : payload.resolveIndex;\n return Promise.reject({\n error: error,\n handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler,\n wasAborted: wasAborted,\n state: currentState\n });\n }\n\n function proceed(resolvedHandlerInfo) {\n var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved;\n\n // Swap the previously unresolved handlerInfo with\n // the resolved handlerInfo\n currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo;\n\n if (!wasAlreadyResolved) {\n // Call the redirect hook. The reason we call it here\n // vs. afterModel is so that redirects into child\n // routes don't re-run the model hooks for this\n // already-resolved route.\n var handler = resolvedHandlerInfo.handler;\n if (handler && handler.redirect) {\n handler.redirect(resolvedHandlerInfo.context, payload);\n }\n }\n\n // Proceed after ensuring that the redirect hook\n // didn't abort this transition by transitioning elsewhere.\n return innerShouldContinue().then(resolveOneHandlerInfo, null, promiseLabel('Resolve handler'));\n }\n\n function resolveOneHandlerInfo() {\n if (payload.resolveIndex === currentState.handlerInfos.length) {\n // This is is the only possible\n // fulfill value of TransitionState#resolve\n return {\n error: null,\n state: currentState\n };\n }\n\n var handlerInfo = currentState.handlerInfos[payload.resolveIndex];\n\n return handlerInfo.resolve(innerShouldContinue, payload)\n .then(proceed, null, promiseLabel('Proceed'));\n }\n }\n };\n\n __exports__[\"default\"] = TransitionState;\n });\ndefine(\"router/transition\", \n [\"rsvp/promise\",\"./handler-info\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var ResolvedHandlerInfo = __dependency2__.ResolvedHandlerInfo;\n var trigger = __dependency3__.trigger;\n var slice = __dependency3__.slice;\n var log = __dependency3__.log;\n var promiseLabel = __dependency3__.promiseLabel;\n\n /**\n @private\n\n A Transition is a thennable (a promise-like object) that represents\n an attempt to transition to another route. It can be aborted, either\n explicitly via `abort` or by attempting another transition while a\n previous one is still underway. An aborted transition can also\n be `retry()`d later.\n */\n function Transition(router, intent, state, error) {\n var transition = this;\n this.state = state || router.state;\n this.intent = intent;\n this.router = router;\n this.data = this.intent && this.intent.data || {};\n this.resolvedModels = {};\n this.queryParams = {};\n\n if (error) {\n this.promise = Promise.reject(error);\n return;\n }\n\n if (state) {\n this.params = state.params;\n this.queryParams = state.queryParams;\n\n var len = state.handlerInfos.length;\n if (len) {\n this.targetName = state.handlerInfos[state.handlerInfos.length-1].name;\n }\n\n for (var i = 0; i < len; ++i) {\n var handlerInfo = state.handlerInfos[i];\n\n // TODO: this all seems hacky\n if (!handlerInfo.isResolved) { break; }\n this.pivotHandler = handlerInfo.handler;\n }\n\n this.sequence = Transition.currentSequence++;\n this.promise = state.resolve(checkForAbort, this)['catch'](function(result) {\n if (result.wasAborted || transition.isAborted) {\n return Promise.reject(logAbort(transition));\n } else {\n transition.trigger('error', result.error, transition, result.handlerWithError);\n transition.abort();\n return Promise.reject(result.error);\n }\n }, promiseLabel('Handle Abort'));\n } else {\n this.promise = Promise.resolve(this.state);\n this.params = {};\n }\n\n function checkForAbort() {\n if (transition.isAborted) {\n return Promise.reject(undefined, promiseLabel(\"Transition aborted - reject\"));\n }\n }\n }\n\n Transition.currentSequence = 0;\n\n Transition.prototype = {\n targetName: null,\n urlMethod: 'update',\n intent: null,\n params: null,\n pivotHandler: null,\n resolveIndex: 0,\n handlerInfos: null,\n resolvedModels: null,\n isActive: true,\n state: null,\n\n isTransition: true,\n\n /**\n @public\n\n The Transition's internal promise. Calling `.then` on this property\n is that same as calling `.then` on the Transition object itself, but\n this property is exposed for when you want to pass around a\n Transition's promise, but not the Transition object itself, since\n Transition object can be externally `abort`ed, while the promise\n cannot.\n */\n promise: null,\n\n /**\n @public\n\n Custom state can be stored on a Transition's `data` object.\n This can be useful for decorating a Transition within an earlier\n hook and shared with a later hook. Properties set on `data` will\n be copied to new transitions generated by calling `retry` on this\n transition.\n */\n data: null,\n\n /**\n @public\n\n A standard promise hook that resolves if the transition\n succeeds and rejects if it fails/redirects/aborts.\n\n Forwards to the internal `promise` property which you can\n use in situations where you want to pass around a thennable,\n but not the Transition itself.\n\n @param {Function} success\n @param {Function} failure\n */\n then: function(success, failure) {\n return this.promise.then(success, failure);\n },\n\n /**\n @public\n\n Aborts the Transition. Note you can also implicitly abort a transition\n by initiating another transition while a previous one is underway.\n */\n abort: function() {\n if (this.isAborted) { return this; }\n log(this.router, this.sequence, this.targetName + \": transition was aborted\");\n this.intent.preTransitionState = this.router.state;\n this.isAborted = true;\n this.isActive = false;\n this.router.activeTransition = null;\n return this;\n },\n\n /**\n @public\n\n Retries a previously-aborted transition (making sure to abort the\n transition if it's still active). Returns a new transition that\n represents the new attempt to transition.\n */\n retry: function() {\n // TODO: add tests for merged state retry()s\n this.abort();\n return this.router.transitionByIntent(this.intent, false);\n },\n\n /**\n @public\n\n Sets the URL-changing method to be employed at the end of a\n successful transition. By default, a new Transition will just\n use `updateURL`, but passing 'replace' to this method will\n cause the URL to update using 'replaceWith' instead. Omitting\n a parameter will disable the URL change, allowing for transitions\n that don't update the URL at completion (this is also used for\n handleURL, since the URL has already changed before the\n transition took place).\n\n @param {String} method the type of URL-changing method to use\n at the end of a transition. Accepted values are 'replace',\n falsy values, or any other non-falsy value (which is\n interpreted as an updateURL transition).\n\n @return {Transition} this transition\n */\n method: function(method) {\n this.urlMethod = method;\n return this;\n },\n\n /**\n @public\n\n Fires an event on the current list of resolved/resolving\n handlers within this transition. Useful for firing events\n on route hierarchies that haven't fully been entered yet.\n\n Note: This method is also aliased as `send`\n\n @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error\n @param {String} name the name of the event to fire\n */\n trigger: function (ignoreFailure) {\n var args = slice.call(arguments);\n if (typeof ignoreFailure === 'boolean') {\n args.shift();\n } else {\n // Throw errors on unhandled trigger events by default\n ignoreFailure = false;\n }\n trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args);\n },\n\n /**\n @public\n\n Transitions are aborted and their promises rejected\n when redirects occur; this method returns a promise\n that will follow any redirects that occur and fulfill\n with the value fulfilled by any redirecting transitions\n that occur.\n\n @return {Promise} a promise that fulfills with the same\n value that the final redirecting transition fulfills with\n */\n followRedirects: function() {\n var router = this.router;\n return this.promise['catch'](function(reason) {\n if (router.activeTransition) {\n return router.activeTransition.followRedirects();\n }\n return Promise.reject(reason);\n });\n },\n\n toString: function() {\n return \"Transition (sequence \" + this.sequence + \")\";\n },\n\n /**\n @private\n */\n log: function(message) {\n log(this.router, this.sequence, message);\n }\n };\n\n // Alias 'trigger' as 'send'\n Transition.prototype.send = Transition.prototype.trigger;\n\n /**\n @private\n\n Logs and returns a TransitionAborted error.\n */\n function logAbort(transition) {\n log(transition.router, transition.sequence, \"detected abort.\");\n return new TransitionAborted();\n }\n\n function TransitionAborted(message) {\n this.message = (message || \"TransitionAborted\");\n this.name = \"TransitionAborted\";\n }\n\n __exports__.Transition = Transition;\n __exports__.logAbort = logAbort;\n __exports__.TransitionAborted = TransitionAborted;\n });\ndefine(\"router/utils\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var slice = Array.prototype.slice;\n\n var _isArray;\n if (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === \"[object Array]\";\n };\n } else {\n _isArray = Array.isArray;\n }\n\n var isArray = _isArray;\n __exports__.isArray = isArray;\n function merge(hash, other) {\n for (var prop in other) {\n if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; }\n }\n }\n\n var oCreate = Object.create || function(proto) {\n function F() {}\n F.prototype = proto;\n return new F();\n };\n __exports__.oCreate = oCreate;\n /**\n @private\n\n Extracts query params from the end of an array\n **/\n function extractQueryParams(array) {\n var len = (array && array.length), head, queryParams;\n\n if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) {\n queryParams = array[len - 1].queryParams;\n head = slice.call(array, 0, len - 1);\n return [head, queryParams];\n } else {\n return [array, null];\n }\n }\n\n __exports__.extractQueryParams = extractQueryParams;/**\n @private\n\n Coerces query param properties and array elements into strings.\n **/\n function coerceQueryParamsToString(queryParams) {\n for (var key in queryParams) {\n if (typeof queryParams[key] === 'number') {\n queryParams[key] = '' + queryParams[key];\n } else if (isArray(queryParams[key])) {\n for (var i = 0, l = queryParams[key].length; i < l; i++) {\n queryParams[key][i] = '' + queryParams[key][i];\n }\n }\n }\n }\n /**\n @private\n */\n function log(router, sequence, msg) {\n if (!router.log) { return; }\n\n if (arguments.length === 3) {\n router.log(\"Transition #\" + sequence + \": \" + msg);\n } else {\n msg = sequence;\n router.log(msg);\n }\n }\n\n __exports__.log = log;function bind(context, fn) {\n var boundArgs = arguments;\n return function(value) {\n var args = slice.call(boundArgs, 2);\n args.push(value);\n return fn.apply(context, args);\n };\n }\n\n __exports__.bind = bind;function isParam(object) {\n return (typeof object === \"string\" || object instanceof String || typeof object === \"number\" || object instanceof Number);\n }\n\n\n function forEach(array, callback) {\n for (var i=0, l=array.length; i<l && false !== callback(array[i]); i++) { }\n }\n\n __exports__.forEach = forEach;function trigger(router, handlerInfos, ignoreFailure, args) {\n if (router.triggerEvent) {\n router.triggerEvent(handlerInfos, ignoreFailure, args);\n return;\n }\n\n var name = args.shift();\n\n if (!handlerInfos) {\n if (ignoreFailure) { return; }\n throw new Error(\"Could not trigger event '\" + name + \"'. There are no active handlers\");\n }\n\n var eventWasHandled = false;\n\n for (var i=handlerInfos.length-1; i>=0; i--) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler.events && handler.events[name]) {\n if (handler.events[name].apply(handler, args) === true) {\n eventWasHandled = true;\n } else {\n return;\n }\n }\n }\n\n if (!eventWasHandled && !ignoreFailure) {\n throw new Error(\"Nothing handled the event '\" + name + \"'.\");\n }\n }\n\n __exports__.trigger = trigger;function getChangelist(oldObject, newObject) {\n var key;\n var results = {\n all: {},\n changed: {},\n removed: {}\n };\n\n merge(results.all, newObject);\n\n var didChange = false;\n coerceQueryParamsToString(oldObject);\n coerceQueryParamsToString(newObject);\n\n // Calculate removals\n for (key in oldObject) {\n if (oldObject.hasOwnProperty(key)) {\n if (!newObject.hasOwnProperty(key)) {\n didChange = true;\n results.removed[key] = oldObject[key];\n }\n }\n }\n\n // Calculate changes\n for (key in newObject) {\n if (newObject.hasOwnProperty(key)) {\n if (isArray(oldObject[key]) && isArray(newObject[key])) {\n if (oldObject[key].length !== newObject[key].length) {\n results.changed[key] = newObject[key];\n didChange = true;\n } else {\n for (var i = 0, l = oldObject[key].length; i < l; i++) {\n if (oldObject[key][i] !== newObject[key][i]) {\n results.changed[key] = newObject[key];\n didChange = true;\n }\n }\n }\n }\n else {\n if (oldObject[key] !== newObject[key]) {\n results.changed[key] = newObject[key];\n didChange = true;\n }\n }\n }\n }\n\n return didChange && results;\n }\n\n __exports__.getChangelist = getChangelist;function promiseLabel(label) {\n return 'Router: ' + label;\n }\n\n __exports__.promiseLabel = promiseLabel;function subclass(parentConstructor, proto) {\n function C(props) {\n parentConstructor.call(this, props || {});\n }\n C.prototype = oCreate(parentConstructor.prototype);\n merge(C.prototype, proto);\n return C;\n }\n\n __exports__.subclass = subclass;__exports__.merge = merge;\n __exports__.slice = slice;\n __exports__.isParam = isParam;\n __exports__.coerceQueryParamsToString = coerceQueryParamsToString;\n });\ndefine(\"router\", \n [\"./router/router\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Router = __dependency1__[\"default\"];\n\n __exports__[\"default\"] = Router;\n });\n\n})();\n//@ sourceURL=ember-routing");minispade.register('ember-runtime', "(function() {minispade.require(\"ember-metal\");\nminispade.require(\"rsvp\");\nminispade.require(\"container\");\ndefine(\"ember-runtime/compare\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-runtime/mixins/comparable\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // for Ember.ORDER_DEFINITION\n var typeOf = __dependency2__.typeOf;\n var Comparable = __dependency3__[\"default\"];\n\n // Used by Ember.compare\n Ember.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [\n 'undefined',\n 'null',\n 'boolean',\n 'number',\n 'string',\n 'array',\n 'object',\n 'instance',\n 'function',\n 'class',\n 'date'\n ];\n\n /**\n This will compare two javascript values of possibly different types.\n It will tell you which one is greater than the other by returning:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n The order is calculated based on `Ember.ORDER_DEFINITION`, if types are different.\n In case they have the same type an appropriate comparison for this type is made.\n\n ```javascript\n Ember.compare('hello', 'hello'); // 0\n Ember.compare('abc', 'dfg'); // -1\n Ember.compare(2, 1); // 1\n ```\n\n @method compare\n @for Ember\n @param {Object} v First value to compare\n @param {Object} w Second value to compare\n @return {Number} -1 if v < w, 0 if v = w and 1 if v > w.\n */\n function compare(v, w) {\n if (v === w) { return 0; }\n\n var type1 = typeOf(v);\n var type2 = typeOf(w);\n\n if (Comparable) {\n if (type1==='instance' && Comparable.detect(v.constructor)) {\n return v.constructor.compare(v, w);\n }\n\n if (type2 === 'instance' && Comparable.detect(w.constructor)) {\n return 1-w.constructor.compare(w, v);\n }\n }\n\n // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION,\n // do so now.\n var mapping = Ember.ORDER_DEFINITION_MAPPING;\n if (!mapping) {\n var order = Ember.ORDER_DEFINITION;\n mapping = Ember.ORDER_DEFINITION_MAPPING = {};\n var idx, len;\n for (idx = 0, len = order.length; idx < len; ++idx) {\n mapping[order[idx]] = idx;\n }\n\n // We no longer need Ember.ORDER_DEFINITION.\n delete Ember.ORDER_DEFINITION;\n }\n\n var type1Index = mapping[type1];\n var type2Index = mapping[type2];\n\n if (type1Index < type2Index) { return -1; }\n if (type1Index > type2Index) { return 1; }\n\n // types are equal - so we have to check values now\n switch (type1) {\n case 'boolean':\n case 'number':\n if (v < w) { return -1; }\n if (v > w) { return 1; }\n return 0;\n\n case 'string':\n var comp = v.localeCompare(w);\n if (comp < 0) { return -1; }\n if (comp > 0) { return 1; }\n return 0;\n\n case 'array':\n var vLen = v.length;\n var wLen = w.length;\n var l = Math.min(vLen, wLen);\n var r = 0;\n var i = 0;\n while (r === 0 && i < l) {\n r = compare(v[i],w[i]);\n i++;\n }\n if (r !== 0) { return r; }\n\n // all elements are equal now\n // shorter array should be ordered first\n if (vLen < wLen) { return -1; }\n if (vLen > wLen) { return 1; }\n // arrays are equal now\n return 0;\n\n case 'instance':\n if (Comparable && Comparable.detect(v)) {\n return v.compare(v, w);\n }\n return 0;\n\n case 'date':\n var vNum = v.getTime();\n var wNum = w.getTime();\n if (vNum < wNum) { return -1; }\n if (vNum > wNum) { return 1; }\n return 0;\n\n default:\n return 0;\n }\n };\n\n __exports__[\"default\"] = compare;\n });\ndefine(\"ember-runtime/computed/array_computed\",\n [\"ember-metal/core\",\"ember-runtime/computed/reduce_computed\",\"ember-metal/enumerable_utils\",\"ember-metal/platform\",\"ember-metal/observer\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var reduceComputed = __dependency2__.reduceComputed;\n var ReduceComputedProperty = __dependency2__.ReduceComputedProperty;\n var EnumerableUtils = __dependency3__[\"default\"];\n var create = __dependency4__.create;\n var addObserver = __dependency5__.addObserver;\n var EmberError = __dependency6__[\"default\"];\n\n var a_slice = [].slice,\n o_create = create,\n forEach = EnumerableUtils.forEach;\n\n function ArrayComputedProperty() {\n var cp = this;\n\n ReduceComputedProperty.apply(this, arguments);\n\n this.func = (function(reduceFunc) {\n return function (propertyName) {\n if (!cp._hasInstanceMeta(this, propertyName)) {\n // When we recompute an array computed property, we need already\n // retrieved arrays to be updated; we can't simply empty the cache and\n // hope the array is re-retrieved.\n forEach(cp._dependentKeys, function(dependentKey) {\n addObserver(this, dependentKey, function() {\n cp.recomputeOnce.call(this, propertyName);\n });\n }, this);\n }\n\n return reduceFunc.apply(this, arguments);\n };\n })(this.func);\n\n return this;\n }\n\n ArrayComputedProperty.prototype = o_create(ReduceComputedProperty.prototype);\n ArrayComputedProperty.prototype.initialValue = function () {\n return Ember.A();\n };\n ArrayComputedProperty.prototype.resetValue = function (array) {\n array.clear();\n return array;\n };\n\n // This is a stopgap to keep the reference counts correct with lazy CPs.\n ArrayComputedProperty.prototype.didChange = function (obj, keyName) {\n return;\n };\n\n /**\n Creates a computed property which operates on dependent arrays and\n is updated with \"one at a time\" semantics. When items are added or\n removed from the dependent array(s) an array computed only operates\n on the change instead of re-evaluating the entire array. This should\n return an array, if you'd like to use \"one at a time\" semantics and\n compute some value other then an array look at\n `Ember.reduceComputed`.\n\n If there are more than one arguments the first arguments are\n considered to be dependent property keys. The last argument is\n required to be an options object. The options object can have the\n following three properties.\n\n `initialize` - An optional initialize function. Typically this will be used\n to set up state on the instanceMeta object.\n\n `removedItem` - A function that is called each time an element is\n removed from the array.\n\n `addedItem` - A function that is called each time an element is\n added to the array.\n\n\n The `initialize` function has the following signature:\n\n ```javascript\n function(array, changeMeta, instanceMeta)\n ```\n\n `array` - The initial value of the arrayComputed, an empty array.\n\n `changeMeta` - An object which contains meta information about the\n computed. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n\n The `removedItem` and `addedItem` functions both have the following signature:\n\n ```javascript\n function(accumulatedValue, item, changeMeta, instanceMeta)\n ```\n\n `accumulatedValue` - The value returned from the last time\n `removedItem` or `addedItem` was called or an empty array.\n\n `item` - the element added or removed from the array\n\n `changeMeta` - An object which contains meta information about the\n change. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n - `index` the index of the added or removed item\n - `item` the added or removed item: this is exactly the same as\n the second arg\n - `arrayChanged` the array that triggered the change. Can be\n useful when depending on multiple arrays.\n\n For property changes triggered on an item property change (when\n depKey is something like `someArray.@each.someProperty`),\n `changeMeta` will also contain the following property:\n\n - `previousValues` an object whose keys are the properties that changed on\n the item, and whose values are the item's previous values.\n\n `previousValues` is important Ember coalesces item property changes via\n Ember.run.once. This means that by the time removedItem gets called, item has\n the new values, but you may need the previous value (eg for sorting &\n filtering).\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n The `removedItem` and `addedItem` functions should return the accumulated\n value. It is acceptable to not return anything (ie return undefined)\n to invalidate the computation. This is generally not a good idea for\n arrayComputed but it's used in eg max and min.\n\n Example\n\n ```javascript\n Ember.computed.map = function(dependentKey, callback) {\n var options = {\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var mapped = callback(item);\n array.insertAt(changeMeta.index, mapped);\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n array.removeAt(changeMeta.index, 1);\n return array;\n }\n };\n\n return Ember.arrayComputed(dependentKey, options);\n };\n ```\n\n @method arrayComputed\n @for Ember\n @param {String} [dependentKeys*]\n @param {Object} options\n @return {Ember.ComputedProperty}\n */\n function arrayComputed (options) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n options = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof options !== \"object\") {\n throw new EmberError(\"Array Computed Property declared without an options hash\");\n }\n\n var cp = new ArrayComputedProperty(options);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n };\n\n __exports__.arrayComputed = arrayComputed;\n __exports__.ArrayComputedProperty = ArrayComputedProperty;\n });\ndefine(\"ember-runtime/computed/reduce_computed\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/error\",\"ember-metal/property_events\",\"ember-metal/expand_properties\",\"ember-metal/observer\",\"ember-metal/computed\",\"ember-metal/platform\",\"ember-metal/enumerable_utils\",\"ember-runtime/system/tracked_array\",\"ember-runtime/mixins/array\",\"ember-metal/run_loop\",\"ember-runtime/system/set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var e_get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n var metaFor = __dependency4__.meta;\n var EmberError = __dependency5__[\"default\"];\n var propertyWillChange = __dependency6__.propertyWillChange;\n var propertyDidChange = __dependency6__.propertyDidChange;\n var expandProperties = __dependency7__[\"default\"];\n var addObserver = __dependency8__.addObserver;\n var observersFor = __dependency8__.observersFor;\n var removeObserver = __dependency8__.removeObserver;\n var addBeforeObserver = __dependency8__.addBeforeObserver;\n var removeBeforeObserver = __dependency8__.removeBeforeObserver;\n var ComputedProperty = __dependency9__.ComputedProperty;\n var cacheFor = __dependency9__.cacheFor;\n var create = __dependency10__.create;\n var EnumerableUtils = __dependency11__[\"default\"];\n var TrackedArray = __dependency12__[\"default\"];\n var EmberArray = __dependency13__[\"default\"];\n var run = __dependency14__[\"default\"];\n var Set = __dependency15__[\"default\"];\n var isArray = __dependency4__.isArray;\n\n var cacheSet = cacheFor.set,\n cacheGet = cacheFor.get,\n cacheRemove = cacheFor.remove,\n a_slice = [].slice,\n o_create = create,\n forEach = EnumerableUtils.forEach,\n // Here we explicitly don't allow `@each.foo`; it would require some special\n // testing, but there's no particular reason why it should be disallowed.\n eachPropertyPattern = /^(.*)\\.@each\\.(.*)/,\n doubleEachPropertyPattern = /(.*\\.@each){2,}/,\n arrayBracketPattern = /\\.\\[\\]$/;\n\n function get(obj, key) {\n if (key === '@this') {\n return obj;\n }\n\n return e_get(obj, key);\n }\n\n /*\n Tracks changes to dependent arrays, as well as to properties of items in\n dependent arrays.\n\n @class DependentArraysObserver\n */\n function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // the ReduceComputedPropertyInstanceMeta this DependentArraysObserver is\n // associated with\n this.instanceMeta = instanceMeta;\n\n // A map of array guids to dependentKeys, for the given context. We track\n // this because we want to set up the computed property potentially before the\n // dependent array even exists, but when the array observer fires, we lack\n // enough context to know what to update: we can recover that context by\n // getting the dependentKey.\n this.dependentKeysByGuid = {};\n\n // a map of dependent array guids -> TrackedArray instances. We use\n // this to lazily recompute indexes for item property observers.\n this.trackedArraysByGuid = {};\n\n // We suspend observers to ignore replacements from `reset` when totally\n // recomputing. Unfortunately we cannot properly suspend the observers\n // because we only have the key; instead we make the observers no-ops\n this.suspended = false;\n\n // This is used to coalesce item changes from property observers within a\n // single item.\n this.changedItems = {};\n // This is used to coalesce item changes for multiple items that depend on\n // some shared state.\n this.changedItemCount = 0;\n }\n\n function ItemPropertyObserverContext (dependentArray, index, trackedArray) {\n Ember.assert(\"Internal error: trackedArray is null or undefined\", trackedArray);\n\n this.dependentArray = dependentArray;\n this.index = index;\n this.item = dependentArray.objectAt(index);\n this.trackedArray = trackedArray;\n this.beforeObserver = null;\n this.observer = null;\n\n this.destroyed = false;\n }\n\n DependentArraysObserver.prototype = {\n setValue: function (newValue) {\n this.instanceMeta.setValue(newValue, true);\n },\n getValue: function () {\n return this.instanceMeta.getValue();\n },\n\n setupObservers: function (dependentArray, dependentKey) {\n this.dependentKeysByGuid[guidFor(dependentArray)] = dependentKey;\n\n dependentArray.addArrayObserver(this, {\n willChange: 'dependentArrayWillChange',\n didChange: 'dependentArrayDidChange'\n });\n\n if (this.cp._itemPropertyKeys[dependentKey]) {\n this.setupPropertyObservers(dependentKey, this.cp._itemPropertyKeys[dependentKey]);\n }\n },\n\n teardownObservers: function (dependentArray, dependentKey) {\n var itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || [];\n\n delete this.dependentKeysByGuid[guidFor(dependentArray)];\n\n this.teardownPropertyObservers(dependentKey, itemPropertyKeys);\n\n dependentArray.removeArrayObserver(this, {\n willChange: 'dependentArrayWillChange',\n didChange: 'dependentArrayDidChange'\n });\n },\n\n suspendArrayObservers: function (callback, binding) {\n var oldSuspended = this.suspended;\n this.suspended = true;\n callback.call(binding);\n this.suspended = oldSuspended;\n },\n\n setupPropertyObservers: function (dependentKey, itemPropertyKeys) {\n var dependentArray = get(this.instanceMeta.context, dependentKey),\n length = get(dependentArray, 'length'),\n observerContexts = new Array(length);\n\n this.resetTransformations(dependentKey, observerContexts);\n\n forEach(dependentArray, function (item, index) {\n var observerContext = this.createPropertyObserverContext(dependentArray, index, this.trackedArraysByGuid[dependentKey]);\n observerContexts[index] = observerContext;\n\n forEach(itemPropertyKeys, function (propertyKey) {\n addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver);\n addObserver(item, propertyKey, this, observerContext.observer);\n }, this);\n }, this);\n },\n\n teardownPropertyObservers: function (dependentKey, itemPropertyKeys) {\n var dependentArrayObserver = this,\n trackedArray = this.trackedArraysByGuid[dependentKey],\n beforeObserver,\n observer,\n item;\n\n if (!trackedArray) { return; }\n\n trackedArray.apply(function (observerContexts, offset, operation) {\n if (operation === TrackedArray.DELETE) { return; }\n\n forEach(observerContexts, function (observerContext) {\n observerContext.destroyed = true;\n beforeObserver = observerContext.beforeObserver;\n observer = observerContext.observer;\n item = observerContext.item;\n\n forEach(itemPropertyKeys, function (propertyKey) {\n removeBeforeObserver(item, propertyKey, dependentArrayObserver, beforeObserver);\n removeObserver(item, propertyKey, dependentArrayObserver, observer);\n });\n });\n });\n },\n\n createPropertyObserverContext: function (dependentArray, index, trackedArray) {\n var observerContext = new ItemPropertyObserverContext(dependentArray, index, trackedArray);\n\n this.createPropertyObserver(observerContext);\n\n return observerContext;\n },\n\n createPropertyObserver: function (observerContext) {\n var dependentArrayObserver = this;\n\n observerContext.beforeObserver = function (obj, keyName) {\n return dependentArrayObserver.itemPropertyWillChange(obj, keyName, observerContext.dependentArray, observerContext);\n };\n observerContext.observer = function (obj, keyName) {\n return dependentArrayObserver.itemPropertyDidChange(obj, keyName, observerContext.dependentArray, observerContext);\n };\n },\n\n resetTransformations: function (dependentKey, observerContexts) {\n this.trackedArraysByGuid[dependentKey] = new TrackedArray(observerContexts);\n },\n\n trackAdd: function (dependentKey, index, newItems) {\n var trackedArray = this.trackedArraysByGuid[dependentKey];\n if (trackedArray) {\n trackedArray.addItems(index, newItems);\n }\n },\n\n trackRemove: function (dependentKey, index, removedCount) {\n var trackedArray = this.trackedArraysByGuid[dependentKey];\n\n if (trackedArray) {\n return trackedArray.removeItems(index, removedCount);\n }\n\n return [];\n },\n\n updateIndexes: function (trackedArray, array) {\n var length = get(array, 'length');\n // OPTIMIZE: we could stop updating once we hit the object whose observer\n // fired; ie partially apply the transformations\n trackedArray.apply(function (observerContexts, offset, operation, operationIndex) {\n // we don't even have observer contexts for removed items, even if we did,\n // they no longer have any index in the array\n if (operation === TrackedArray.DELETE) { return; }\n if (operationIndex === 0 && operation === TrackedArray.RETAIN && observerContexts.length === length && offset === 0) {\n // If we update many items we don't want to walk the array each time: we\n // only need to update the indexes at most once per run loop.\n return;\n }\n\n forEach(observerContexts, function (context, index) {\n context.index = index + offset;\n });\n });\n },\n\n dependentArrayWillChange: function (dependentArray, index, removedCount, addedCount) {\n if (this.suspended) { return; }\n\n var removedItem = this.callbacks.removedItem,\n changeMeta,\n guid = guidFor(dependentArray),\n dependentKey = this.dependentKeysByGuid[guid],\n itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || [],\n length = get(dependentArray, 'length'),\n normalizedIndex = normalizeIndex(index, length, 0),\n normalizedRemoveCount = normalizeRemoveCount(normalizedIndex, length, removedCount),\n item,\n itemIndex,\n sliceIndex,\n observerContexts;\n\n observerContexts = this.trackRemove(dependentKey, normalizedIndex, normalizedRemoveCount);\n\n function removeObservers(propertyKey) {\n observerContexts[sliceIndex].destroyed = true;\n removeBeforeObserver(item, propertyKey, this, observerContexts[sliceIndex].beforeObserver);\n removeObserver(item, propertyKey, this, observerContexts[sliceIndex].observer);\n }\n\n for (sliceIndex = normalizedRemoveCount - 1; sliceIndex >= 0; --sliceIndex) {\n itemIndex = normalizedIndex + sliceIndex;\n if (itemIndex >= length) { break; }\n\n item = dependentArray.objectAt(itemIndex);\n\n forEach(itemPropertyKeys, removeObservers, this);\n\n changeMeta = createChangeMeta(dependentArray, item, itemIndex, this.instanceMeta.propertyName, this.cp);\n this.setValue( removedItem.call(\n this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta));\n }\n },\n\n dependentArrayDidChange: function (dependentArray, index, removedCount, addedCount) {\n if (this.suspended) { return; }\n\n var addedItem = this.callbacks.addedItem,\n guid = guidFor(dependentArray),\n dependentKey = this.dependentKeysByGuid[guid],\n observerContexts = new Array(addedCount),\n itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey],\n length = get(dependentArray, 'length'),\n normalizedIndex = normalizeIndex(index, length, addedCount),\n changeMeta,\n observerContext;\n\n forEach(dependentArray.slice(normalizedIndex, normalizedIndex + addedCount), function (item, sliceIndex) {\n if (itemPropertyKeys) {\n observerContext =\n observerContexts[sliceIndex] =\n this.createPropertyObserverContext(dependentArray, normalizedIndex + sliceIndex, this.trackedArraysByGuid[dependentKey]);\n forEach(itemPropertyKeys, function (propertyKey) {\n addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver);\n addObserver(item, propertyKey, this, observerContext.observer);\n }, this);\n }\n\n changeMeta = createChangeMeta(dependentArray, item, normalizedIndex + sliceIndex, this.instanceMeta.propertyName, this.cp);\n this.setValue( addedItem.call(\n this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta));\n }, this);\n\n this.trackAdd(dependentKey, normalizedIndex, observerContexts);\n },\n\n itemPropertyWillChange: function (obj, keyName, array, observerContext) {\n var guid = guidFor(obj);\n\n if (!this.changedItems[guid]) {\n this.changedItems[guid] = {\n array: array,\n observerContext: observerContext,\n obj: obj,\n previousValues: {}\n };\n }\n ++this.changedItemCount;\n\n this.changedItems[guid].previousValues[keyName] = get(obj, keyName);\n },\n\n itemPropertyDidChange: function(obj, keyName, array, observerContext) {\n if (--this.changedItemCount === 0) {\n this.flushChanges();\n }\n },\n\n flushChanges: function() {\n var changedItems = this.changedItems, key, c, changeMeta;\n\n for (key in changedItems) {\n c = changedItems[key];\n if (c.observerContext.destroyed) { continue; }\n\n this.updateIndexes(c.observerContext.trackedArray, c.observerContext.dependentArray);\n\n changeMeta = createChangeMeta(c.array, c.obj, c.observerContext.index, this.instanceMeta.propertyName, this.cp, c.previousValues);\n this.setValue(\n this.callbacks.removedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta));\n this.setValue(\n this.callbacks.addedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta));\n }\n this.changedItems = {};\n }\n };\n\n function normalizeIndex(index, length, newItemsOffset) {\n if (index < 0) {\n return Math.max(0, length + index);\n } else if (index < length) {\n return index;\n } else /* index > length */ {\n return Math.min(length - newItemsOffset, index);\n }\n }\n\n function normalizeRemoveCount(index, length, removedCount) {\n return Math.min(removedCount, length - index);\n }\n\n function createChangeMeta(dependentArray, item, index, propertyName, property, previousValues) {\n var meta = {\n arrayChanged: dependentArray,\n index: index,\n item: item,\n propertyName: propertyName,\n property: property\n };\n\n if (previousValues) {\n // previous values only available for item property changes\n meta.previousValues = previousValues;\n }\n\n return meta;\n }\n\n function addItems (dependentArray, callbacks, cp, propertyName, meta) {\n forEach(dependentArray, function (item, index) {\n meta.setValue( callbacks.addedItem.call(\n this, meta.getValue(), item, createChangeMeta(dependentArray, item, index, propertyName, cp), meta.sugarMeta));\n }, this);\n }\n\n function reset(cp, propertyName) {\n var callbacks = cp._callbacks(),\n meta;\n\n if (cp._hasInstanceMeta(this, propertyName)) {\n meta = cp._instanceMeta(this, propertyName);\n meta.setValue(cp.resetValue(meta.getValue()));\n } else {\n meta = cp._instanceMeta(this, propertyName);\n }\n\n if (cp.options.initialize) {\n cp.options.initialize.call(this, meta.getValue(), { property: cp, propertyName: propertyName }, meta.sugarMeta);\n }\n }\n\n function partiallyRecomputeFor(obj, dependentKey) {\n if (arrayBracketPattern.test(dependentKey)) {\n return false;\n }\n\n var value = get(obj, dependentKey);\n return EmberArray.detect(value);\n }\n\n function ReduceComputedPropertyInstanceMeta(context, propertyName, initialValue) {\n this.context = context;\n this.propertyName = propertyName;\n this.cache = metaFor(context).cache;\n\n this.dependentArrays = {};\n this.sugarMeta = {};\n\n this.initialValue = initialValue;\n }\n\n ReduceComputedPropertyInstanceMeta.prototype = {\n getValue: function () {\n var value = cacheGet(this.cache, this.propertyName);\n if (value !== undefined) {\n return value;\n } else {\n return this.initialValue;\n }\n },\n\n setValue: function(newValue, triggerObservers) {\n // This lets sugars force a recomputation, handy for very simple\n // implementations of eg max.\n if (newValue === cacheGet(this.cache, this.propertyName)) {\n return;\n }\n\n if (triggerObservers) {\n propertyWillChange(this.context, this.propertyName);\n }\n\n if (newValue === undefined) {\n cacheRemove(this.cache, this.propertyName);\n } else {\n cacheSet(this.cache, this.propertyName, newValue);\n }\n\n if (triggerObservers) {\n propertyDidChange(this.context, this.propertyName);\n }\n }\n };\n\n /**\n A computed property whose dependent keys are arrays and which is updated with\n \"one at a time\" semantics.\n\n @class ReduceComputedProperty\n @namespace Ember\n @extends Ember.ComputedProperty\n @constructor\n */\n function ReduceComputedProperty(options) {\n var cp = this;\n\n this.options = options;\n\n this._dependentKeys = null;\n // A map of dependentKey -> [itemProperty, ...] that tracks what properties of\n // items in the array we must track to update this property.\n this._itemPropertyKeys = {};\n this._previousItemPropertyKeys = {};\n\n this.readOnly();\n this.cacheable();\n\n this.recomputeOnce = function(propertyName) {\n // What we really want to do is coalesce by <cp, propertyName>.\n // We need a form of `scheduleOnce` that accepts an arbitrary token to\n // coalesce by, in addition to the target and method.\n run.once(this, recompute, propertyName);\n };\n var recompute = function(propertyName) {\n var dependentKeys = cp._dependentKeys,\n meta = cp._instanceMeta(this, propertyName),\n callbacks = cp._callbacks();\n\n reset.call(this, cp, propertyName);\n\n meta.dependentArraysObserver.suspendArrayObservers(function () {\n forEach(cp._dependentKeys, function (dependentKey) {\n Ember.assert(\n \"dependent array \" + dependentKey + \" must be an `Ember.Array`. \" +\n \"If you are not extending arrays, you will need to wrap native arrays with `Ember.A`\",\n !(isArray(get(this, dependentKey)) && !EmberArray.detect(get(this, dependentKey))));\n\n if (!partiallyRecomputeFor(this, dependentKey)) { return; }\n\n var dependentArray = get(this, dependentKey),\n previousDependentArray = meta.dependentArrays[dependentKey];\n\n if (dependentArray === previousDependentArray) {\n // The array may be the same, but our item property keys may have\n // changed, so we set them up again. We can't easily tell if they've\n // changed: the array may be the same object, but with different\n // contents.\n if (cp._previousItemPropertyKeys[dependentKey]) {\n delete cp._previousItemPropertyKeys[dependentKey];\n meta.dependentArraysObserver.setupPropertyObservers(dependentKey, cp._itemPropertyKeys[dependentKey]);\n }\n } else {\n meta.dependentArrays[dependentKey] = dependentArray;\n\n if (previousDependentArray) {\n meta.dependentArraysObserver.teardownObservers(previousDependentArray, dependentKey);\n }\n\n if (dependentArray) {\n meta.dependentArraysObserver.setupObservers(dependentArray, dependentKey);\n }\n }\n }, this);\n }, this);\n\n forEach(cp._dependentKeys, function(dependentKey) {\n if (!partiallyRecomputeFor(this, dependentKey)) { return; }\n\n var dependentArray = get(this, dependentKey);\n if (dependentArray) {\n addItems.call(this, dependentArray, callbacks, cp, propertyName, meta);\n }\n }, this);\n };\n\n\n this.func = function (propertyName) {\n Ember.assert(\"Computed reduce values require at least one dependent key\", cp._dependentKeys);\n\n recompute.call(this, propertyName);\n\n return cp._instanceMeta(this, propertyName).getValue();\n };\n }\n\n ReduceComputedProperty.prototype = o_create(ComputedProperty.prototype);\n\n function defaultCallback(computedValue) {\n return computedValue;\n }\n\n ReduceComputedProperty.prototype._callbacks = function () {\n if (!this.callbacks) {\n var options = this.options;\n this.callbacks = {\n removedItem: options.removedItem || defaultCallback,\n addedItem: options.addedItem || defaultCallback\n };\n }\n return this.callbacks;\n };\n\n ReduceComputedProperty.prototype._hasInstanceMeta = function (context, propertyName) {\n return !!metaFor(context).cacheMeta[propertyName];\n };\n\n ReduceComputedProperty.prototype._instanceMeta = function (context, propertyName) {\n var cacheMeta = metaFor(context).cacheMeta,\n meta = cacheMeta[propertyName];\n\n if (!meta) {\n meta = cacheMeta[propertyName] = new ReduceComputedPropertyInstanceMeta(context, propertyName, this.initialValue());\n meta.dependentArraysObserver = new DependentArraysObserver(this._callbacks(), this, meta, context, propertyName, meta.sugarMeta);\n }\n\n return meta;\n };\n\n ReduceComputedProperty.prototype.initialValue = function () {\n if (typeof this.options.initialValue === 'function') {\n return this.options.initialValue();\n }\n else {\n return this.options.initialValue;\n }\n };\n\n ReduceComputedProperty.prototype.resetValue = function (value) {\n return this.initialValue();\n };\n\n ReduceComputedProperty.prototype.itemPropertyKey = function (dependentArrayKey, itemPropertyKey) {\n this._itemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey] || [];\n this._itemPropertyKeys[dependentArrayKey].push(itemPropertyKey);\n };\n\n ReduceComputedProperty.prototype.clearItemPropertyKeys = function (dependentArrayKey) {\n if (this._itemPropertyKeys[dependentArrayKey]) {\n this._previousItemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey];\n this._itemPropertyKeys[dependentArrayKey] = [];\n }\n };\n\n ReduceComputedProperty.prototype.property = function () {\n var cp = this,\n args = a_slice.call(arguments),\n propertyArgs = new Set(),\n match,\n dependentArrayKey,\n itemPropertyKey;\n\n forEach(args, function (dependentKey) {\n if (doubleEachPropertyPattern.test(dependentKey)) {\n throw new EmberError(\"Nested @each properties not supported: \" + dependentKey);\n } else if (match = eachPropertyPattern.exec(dependentKey)) {\n dependentArrayKey = match[1];\n\n var itemPropertyKeyPattern = match[2],\n addItemPropertyKey = function (itemPropertyKey) {\n cp.itemPropertyKey(dependentArrayKey, itemPropertyKey);\n };\n\n expandProperties(itemPropertyKeyPattern, addItemPropertyKey);\n propertyArgs.add(dependentArrayKey);\n } else {\n propertyArgs.add(dependentKey);\n }\n });\n\n return ComputedProperty.prototype.property.apply(this, propertyArgs.toArray());\n\n };\n\n /**\n Creates a computed property which operates on dependent arrays and\n is updated with \"one at a time\" semantics. When items are added or\n removed from the dependent array(s) a reduce computed only operates\n on the change instead of re-evaluating the entire array.\n\n If there are more than one arguments the first arguments are\n considered to be dependent property keys. The last argument is\n required to be an options object. The options object can have the\n following four properties:\n\n `initialValue` - A value or function that will be used as the initial\n value for the computed. If this property is a function the result of calling\n the function will be used as the initial value. This property is required.\n\n `initialize` - An optional initialize function. Typically this will be used\n to set up state on the instanceMeta object.\n\n `removedItem` - A function that is called each time an element is removed\n from the array.\n\n `addedItem` - A function that is called each time an element is added to\n the array.\n\n\n The `initialize` function has the following signature:\n\n ```javascript\n function(initialValue, changeMeta, instanceMeta)\n ```\n\n `initialValue` - The value of the `initialValue` property from the\n options object.\n\n `changeMeta` - An object which contains meta information about the\n computed. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n\n The `removedItem` and `addedItem` functions both have the following signature:\n\n ```javascript\n function(accumulatedValue, item, changeMeta, instanceMeta)\n ```\n\n `accumulatedValue` - The value returned from the last time\n `removedItem` or `addedItem` was called or `initialValue`.\n\n `item` - the element added or removed from the array\n\n `changeMeta` - An object which contains meta information about the\n change. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n - `index` the index of the added or removed item\n - `item` the added or removed item: this is exactly the same as\n the second arg\n - `arrayChanged` the array that triggered the change. Can be\n useful when depending on multiple arrays.\n\n For property changes triggered on an item property change (when\n depKey is something like `someArray.@each.someProperty`),\n `changeMeta` will also contain the following property:\n\n - `previousValues` an object whose keys are the properties that changed on\n the item, and whose values are the item's previous values.\n\n `previousValues` is important Ember coalesces item property changes via\n Ember.run.once. This means that by the time removedItem gets called, item has\n the new values, but you may need the previous value (eg for sorting &\n filtering).\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n The `removedItem` and `addedItem` functions should return the accumulated\n value. It is acceptable to not return anything (ie return undefined)\n to invalidate the computation. This is generally not a good idea for\n arrayComputed but it's used in eg max and min.\n\n Note that observers will be fired if either of these functions return a value\n that differs from the accumulated value. When returning an object that\n mutates in response to array changes, for example an array that maps\n everything from some other array (see `Ember.computed.map`), it is usually\n important that the *same* array be returned to avoid accidentally triggering observers.\n\n Example\n\n ```javascript\n Ember.computed.max = function(dependentKey) {\n return Ember.reduceComputed(dependentKey, {\n initialValue: -Infinity,\n\n addedItem: function(accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.max(accumulatedValue, item);\n },\n\n removedItem: function(accumulatedValue, item, changeMeta, instanceMeta) {\n if (item < accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n };\n ```\n\n Dependent keys may refer to `@this` to observe changes to the object itself,\n which must be array-like, rather than a property of the object. This is\n mostly useful for array proxies, to ensure objects are retrieved via\n `objectAtContent`. This is how you could sort items by properties defined on an item controller.\n\n Example\n\n ```javascript\n App.PeopleController = Ember.ArrayController.extend({\n itemController: 'person',\n\n sortedPeople: Ember.computed.sort('@this.@each.reversedName', function(personA, personB) {\n // `reversedName` isn't defined on Person, but we have access to it via\n // the item controller App.PersonController. If we'd used\n // `content.@each.reversedName` above, we would be getting the objects\n // directly and not have access to `reversedName`.\n //\n var reversedNameA = get(personA, 'reversedName'),\n reversedNameB = get(personB, 'reversedName');\n\n return Ember.compare(reversedNameA, reversedNameB);\n })\n });\n\n App.PersonController = Ember.ObjectController.extend({\n reversedName: function() {\n return reverse(get(this, 'name'));\n }.property('name')\n });\n ```\n\n Dependent keys whose values are not arrays are treated as regular\n dependencies: when they change, the computed property is completely\n recalculated. It is sometimes useful to have dependent arrays with similar\n semantics. Dependent keys which end in `.[]` do not use \"one at a time\"\n semantics. When an item is added or removed from such a dependency, the\n computed property is completely recomputed.\n\n When the computed property is completely recomputed, the `accumulatedValue`\n is discarded, it starts with `initialValue` again, and each item is passed\n to `addedItem` in turn.\n\n Example\n\n ```javascript\n Ember.Object.extend({\n // When `string` is changed, `computed` is completely recomputed.\n string: 'a string',\n\n // When an item is added to `array`, `addedItem` is called.\n array: [],\n\n // When an item is added to `anotherArray`, `computed` is completely\n // recomputed.\n anotherArray: [],\n\n computed: Ember.reduceComputed('string', 'array', 'anotherArray.[]', {\n addedItem: addedItemCallback,\n removedItem: removedItemCallback\n })\n });\n ```\n\n @method reduceComputed\n @for Ember\n @param {String} [dependentKeys*]\n @param {Object} options\n @return {Ember.ComputedProperty}\n */\n function reduceComputed(options) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n options = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof options !== \"object\") {\n throw new EmberError(\"Reduce Computed Property declared without an options hash\");\n }\n\n if (!('initialValue' in options)) {\n throw new EmberError(\"Reduce Computed Property declared without an initial value\");\n }\n\n var cp = new ReduceComputedProperty(options);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n }\n\n __exports__.reduceComputed = reduceComputed;\n __exports__.ReduceComputedProperty = ReduceComputedProperty;\n });\ndefine(\"ember-runtime/computed/reduce_computed_macros\",\n [\"ember-metal/core\",\"ember-metal/merge\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"ember-metal/run_loop\",\"ember-metal/observer\",\"ember-runtime/computed/array_computed\",\"ember-runtime/computed/reduce_computed\",\"ember-runtime/system/object_proxy\",\"ember-runtime/system/subarray\",\"ember-runtime/keys\",\"ember-runtime/compare\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var merge = __dependency2__[\"default\"];\n var get = __dependency3__.get;\n var set = __dependency4__.set;\n var isArray = __dependency5__.isArray;\n var guidFor = __dependency5__.guidFor;\n var EmberError = __dependency6__[\"default\"];\n var EnumerableUtils = __dependency7__[\"default\"];\n var run = __dependency8__[\"default\"];\n var addObserver = __dependency9__.addObserver;\n var arrayComputed = __dependency10__.arrayComputed;\n var reduceComputed = __dependency11__.reduceComputed;\n var ObjectProxy = __dependency12__[\"default\"];\n var SubArray = __dependency13__[\"default\"];\n var keys = __dependency14__[\"default\"];\n var compare = __dependency15__[\"default\"];\n\n var a_slice = [].slice,\n forEach = EnumerableUtils.forEach,\n SearchProxy;\n\n /**\n A computed property that returns the sum of the value\n in the dependent array.\n\n @method computed.sum\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the sum of all values in the dependentKey's array\n @since 1.4.0\n */\n\n function sum(dependentKey){\n return reduceComputed(dependentKey, {\n initialValue: 0,\n\n addedItem: function(accumulatedValue, item, changeMeta, instanceMeta){\n return accumulatedValue + item;\n },\n\n removedItem: function(accumulatedValue, item, changeMeta, instanceMeta){\n return accumulatedValue - item;\n }\n });\n };\n\n /**\n A computed property that calculates the maximum value in the\n dependent array. This will return `-Infinity` when the dependent\n array is empty.\n\n ```javascript\n var Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age'),\n maxChildAge: Ember.computed.max('childAges')\n });\n\n var lordByron = Person.create({ children: [] });\n\n lordByron.get('maxChildAge'); // -Infinity\n lordByron.get('children').pushObject({\n name: 'Augusta Ada Byron', age: 7\n });\n lordByron.get('maxChildAge'); // 7\n lordByron.get('children').pushObjects([{\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }]);\n lordByron.get('maxChildAge'); // 8\n ```\n\n @method computed.max\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array\n */\n function max (dependentKey) {\n return reduceComputed(dependentKey, {\n initialValue: -Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.max(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item < accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n };\n\n /**\n A computed property that calculates the minimum value in the\n dependent array. This will return `Infinity` when the dependent\n array is empty.\n\n ```javascript\n var Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age'),\n minChildAge: Ember.computed.min('childAges')\n });\n\n var lordByron = Person.create({ children: [] });\n\n lordByron.get('minChildAge'); // Infinity\n lordByron.get('children').pushObject({\n name: 'Augusta Ada Byron', age: 7\n });\n lordByron.get('minChildAge'); // 7\n lordByron.get('children').pushObjects([{\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }]);\n lordByron.get('minChildAge'); // 5\n ```\n\n @method computed.min\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array\n */\n function min(dependentKey) {\n return reduceComputed(dependentKey, {\n initialValue: Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.min(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item > accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n };\n\n /**\n Returns an array mapped via the callback\n\n The callback method you provide should have the following signature.\n `item` is the current item in the iteration.\n\n ```javascript\n function(item);\n ```\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n excitingChores: Ember.computed.map('chores', function(chore) {\n return chore.toUpperCase() + '!';\n })\n });\n\n var hamster = Hamster.create({\n chores: ['clean', 'write more unit tests']\n });\n\n hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!']\n ```\n\n @method computed.map\n @for Ember\n @param {String} dependentKey\n @param {Function} callback\n @return {Ember.ComputedProperty} an array mapped via the callback\n */\n function map(dependentKey, callback) {\n var options = {\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var mapped = callback.call(this, item);\n array.insertAt(changeMeta.index, mapped);\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n array.removeAt(changeMeta.index, 1);\n return array;\n }\n };\n\n return arrayComputed(dependentKey, options);\n };\n\n /**\n Returns an array mapped to the specified key.\n\n ```javascript\n var Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age')\n });\n\n var lordByron = Person.create({ children: [] });\n\n lordByron.get('childAges'); // []\n lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 });\n lordByron.get('childAges'); // [7]\n lordByron.get('children').pushObjects([{\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }]);\n lordByron.get('childAges'); // [7, 5, 8]\n ```\n\n @method computed.mapBy\n @for Ember\n @param {String} dependentKey\n @param {String} propertyKey\n @return {Ember.ComputedProperty} an array mapped to the specified key\n */\n function mapBy (dependentKey, propertyKey) {\n var callback = function(item) { return get(item, propertyKey); };\n return map(dependentKey + '.@each.' + propertyKey, callback);\n };\n\n /**\n @method computed.mapProperty\n @for Ember\n @deprecated Use `Ember.computed.mapBy` instead\n @param dependentKey\n @param propertyKey\n */\n var mapProperty = mapBy;\n\n /**\n Filters the array by the callback.\n\n The callback method you provide should have the following signature.\n `item` is the current item in the iteration.\n\n ```javascript\n function(item);\n ```\n\n ```javascript\n var Hamster = Ember.Object.extend({\n remainingChores: Ember.computed.filter('chores', function(chore) {\n return !chore.done;\n })\n });\n\n var hamster = Hamster.create({ \n chores: [\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n ] \n });\n\n hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}]\n ```\n\n @method computed.filter\n @for Ember\n @param {String} dependentKey\n @param {Function} callback\n @return {Ember.ComputedProperty} the filtered array\n */\n function filter(dependentKey, callback) {\n var options = {\n initialize: function (array, changeMeta, instanceMeta) {\n instanceMeta.filteredArrayIndexes = new SubArray();\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var match = !!callback.call(this, item),\n filterIndex = instanceMeta.filteredArrayIndexes.addItem(changeMeta.index, match);\n\n if (match) {\n array.insertAt(filterIndex, item);\n }\n\n return array;\n },\n\n removedItem: function(array, item, changeMeta, instanceMeta) {\n var filterIndex = instanceMeta.filteredArrayIndexes.removeItem(changeMeta.index);\n\n if (filterIndex > -1) {\n array.removeAt(filterIndex);\n }\n\n return array;\n }\n };\n\n return arrayComputed(dependentKey, options);\n };\n\n /**\n Filters the array by the property and value\n\n ```javascript\n var Hamster = Ember.Object.extend({\n remainingChores: Ember.computed.filterBy('chores', 'done', false)\n });\n\n var hamster = Hamster.create({\n chores: [\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n ]\n });\n\n hamster.get('remainingChores'); // [{ name: 'write more unit tests', done: false }]\n ```\n\n @method computed.filterBy\n @for Ember\n @param {String} dependentKey\n @param {String} propertyKey\n @param {*} value\n @return {Ember.ComputedProperty} the filtered array\n */\n function filterBy (dependentKey, propertyKey, value) {\n var callback;\n\n if (arguments.length === 2) {\n callback = function(item) {\n return get(item, propertyKey);\n };\n } else {\n callback = function(item) {\n return get(item, propertyKey) === value;\n };\n }\n\n return filter(dependentKey + '.@each.' + propertyKey, callback);\n };\n\n /**\n @method computed.filterProperty\n @for Ember\n @param dependentKey\n @param propertyKey\n @param value\n @deprecated Use `Ember.computed.filterBy` instead\n */\n var filterProperty = filterBy;\n\n /**\n A computed property which returns a new array with all the unique\n elements from one or more dependent arrays.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n uniqueFruits: Ember.computed.uniq('fruits')\n });\n\n var hamster = Hamster.create({\n fruits: [\n 'banana',\n 'grape',\n 'kale',\n 'banana'\n ]\n });\n\n hamster.get('uniqueFruits'); // ['banana', 'grape', 'kale']\n ```\n\n @method computed.uniq\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n unique elements from the dependent array\n */\n function uniq() {\n var args = a_slice.call(arguments);\n args.push({\n initialize: function(array, changeMeta, instanceMeta) {\n instanceMeta.itemCounts = {};\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var guid = guidFor(item);\n\n if (!instanceMeta.itemCounts[guid]) {\n instanceMeta.itemCounts[guid] = 1;\n } else {\n ++instanceMeta.itemCounts[guid];\n }\n array.addObject(item);\n return array;\n },\n removedItem: function(array, item, _, instanceMeta) {\n var guid = guidFor(item),\n itemCounts = instanceMeta.itemCounts;\n\n if (--itemCounts[guid] === 0) {\n array.removeObject(item);\n }\n return array;\n }\n });\n return arrayComputed.apply(null, args);\n };\n\n /**\n Alias for [Ember.computed.uniq](/api/#method_computed_uniq).\n\n @method computed.union\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n unique elements from the dependent array\n */\n var union = uniq;\n\n /**\n A computed property which returns a new array with all the duplicated\n elements from two or more dependent arrays.\n\n Example\n\n ```javascript\n var obj = Ember.Object.createWithMixins({\n adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'],\n friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends')\n });\n\n obj.get('friendsInCommon'); // ['William King', 'Mary Somerville']\n ```\n\n @method computed.intersect\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n duplicated elements from the dependent arrays\n */\n function intersect() {\n var getDependentKeyGuids = function (changeMeta) {\n return EnumerableUtils.map(changeMeta.property._dependentKeys, function (dependentKey) {\n return guidFor(dependentKey);\n });\n };\n\n var args = a_slice.call(arguments);\n args.push({\n initialize: function (array, changeMeta, instanceMeta) {\n instanceMeta.itemCounts = {};\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var itemGuid = guidFor(item),\n dependentGuids = getDependentKeyGuids(changeMeta),\n dependentGuid = guidFor(changeMeta.arrayChanged),\n numberOfDependentArrays = changeMeta.property._dependentKeys.length,\n itemCounts = instanceMeta.itemCounts;\n\n if (!itemCounts[itemGuid]) { itemCounts[itemGuid] = {}; }\n if (itemCounts[itemGuid][dependentGuid] === undefined) { itemCounts[itemGuid][dependentGuid] = 0; }\n\n if (++itemCounts[itemGuid][dependentGuid] === 1 &&\n numberOfDependentArrays === keys(itemCounts[itemGuid]).length) {\n\n array.addObject(item);\n }\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n var itemGuid = guidFor(item),\n dependentGuids = getDependentKeyGuids(changeMeta),\n dependentGuid = guidFor(changeMeta.arrayChanged),\n numberOfDependentArrays = changeMeta.property._dependentKeys.length,\n numberOfArraysItemAppearsIn,\n itemCounts = instanceMeta.itemCounts;\n\n if (itemCounts[itemGuid][dependentGuid] === undefined) { itemCounts[itemGuid][dependentGuid] = 0; }\n if (--itemCounts[itemGuid][dependentGuid] === 0) {\n delete itemCounts[itemGuid][dependentGuid];\n numberOfArraysItemAppearsIn = keys(itemCounts[itemGuid]).length;\n\n if (numberOfArraysItemAppearsIn === 0) {\n delete itemCounts[itemGuid];\n }\n array.removeObject(item);\n }\n return array;\n }\n });\n return arrayComputed.apply(null, args);\n };\n\n /**\n A computed property which returns a new array with all the\n properties from the first dependent array that are not in the second\n dependent array.\n\n Example\n\n ```javascript\n var Hamster = Ember.Object.extend({\n likes: ['banana', 'grape', 'kale'],\n wants: Ember.computed.setDiff('likes', 'fruits')\n });\n\n var hamster = Hamster.create({\n fruits: [\n 'grape',\n 'kale',\n ]\n });\n\n hamster.get('wants'); // ['banana']\n ```\n\n @method computed.setDiff\n @for Ember\n @param {String} setAProperty\n @param {String} setBProperty\n @return {Ember.ComputedProperty} computes a new array with all the\n items from the first dependent array that are not in the second\n dependent array\n */\n function setDiff(setAProperty, setBProperty) {\n if (arguments.length !== 2) {\n throw new EmberError(\"setDiff requires exactly two dependent arrays.\");\n }\n return arrayComputed(setAProperty, setBProperty, {\n addedItem: function (array, item, changeMeta, instanceMeta) {\n var setA = get(this, setAProperty),\n setB = get(this, setBProperty);\n\n if (changeMeta.arrayChanged === setA) {\n if (!setB.contains(item)) {\n array.addObject(item);\n }\n } else {\n array.removeObject(item);\n }\n return array;\n },\n\n removedItem: function (array, item, changeMeta, instanceMeta) {\n var setA = get(this, setAProperty),\n setB = get(this, setBProperty);\n\n if (changeMeta.arrayChanged === setB) {\n if (setA.contains(item)) {\n array.addObject(item);\n }\n } else {\n array.removeObject(item);\n }\n return array;\n }\n });\n };\n\n function binarySearch(array, item, low, high) {\n var mid, midItem, res, guidMid, guidItem;\n\n if (arguments.length < 4) { high = get(array, 'length'); }\n if (arguments.length < 3) { low = 0; }\n\n if (low === high) {\n return low;\n }\n\n mid = low + Math.floor((high - low) / 2);\n midItem = array.objectAt(mid);\n\n guidMid = _guidFor(midItem);\n guidItem = _guidFor(item);\n\n if (guidMid === guidItem) {\n return mid;\n }\n\n res = this.order(midItem, item);\n if (res === 0) {\n res = guidMid < guidItem ? -1 : 1;\n }\n\n\n if (res < 0) {\n return this.binarySearch(array, item, mid+1, high);\n } else if (res > 0) {\n return this.binarySearch(array, item, low, mid);\n }\n\n return mid;\n\n function _guidFor(item) {\n if (SearchProxy.detectInstance(item)) {\n return guidFor(get(item, 'content'));\n }\n return guidFor(item);\n }\n }\n\n\n var SearchProxy = ObjectProxy.extend();\n\n /**\n A computed property which returns a new array with all the\n properties from the first dependent array sorted based on a property\n or sort function.\n\n The callback method you provide should have the following signature:\n\n ```javascript\n function(itemA, itemB);\n ```\n\n - `itemA` the first item to compare.\n - `itemB` the second item to compare.\n\n This function should return negative number (e.g. `-1`) when `itemA` should come before\n `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after\n `itemB`. If the `itemA` and `itemB` are equal this function should return `0`.\n\n Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or\n `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`.\n\n Example\n\n ```javascript\n var ToDoList = Ember.Object.extend({\n // using standard ascending sort\n todosSorting: ['name'],\n sortedTodos: Ember.computed.sort('todos', 'todosSorting'),\n\n // using descending sort\n todosSortingDesc: ['name:desc'],\n sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'),\n\n // using a custom sort function\n priorityTodos: Ember.computed.sort('todos', function(a, b){\n if (a.priority > b.priority) {\n return 1;\n } else if (a.priority < b.priority) {\n return -1;\n }\n\n return 0;\n }),\n });\n\n var todoList = ToDoList.create({todos: [\n { name: 'Unit Test', priority: 2 },\n { name: 'Documentation', priority: 3 },\n { name: 'Release', priority: 1 }\n ]});\n\n todoList.get('sortedTodos'); // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\n todoList.get('sortedTodosDesc'); // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]\n todoList.get('priorityTodos'); // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n ```\n\n @method computed.sort\n @for Ember\n @param {String} dependentKey\n @param {String or Function} sortDefinition a dependent key to an\n array of sort properties (add `:desc` to the arrays sort properties to sort descending) or a function to use when sorting\n @return {Ember.ComputedProperty} computes a new sorted array based\n on the sort property array or callback function\n */\n function sort(itemsKey, sortDefinition) {\n Ember.assert(\"Ember.computed.sort requires two arguments: an array key to sort and either a sort properties key or sort function\", arguments.length === 2);\n\n var initFn, sortPropertiesKey;\n\n if (typeof sortDefinition === 'function') {\n initFn = function (array, changeMeta, instanceMeta) {\n instanceMeta.order = sortDefinition;\n instanceMeta.binarySearch = binarySearch;\n };\n } else {\n sortPropertiesKey = sortDefinition;\n initFn = function (array, changeMeta, instanceMeta) {\n function setupSortProperties() {\n var sortPropertyDefinitions = get(this, sortPropertiesKey),\n sortProperty,\n sortProperties = instanceMeta.sortProperties = [],\n sortPropertyAscending = instanceMeta.sortPropertyAscending = {},\n idx,\n asc;\n\n Ember.assert(\"Cannot sort: '\" + sortPropertiesKey + \"' is not an array.\", isArray(sortPropertyDefinitions));\n\n changeMeta.property.clearItemPropertyKeys(itemsKey);\n\n forEach(sortPropertyDefinitions, function (sortPropertyDefinition) {\n if ((idx = sortPropertyDefinition.indexOf(':')) !== -1) {\n sortProperty = sortPropertyDefinition.substring(0, idx);\n asc = sortPropertyDefinition.substring(idx+1).toLowerCase() !== 'desc';\n } else {\n sortProperty = sortPropertyDefinition;\n asc = true;\n }\n\n sortProperties.push(sortProperty);\n sortPropertyAscending[sortProperty] = asc;\n changeMeta.property.itemPropertyKey(itemsKey, sortProperty);\n });\n\n sortPropertyDefinitions.addObserver('@each', this, updateSortPropertiesOnce);\n }\n\n function updateSortPropertiesOnce() {\n run.once(this, updateSortProperties, changeMeta.propertyName);\n }\n\n function updateSortProperties(propertyName) {\n setupSortProperties.call(this);\n changeMeta.property.recomputeOnce.call(this, propertyName);\n }\n\n addObserver(this, sortPropertiesKey, updateSortPropertiesOnce);\n\n setupSortProperties.call(this);\n\n\n instanceMeta.order = function (itemA, itemB) {\n var isProxy = itemB instanceof SearchProxy,\n sortProperty, result, asc;\n\n for (var i = 0; i < this.sortProperties.length; ++i) {\n sortProperty = this.sortProperties[i];\n result = compare(get(itemA, sortProperty), isProxy ? itemB[sortProperty] : get(itemB, sortProperty));\n\n if (result !== 0) {\n asc = this.sortPropertyAscending[sortProperty];\n return asc ? result : (-1 * result);\n }\n }\n\n return 0;\n };\n\n instanceMeta.binarySearch = binarySearch;\n };\n }\n\n return arrayComputed(itemsKey, {\n initialize: initFn,\n\n addedItem: function (array, item, changeMeta, instanceMeta) {\n var index = instanceMeta.binarySearch(array, item);\n array.insertAt(index, item);\n return array;\n },\n\n removedItem: function (array, item, changeMeta, instanceMeta) {\n var proxyProperties, index, searchItem;\n\n if (changeMeta.previousValues) {\n proxyProperties = merge({ content: item }, changeMeta.previousValues);\n\n searchItem = SearchProxy.create(proxyProperties);\n } else {\n searchItem = item;\n }\n\n index = instanceMeta.binarySearch(array, searchItem);\n array.removeAt(index);\n return array;\n }\n });\n };\n\n\n __exports__.sum = sum;\n __exports__.min = min;\n __exports__.max = max;\n __exports__.map = map;\n __exports__.sort = sort;\n __exports__.setDiff = setDiff;\n __exports__.mapBy = mapBy;\n __exports__.mapProperty = mapProperty;\n __exports__.filter = filter;\n __exports__.filterBy = filterBy;\n __exports__.filterProperty = filterProperty;\n __exports__.uniq = uniq;\n __exports__.union = union;\n __exports__.intersect = intersect;\n });\ndefine(\"ember-runtime/controllers/array_controller\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/enumerable_utils\",\"ember-runtime/system/array_proxy\",\"ember-runtime/mixins/sortable\",\"ember-runtime/controllers/controller\",\"ember-metal/computed\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EnumerableUtils = __dependency4__[\"default\"];\n var ArrayProxy = __dependency5__[\"default\"];\n var SortableMixin = __dependency6__[\"default\"];\n var ControllerMixin = __dependency7__.ControllerMixin;\n var computed = __dependency8__.computed;\n var EmberError = __dependency9__[\"default\"];\n\n var forEach = EnumerableUtils.forEach,\n replace = EnumerableUtils.replace;\n\n /**\n `Ember.ArrayController` provides a way for you to publish a collection of\n objects so that you can easily bind to the collection from a Handlebars\n `#each` helper, an `Ember.CollectionView`, or other controllers.\n\n The advantage of using an `ArrayController` is that you only have to set up\n your view bindings once; to change what's displayed, simply swap out the\n `content` property on the controller.\n\n For example, imagine you wanted to display a list of items fetched via an XHR\n request. Create an `Ember.ArrayController` and set its `content` property:\n\n ```javascript\n MyApp.listController = Ember.ArrayController.create();\n\n $.get('people.json', function(data) {\n MyApp.listController.set('content', data);\n });\n ```\n\n Then, create a view that binds to your new controller:\n\n ```handlebars\n {{#each MyApp.listController}}\n {{firstName}} {{lastName}}\n {{/each}}\n ```\n\n Although you are binding to the controller, the behavior of this controller\n is to pass through any methods or properties to the underlying array. This\n capability comes from `Ember.ArrayProxy`, which this class inherits from.\n\n Sometimes you want to display computed properties within the body of an\n `#each` helper that depend on the underlying items in `content`, but are not\n present on those items. To do this, set `itemController` to the name of a\n controller (probably an `ObjectController`) that will wrap each individual item.\n\n For example:\n\n ```handlebars\n {{#each post in controller}}\n <li>{{post.title}} ({{post.titleLength}} characters)</li>\n {{/each}}\n ```\n\n ```javascript\n App.PostsController = Ember.ArrayController.extend({\n itemController: 'post'\n });\n\n App.PostController = Ember.ObjectController.extend({\n // the `title` property will be proxied to the underlying post.\n\n titleLength: function() {\n return this.get('title').length;\n }.property('title')\n });\n ```\n\n In some cases it is helpful to return a different `itemController` depending\n on the particular item. Subclasses can do this by overriding\n `lookupItemController`.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n The itemController instances will have a `parentController` property set to\n the `ArrayController` instance.\n\n @class ArrayController\n @namespace Ember\n @extends Ember.ArrayProxy\n @uses Ember.SortableMixin\n @uses Ember.ControllerMixin\n */\n\n var ArrayController = ArrayProxy.extend(ControllerMixin, SortableMixin, {\n\n /**\n The controller used to wrap items, if any.\n\n @property itemController\n @type String\n @default null\n */\n itemController: null,\n\n /**\n Return the name of the controller to wrap items, or `null` if items should\n be returned directly. The default implementation simply returns the\n `itemController` property, but subclasses can override this method to return\n different controllers for different objects.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @method lookupItemController\n @param {Object} object\n @return {String}\n */\n lookupItemController: function(object) {\n return get(this, 'itemController');\n },\n\n objectAtContent: function(idx) {\n var length = get(this, 'length'),\n arrangedContent = get(this,'arrangedContent'),\n object = arrangedContent && arrangedContent.objectAt(idx);\n\n if (idx >= 0 && idx < length) {\n var controllerClass = this.lookupItemController(object);\n if (controllerClass) {\n return this.controllerAt(idx, object, controllerClass);\n }\n }\n\n // When `controllerClass` is falsy, we have not opted in to using item\n // controllers, so return the object directly.\n\n // When the index is out of range, we want to return the \"out of range\"\n // value, whatever that might be. Rather than make assumptions\n // (e.g. guessing `null` or `undefined`) we defer this to `arrangedContent`.\n return object;\n },\n\n arrangedContentDidChange: function() {\n this._super();\n this._resetSubControllers();\n },\n\n arrayContentDidChange: function(idx, removedCnt, addedCnt) {\n var subControllers = get(this, '_subControllers'),\n subControllersToRemove = subControllers.slice(idx, idx+removedCnt);\n\n forEach(subControllersToRemove, function(subController) {\n if (subController) { subController.destroy(); }\n });\n\n replace(subControllers, idx, removedCnt, new Array(addedCnt));\n\n // The shadow array of subcontrollers must be updated before we trigger\n // observers, otherwise observers will get the wrong subcontainer when\n // calling `objectAt`\n this._super(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n\n this.set('_subControllers', [ ]);\n },\n\n content: computed(function () {\n return Ember.A();\n }),\n\n /**\n * Flag to mark as being \"virtual\". Used to keep this instance\n * from participating in the parentController hierarchy.\n *\n * @private\n * @property _isVirtual\n * @type Boolean\n */\n _isVirtual: false,\n\n controllerAt: function(idx, object, controllerClass) {\n var container = get(this, 'container'),\n subControllers = get(this, '_subControllers'),\n subController = subControllers[idx],\n fullName;\n\n if (subController) { return subController; }\n\n fullName = \"controller:\" + controllerClass;\n\n if (!container.has(fullName)) {\n throw new EmberError('Could not resolve itemController: \"' + controllerClass + '\"');\n }\n var parentController;\n if (this._isVirtual) {\n parentController = get(this, 'parentController');\n }\n parentController = parentController || this;\n subController = container.lookupFactory(fullName).create({\n target: this,\n parentController: parentController,\n content: object\n });\n\n subControllers[idx] = subController;\n\n return subController;\n },\n\n _subControllers: null,\n\n _resetSubControllers: function() {\n var subControllers = get(this, '_subControllers');\n var controller;\n\n if (subControllers.length) {\n for (var i = 0, length = subControllers.length; length > i; i++) {\n controller = subControllers[i];\n if (controller) {\n controller.destroy();\n }\n }\n\n subControllers.length = 0;\n }\n },\n\n willDestroy: function() {\n this._resetSubControllers();\n this._super();\n }\n });\n\n __exports__[\"default\"] = ArrayController;\n });\ndefine(\"ember-runtime/controllers/controller\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-runtime/system/object\",\"ember-metal/mixin\",\"ember-metal/computed\",\"ember-runtime/mixins/action_handler\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.deprecate\n var get = __dependency2__.get;\n var EmberObject = __dependency3__[\"default\"];\n var Mixin = __dependency4__.Mixin;\n var computed = __dependency5__.computed;\n var ActionHandler = __dependency6__[\"default\"];\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n /**\n `Ember.ControllerMixin` provides a standard interface for all classes that\n compose Ember's controller layer: `Ember.Controller`,\n `Ember.ArrayController`, and `Ember.ObjectController`.\n\n @class ControllerMixin\n @namespace Ember\n @uses Ember.ActionHandler\n */\n var ControllerMixin = Mixin.create(ActionHandler, {\n /* ducktype as a controller */\n isController: true,\n\n /**\n The object to which actions from the view should be sent.\n\n For example, when a Handlebars template uses the `{{action}}` helper,\n it will attempt to send the action to the view's controller's `target`.\n\n By default, the value of the target property is set to the router, and\n is injected when a controller is instantiated. This injection is defined\n in Ember.Application#buildContainer, and is applied as part of the\n applications initialization process. It can also be set after a controller\n has been instantiated, for instance when using the render helper in a\n template, or when a controller is used as an `itemController`. In most\n cases the `target` property will automatically be set to the logical\n consumer of actions for the controller.\n\n @property target\n @default null\n */\n target: null,\n\n container: null,\n\n parentController: null,\n\n store: null,\n\n model: computed.alias('content'),\n\n deprecatedSendHandles: function(actionName) {\n return !!this[actionName];\n },\n\n deprecatedSend: function(actionName) {\n var args = [].slice.call(arguments, 1);\n Ember.assert('' + this + \" has the action \" + actionName + \" but it is not a function\", typeof this[actionName] === 'function');\n Ember.deprecate('Action handlers implemented directly on controllers are deprecated in favor of action handlers on an `actions` object ( action: `' + actionName + '` on ' + this + ')', false);\n this[actionName].apply(this, args);\n return;\n }\n });\n\n /**\n @class Controller\n @namespace Ember\n @extends Ember.Object\n @uses Ember.ControllerMixin\n */\n var Controller = EmberObject.extend(ControllerMixin);\n\n __exports__.Controller = Controller;\n __exports__.ControllerMixin = ControllerMixin;\n });\ndefine(\"ember-runtime/controllers/object_controller\",\n [\"ember-runtime/controllers/controller\",\"ember-runtime/system/object_proxy\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var ControllerMixin = __dependency1__.ControllerMixin;\n var ObjectProxy = __dependency2__[\"default\"];\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n /**\n `Ember.ObjectController` is part of Ember's Controller layer. It is intended\n to wrap a single object, proxying unhandled attempts to `get` and `set` to the underlying\n content object, and to forward unhandled action attempts to its `target`.\n\n `Ember.ObjectController` derives this functionality from its superclass\n `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin.\n\n @class ObjectController\n @namespace Ember\n @extends Ember.ObjectProxy\n @uses Ember.ControllerMixin\n **/\n var ObjectController = ObjectProxy.extend(ControllerMixin);\n __exports__[\"default\"] = ObjectController;\n });\ndefine(\"ember-runtime/copy\",\n [\"ember-metal/enumerable_utils\",\"ember-metal/utils\",\"ember-runtime/system/object\",\"ember-runtime/mixins/copyable\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var EnumerableUtils = __dependency1__[\"default\"];\n var typeOf = __dependency2__.typeOf;\n var EmberObject = __dependency3__[\"default\"];\n var Copyable = __dependency4__[\"default\"];\n var create = __dependency5__.create;\n\n var indexOf = EnumerableUtils.indexOf;\n\n function _copy(obj, deep, seen, copies) {\n var ret, loc, key;\n\n // primitive data types are immutable, just return them.\n if ('object' !== typeof obj || obj===null) return obj;\n\n // avoid cyclical loops\n if (deep && (loc=indexOf(seen, obj))>=0) return copies[loc];\n\n Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof EmberObject) || (Copyable && Copyable.detect(obj)));\n\n // IMPORTANT: this specific test will detect a native array only. Any other\n // object will need to implement Copyable.\n if (typeOf(obj) === 'array') {\n ret = obj.slice();\n if (deep) {\n loc = ret.length;\n while(--loc>=0) ret[loc] = _copy(ret[loc], deep, seen, copies);\n }\n } else if (Copyable && Copyable.detect(obj)) {\n ret = obj.copy(deep, seen, copies);\n } else if (obj instanceof Date) {\n ret = new Date(obj.getTime());\n } else {\n ret = {};\n for(key in obj) {\n if (!obj.hasOwnProperty(key)) continue;\n\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') continue;\n\n ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];\n }\n }\n\n if (deep) {\n seen.push(obj);\n copies.push(ret);\n }\n\n return ret;\n }\n\n /**\n Creates a clone of the passed object. This function can take just about\n any type of object and create a clone of it, including primitive values\n (which are not actually cloned because they are immutable).\n\n If the passed object implements the `clone()` method, then this function\n will simply call that method and return the result.\n\n @method copy\n @for Ember\n @param {Object} obj The object to clone\n @param {Boolean} deep If true, a deep copy of the object is made\n @return {Object} The cloned object\n */\n function copy(obj, deep) {\n // fast paths\n if ('object' !== typeof obj || obj===null) return obj; // can't copy primitives\n if (Copyable && Copyable.detect(obj)) return obj.copy(deep);\n return _copy(obj, deep, deep ? [] : null, deep ? [] : null);\n };\n\n __exports__[\"default\"] = copy;\n });\ndefine(\"ember-runtime/core\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n /**\n Compares two objects, returning true if they are logically equal. This is\n a deeper comparison than a simple triple equal. For sets it will compare the\n internal objects. For any other object that implements `isEqual()` it will\n respect that method.\n\n ```javascript\n Ember.isEqual('hello', 'hello'); // true\n Ember.isEqual(1, 2); // false\n Ember.isEqual([4, 2], [4, 2]); // false\n ```\n\n @method isEqual\n @for Ember\n @param {Object} a first object to compare\n @param {Object} b second object to compare\n @return {Boolean}\n */\n function isEqual(a, b) {\n if (a && 'function'===typeof a.isEqual) return a.isEqual(b);\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n } \n return a === b;\n };\n\n __exports__.isEqual = isEqual;\n });\ndefine(\"ember-runtime/ext/function\",\n [\"ember-metal/core\",\"ember-metal/expand_properties\",\"ember-metal/computed\"],\n function(__dependency1__, __dependency2__, __dependency3__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.EXTEND_PROTOTYPES, Ember.assert\n var expandProperties = __dependency2__[\"default\"];\n var computed = __dependency3__.computed;\n\n var a_slice = Array.prototype.slice;\n var FunctionPrototype = Function.prototype;\n\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {\n\n /**\n The `property` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n `true`, which is the default.\n\n Computed properties allow you to treat a function like a property:\n\n ```javascript\n MyApp.President = Ember.Object.extend({\n firstName: '',\n lastName: '',\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Call this flag to mark the function as a property\n }.property()\n });\n\n var president = MyApp.President.create({\n firstName: \"Barack\",\n lastName: \"Obama\"\n });\n\n president.get('fullName'); // \"Barack Obama\"\n ```\n\n Treating a function like a property is useful because they can work with\n bindings, just like any other property.\n\n Many computed properties have dependencies on other properties. For\n example, in the above example, the `fullName` property depends on\n `firstName` and `lastName` to determine its value. You can tell Ember\n about these dependencies like this:\n\n ```javascript\n MyApp.President = Ember.Object.extend({\n firstName: '',\n lastName: '',\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember.js that this computed property depends on firstName\n // and lastName\n }.property('firstName', 'lastName')\n });\n ```\n\n Make sure you list these dependencies so Ember knows when to update\n bindings that connect to a computed property. Changing a dependency\n will not immediately trigger an update of the computed property, but\n will instead clear the cache so that it is updated when the next `get`\n is called on the property.\n\n See [Ember.ComputedProperty](/api/classes/Ember.ComputedProperty.html), [Ember.computed](/api/#method_computed).\n\n @method property\n @for Function\n */\n FunctionPrototype.property = function() {\n var ret = computed(this);\n // ComputedProperty.prototype.property expands properties; no need for us to\n // do so here.\n return ret.property.apply(ret, arguments);\n };\n\n /**\n The `observes` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n In the future this method may become asynchronous. If you want to ensure\n synchronous behavior, use `observesImmediately`.\n\n See `Ember.observer`.\n\n @method observes\n @for Function\n */\n FunctionPrototype.observes = function() {\n var addWatchedProperty = function (obs) { watched.push(obs); };\n var watched = [];\n\n for (var i=0; i<arguments.length; ++i) {\n expandProperties(arguments[i], addWatchedProperty);\n }\n\n this.__ember_observes__ = watched;\n\n return this;\n };\n\n /**\n The `observesImmediately` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can observe property changes simply by adding the `observesImmediately`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes immediately after the \"value\" property changes\n }.observesImmediately('value')\n });\n ```\n\n In the future, `observes` may become asynchronous. In this event,\n `observesImmediately` will maintain the synchronous behavior.\n\n See `Ember.immediateObserver`.\n\n @method observesImmediately\n @for Function\n */\n FunctionPrototype.observesImmediately = function() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", arg.indexOf('.') === -1);\n }\n\n // observes handles property expansion\n return this.observes.apply(this, arguments);\n };\n\n /**\n The `observesBefore` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can get notified when a property change is about to happen by\n by adding the `observesBefore` call to the end of your method\n declarations in classes that you write. For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property is about to change\n }.observesBefore('value')\n });\n ```\n\n See `Ember.beforeObserver`.\n\n @method observesBefore\n @for Function\n */\n FunctionPrototype.observesBefore = function() {\n var addWatchedProperty = function (obs) { watched.push(obs); };\n var watched = [];\n\n for (var i=0; i<arguments.length; ++i) {\n expandProperties(arguments[i], addWatchedProperty);\n }\n\n this.__ember_observesBefore__ = watched;\n\n return this;\n };\n\n /**\n The `on` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can listen for events simply by adding the `on` call to the end of\n your method declarations in classes or mixins that you write. For example:\n\n ```javascript\n Ember.Mixin.create({\n doSomethingWithElement: function() {\n // Executes whenever the \"didInsertElement\" event fires\n }.on('didInsertElement')\n });\n ```\n\n See `Ember.on`.\n\n @method on\n @for Function\n */\n FunctionPrototype.on = function() {\n var events = a_slice.call(arguments);\n this.__ember_listens__ = events;\n return this;\n };\n }\n });\ndefine(\"ember-runtime/ext/rsvp\",\n [\"ember-metal/core\",\"ember-metal/logger\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var Logger = __dependency2__[\"default\"];\n\n var RSVP = requireModule(\"rsvp\");\n var Test, testModuleName = 'ember-testing/test';\n\n RSVP.onerrorDefault = function(error) {\n if (error instanceof Error) {\n if (Ember.testing) {\n // ES6TODO: remove when possible\n if (!Test && Ember.__loader.registry[testModuleName]) {\n Test = requireModule(testModuleName)['default'];\n }\n\n if (Test && Test.adapter) {\n Test.adapter.exception(error);\n } else {\n throw error;\n }\n } else if (Ember.onerror) {\n Ember.onerror(error);\n } else {\n Logger.error(error.stack);\n Ember.assert(error, false);\n }\n }\n };\n\n RSVP.on('error', RSVP.onerrorDefault);\n\n __exports__[\"default\"] = RSVP;\n });\ndefine(\"ember-runtime/ext/string\",\n [\"ember-metal/core\",\"ember-runtime/system/string\"],\n function(__dependency1__, __dependency2__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.EXTEND_PROTOTYPES, Ember.assert, Ember.FEATURES\n var fmt = __dependency2__.fmt;\n var w = __dependency2__.w;\n var loc = __dependency2__.loc;\n var camelize = __dependency2__.camelize;\n var decamelize = __dependency2__.decamelize;\n var dasherize = __dependency2__.dasherize;\n var underscore = __dependency2__.underscore;\n var capitalize = __dependency2__.capitalize;\n var classify = __dependency2__.classify;\n var StringPrototype = String.prototype;\n\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n See [Ember.String.fmt](/api/classes/Ember.String.html#method_fmt).\n\n @method fmt\n @for String\n */\n StringPrototype.fmt = function() {\n return fmt(this, arguments);\n };\n\n /**\n See [Ember.String.w](/api/classes/Ember.String.html#method_w).\n\n @method w\n @for String\n */\n StringPrototype.w = function() {\n return w(this);\n };\n\n /**\n See [Ember.String.loc](/api/classes/Ember.String.html#method_loc).\n\n @method loc\n @for String\n */\n StringPrototype.loc = function() {\n return loc(this, arguments);\n };\n\n /**\n See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize).\n\n @method camelize\n @for String\n */\n StringPrototype.camelize = function() {\n return camelize(this);\n };\n\n /**\n See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize).\n\n @method decamelize\n @for String\n */\n StringPrototype.decamelize = function() {\n return decamelize(this);\n };\n\n /**\n See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize).\n\n @method dasherize\n @for String\n */\n StringPrototype.dasherize = function() {\n return dasherize(this);\n };\n\n /**\n See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore).\n\n @method underscore\n @for String\n */\n StringPrototype.underscore = function() {\n return underscore(this);\n };\n\n /**\n See [Ember.String.classify](/api/classes/Ember.String.html#method_classify).\n\n @method classify\n @for String\n */\n StringPrototype.classify = function() {\n return classify(this);\n };\n\n /**\n See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize).\n\n @method capitalize\n @for String\n */\n StringPrototype.capitalize = function() {\n return capitalize(this);\n };\n }\n });\ndefine(\"ember-runtime/keys\",\n [\"ember-metal/enumerable_utils\",\"ember-metal/platform\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var EnumerableUtils = __dependency1__[\"default\"];\n var create = __dependency2__.create;\n\n /**\n Returns all of the keys defined on an object or hash. This is useful\n when inspecting objects for debugging. On browsers that support it, this\n uses the native `Object.keys` implementation.\n\n @method keys\n @for Ember\n @param {Object} obj\n @return {Array} Array containing keys of obj\n */\n var keys = Object.keys;\n if (!keys || create.isSimulated) {\n var prototypeProperties = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n 'toLocaleString',\n 'toString'\n ],\n pushPropertyName = function(obj, array, key) {\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') return;\n if (key === '_super') return;\n if (EnumerableUtils.indexOf(array, key) >= 0) return;\n if (typeof obj.hasOwnProperty === 'function' && !obj.hasOwnProperty(key)) return;\n\n array.push(key);\n };\n\n keys = function keys(obj) {\n var ret = [], key;\n for (key in obj) {\n pushPropertyName(obj, ret, key);\n }\n\n // IE8 doesn't enumerate property that named the same as prototype properties.\n for (var i = 0, l = prototypeProperties.length; i < l; i++) {\n key = prototypeProperties[i];\n\n pushPropertyName(obj, ret, key);\n }\n\n return ret;\n };\n }\n\n __exports__[\"default\"] = keys;\n });\ndefine(\"ember-runtime\",\n [\"ember-metal\",\"ember-runtime/core\",\"ember-runtime/keys\",\"ember-runtime/compare\",\"ember-runtime/copy\",\"ember-runtime/system/namespace\",\"ember-runtime/system/object\",\"ember-runtime/system/tracked_array\",\"ember-runtime/system/subarray\",\"ember-runtime/system/container\",\"ember-runtime/system/application\",\"ember-runtime/system/array_proxy\",\"ember-runtime/system/object_proxy\",\"ember-runtime/system/core_object\",\"ember-runtime/system/each_proxy\",\"ember-runtime/system/native_array\",\"ember-runtime/system/set\",\"ember-runtime/system/string\",\"ember-runtime/system/deferred\",\"ember-runtime/system/lazy_load\",\"ember-runtime/mixins/array\",\"ember-runtime/mixins/comparable\",\"ember-runtime/mixins/copyable\",\"ember-runtime/mixins/enumerable\",\"ember-runtime/mixins/freezable\",\"ember-runtime/mixins/observable\",\"ember-runtime/mixins/action_handler\",\"ember-runtime/mixins/deferred\",\"ember-runtime/mixins/mutable_enumerable\",\"ember-runtime/mixins/mutable_array\",\"ember-runtime/mixins/target_action_support\",\"ember-runtime/mixins/evented\",\"ember-runtime/mixins/promise_proxy\",\"ember-runtime/mixins/sortable\",\"ember-runtime/computed/array_computed\",\"ember-runtime/computed/reduce_computed\",\"ember-runtime/computed/reduce_computed_macros\",\"ember-runtime/controllers/array_controller\",\"ember-runtime/controllers/object_controller\",\"ember-runtime/controllers/controller\",\"ember-runtime/ext/rsvp\",\"ember-runtime/ext/string\",\"ember-runtime/ext/function\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __dependency27__, __dependency28__, __dependency29__, __dependency30__, __dependency31__, __dependency32__, __dependency33__, __dependency34__, __dependency35__, __dependency36__, __dependency37__, __dependency38__, __dependency39__, __dependency40__, __dependency41__, __dependency42__, __dependency43__, __exports__) {\n \"use strict\";\n /**\n Ember Runtime\n\n @module ember\n @submodule ember-runtime\n @requires ember-metal\n */\n\n // BEGIN IMPORTS\n var Ember = __dependency1__[\"default\"];\n var isEqual = __dependency2__.isEqual;\n var keys = __dependency3__[\"default\"];\n var compare = __dependency4__[\"default\"];\n var copy = __dependency5__[\"default\"];\n\n var Namespace = __dependency6__[\"default\"];\n var EmberObject = __dependency7__[\"default\"];\n var TrackedArray = __dependency8__[\"default\"];\n var SubArray = __dependency9__[\"default\"];\n var Container = __dependency10__[\"default\"];\n var Application = __dependency11__[\"default\"];\n var ArrayProxy = __dependency12__[\"default\"];\n var ObjectProxy = __dependency13__[\"default\"];\n var CoreObject = __dependency14__[\"default\"];\n var EachArray = __dependency15__.EachArray;\n var EachProxy = __dependency15__.EachProxy;\n var NativeArray = __dependency16__[\"default\"];\n var Set = __dependency17__[\"default\"];\n var EmberStringUtils = __dependency18__[\"default\"];\n var Deferred = __dependency19__[\"default\"];\n var onLoad = __dependency20__.onLoad;\n var runLoadHooks = __dependency20__.runLoadHooks;\n\n var EmberArray = __dependency21__[\"default\"];\n var Comparable = __dependency22__[\"default\"];\n var Copyable = __dependency23__[\"default\"];\n var Enumerable = __dependency24__[\"default\"];\n var Freezable = __dependency25__.Freezable;\n var FROZEN_ERROR = __dependency25__.FROZEN_ERROR;\n var Observable = __dependency26__[\"default\"];\n var ActionHandler = __dependency27__[\"default\"];\n var DeferredMixin = __dependency28__[\"default\"];\n var MutableEnumerable = __dependency29__[\"default\"];\n var MutableArray = __dependency30__[\"default\"];\n var TargetActionSupport = __dependency31__[\"default\"];\n var Evented = __dependency32__[\"default\"];\n var PromiseProxyMixin = __dependency33__[\"default\"];\n var SortableMixin = __dependency34__[\"default\"];\n\n var arrayComputed = __dependency35__.arrayComputed;\n var ArrayComputedProperty = __dependency35__.ArrayComputedProperty;\n var reduceComputed = __dependency36__.reduceComputed;\n var ReduceComputedProperty = __dependency36__.ReduceComputedProperty;\n var sum = __dependency37__.sum;\n var min = __dependency37__.min;\n var max = __dependency37__.max;\n var map = __dependency37__.map;\n var sort = __dependency37__.sort;\n var setDiff = __dependency37__.setDiff;\n var mapBy = __dependency37__.mapBy;\n var mapProperty = __dependency37__.mapProperty;\n var filter = __dependency37__.filter;\n var filterBy = __dependency37__.filterBy;\n var filterProperty = __dependency37__.filterProperty;\n var uniq = __dependency37__.uniq;\n var union = __dependency37__.union;\n var intersect = __dependency37__.intersect;\n\n var ArrayController = __dependency38__[\"default\"];\n var ObjectController = __dependency39__[\"default\"];\n var Controller = __dependency40__.Controller;\n var ControllerMixin = __dependency40__.ControllerMixin;\n\n var RSVP = __dependency41__[\"default\"];\n // just for side effect of extending Ember.RSVP\n // just for side effect of extending String.prototype\n // just for side effect of extending Function.prototype\n // END IMPORTS\n\n\n // BEGIN EXPORTS\n Ember.compare = compare;\n Ember.copy = copy;\n Ember.isEqual = isEqual;\n Ember.keys = keys;\n\n Ember.Array = EmberArray;\n\n Ember.Comparable = Comparable;\n Ember.Copyable = Copyable;\n\n Ember.SortableMixin = SortableMixin;\n\n Ember.Freezable = Freezable;\n Ember.FROZEN_ERROR = FROZEN_ERROR;\n\n Ember.DeferredMixin = DeferredMixin;\n\n Ember.MutableEnumerable = MutableEnumerable;\n Ember.MutableArray = MutableArray;\n\n Ember.TargetActionSupport = TargetActionSupport;\n Ember.Evented = Evented;\n\n Ember.PromiseProxyMixin = PromiseProxyMixin;\n\n Ember.Observable = Observable;\n\n Ember.arrayComputed = arrayComputed;\n Ember.ArrayComputedProperty = ArrayComputedProperty;\n Ember.reduceComputed = reduceComputed;\n Ember.ReduceComputedProperty = ReduceComputedProperty;\n\n // ES6TODO: this seems a less than ideal way/place to add properties to Ember.computed\n var EmComputed = Ember.computed;\n\n EmComputed.sum = sum;\n EmComputed.min = min;\n EmComputed.max = max;\n EmComputed.map = map;\n EmComputed.sort = sort;\n EmComputed.setDiff = setDiff;\n EmComputed.mapBy = mapBy;\n EmComputed.mapProperty = mapProperty;\n EmComputed.filter = filter;\n EmComputed.filterBy = filterBy;\n EmComputed.filterProperty = filterProperty;\n EmComputed.uniq = uniq;\n EmComputed.union = union;\n EmComputed.intersect = intersect;\n\n Ember.String = EmberStringUtils;\n Ember.Object = EmberObject;\n Ember.TrackedArray = TrackedArray;\n Ember.SubArray = SubArray;\n Ember.Container = Container;\n Ember.Namespace = Namespace;\n Ember.Application = Application;\n Ember.Enumerable = Enumerable;\n Ember.ArrayProxy = ArrayProxy;\n Ember.ObjectProxy = ObjectProxy;\n Ember.ActionHandler = ActionHandler;\n Ember.CoreObject = CoreObject;\n Ember.EachArray = EachArray;\n Ember.EachProxy = EachProxy;\n Ember.NativeArray = NativeArray;\n // ES6TODO: Currently we must rely on the global from ember-metal/core to avoid circular deps\n // Ember.A = A;\n Ember.Set = Set;\n Ember.Deferred = Deferred;\n Ember.onLoad = onLoad;\n Ember.runLoadHooks = runLoadHooks;\n\n Ember.ArrayController = ArrayController;\n Ember.ObjectController = ObjectController;\n Ember.Controller = Controller;\n Ember.ControllerMixin = ControllerMixin;\n\n Ember.RSVP = RSVP;\n // END EXPORTS\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-runtime/mixins/action_handler\",\n [\"ember-metal/merge\",\"ember-metal/mixin\",\"ember-metal/property_get\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var merge = __dependency1__[\"default\"];\n var Mixin = __dependency2__.Mixin;\n var get = __dependency3__.get;\n var typeOf = __dependency4__.typeOf;\n\n /**\n The `Ember.ActionHandler` mixin implements support for moving an `actions`\n property to an `_actions` property at extend time, and adding `_actions`\n to the object's mergedProperties list.\n\n `Ember.ActionHandler` is available on some familiar classes including\n `Ember.Route`, `Ember.View`, `Ember.Component`, and controllers such as\n `Ember.Controller` and `Ember.ObjectController`.\n (Internally the mixin is used by `Ember.CoreView`, `Ember.ControllerMixin`,\n and `Ember.Route` and available to the above classes through\n inheritance.)\n\n @class ActionHandler\n @namespace Ember\n */\n var ActionHandler = Mixin.create({\n mergedProperties: ['_actions'],\n\n /**\n The collection of functions, keyed by name, available on this\n `ActionHandler` as action targets.\n\n These functions will be invoked when a matching `{{action}}` is triggered\n from within a template and the application's current route is this route.\n\n Actions can also be invoked from other parts of your application\n via `ActionHandler#send`.\n\n The `actions` hash will inherit action handlers from\n the `actions` hash defined on extended parent classes\n or mixins rather than just replace the entire hash, e.g.:\n\n ```js\n App.CanDisplayBanner = Ember.Mixin.create({\n actions: {\n displayBanner: function(msg) {\n // ...\n }\n }\n });\n\n App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, {\n actions: {\n playMusic: function() {\n // ...\n }\n }\n });\n\n // `WelcomeRoute`, when active, will be able to respond\n // to both actions, since the actions hash is merged rather\n // then replaced when extending mixins / parent classes.\n this.send('displayBanner');\n this.send('playMusic');\n ```\n\n Within a Controller, Route, View or Component's action handler,\n the value of the `this` context is the Controller, Route, View or\n Component object:\n\n ```js\n App.SongRoute = Ember.Route.extend({\n actions: {\n myAction: function() {\n this.controllerFor(\"song\");\n this.transitionTo(\"other.route\");\n ...\n }\n }\n });\n ```\n\n It is also possible to call `this._super()` from within an\n action handler if it overrides a handler defined on a parent\n class or mixin:\n\n Take for example the following routes:\n\n ```js\n App.DebugRoute = Ember.Mixin.create({\n actions: {\n debugRouteInformation: function() {\n console.debug(\"trololo\");\n }\n }\n });\n\n App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, {\n actions: {\n debugRouteInformation: function() {\n // also call the debugRouteInformation of mixed in App.DebugRoute\n this._super();\n\n // show additional annoyance\n window.alert(...);\n }\n }\n });\n ```\n\n ## Bubbling\n\n By default, an action will stop bubbling once a handler defined\n on the `actions` hash handles it. To continue bubbling the action,\n you must return `true` from the handler:\n\n ```js\n App.Router.map(function() {\n this.resource(\"album\", function() {\n this.route(\"song\");\n });\n });\n\n App.AlbumRoute = Ember.Route.extend({\n actions: {\n startPlaying: function() {\n }\n }\n });\n\n App.AlbumSongRoute = Ember.Route.extend({\n actions: {\n startPlaying: function() {\n // ...\n\n if (actionShouldAlsoBeTriggeredOnParentRoute) {\n return true;\n }\n }\n }\n });\n ```\n\n @property actions\n @type Hash\n @default null\n */\n\n /**\n Moves `actions` to `_actions` at extend time. Note that this currently\n modifies the mixin themselves, which is technically dubious but\n is practically of little consequence. This may change in the future.\n\n @private\n @method willMergeMixin\n */\n willMergeMixin: function(props) {\n var hashName;\n\n if (!props._actions) {\n Ember.assert(\"'actions' should not be a function\", typeof(props.actions) !== 'function');\n\n if (typeOf(props.actions) === 'object') {\n hashName = 'actions';\n } else if (typeOf(props.events) === 'object') {\n Ember.deprecate('Action handlers contained in an `events` object are deprecated in favor of putting them in an `actions` object', false);\n hashName = 'events';\n }\n\n if (hashName) {\n props._actions = merge(props._actions || {}, props[hashName]);\n }\n\n delete props[hashName];\n }\n },\n\n /**\n Triggers a named action on the `ActionHandler`. Any parameters\n supplied after the `actionName` string will be passed as arguments\n to the action target function.\n\n If the `ActionHandler` has its `target` property set, actions may\n bubble to the `target`. Bubbling happens when an `actionName` can\n not be found in the `ActionHandler`'s `actions` hash or if the\n action target function returns `true`.\n\n Example\n\n ```js\n App.WelcomeRoute = Ember.Route.extend({\n actions: {\n playTheme: function() {\n this.send('playMusic', 'theme.mp3');\n },\n playMusic: function(track) {\n // ...\n }\n }\n });\n ```\n\n @method send\n @param {String} actionName The action to trigger\n @param {*} context a context to send with the action\n */\n send: function(actionName) {\n var args = [].slice.call(arguments, 1), target;\n\n if (this._actions && this._actions[actionName]) {\n if (this._actions[actionName].apply(this, args) === true) {\n // handler returned true, so this action will bubble\n } else {\n return;\n }\n } else if (!Ember.FEATURES.isEnabled('ember-routing-drop-deprecated-action-style') && this.deprecatedSend && this.deprecatedSendHandles && this.deprecatedSendHandles(actionName)) {\n Ember.warn(\"The current default is deprecated but will prefer to handle actions directly on the controller instead of a similarly named action in the actions hash. To turn off this deprecated feature set: Ember.FEATURES['ember-routing-drop-deprecated-action-style'] = true\");\n if (this.deprecatedSend.apply(this, [].slice.call(arguments)) === true) {\n // handler return true, so this action will bubble\n } else {\n return;\n }\n }\n\n if (target = get(this, 'target')) {\n Ember.assert(\"The `target` for \" + this + \" (\" + target + \") does not have a `send` method\", typeof target.send === 'function');\n target.send.apply(target, arguments);\n }\n }\n });\n\n __exports__[\"default\"] = ActionHandler;\n });\ndefine(\"ember-runtime/mixins/array\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/computed\",\"ember-metal/is_none\",\"ember-runtime/mixins/enumerable\",\"ember-metal/enumerable_utils\",\"ember-metal/mixin\",\"ember-metal/property_events\",\"ember-metal/events\",\"ember-metal/watching\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n // ..........................................................\n // HELPERS\n //\n var Ember = __dependency1__[\"default\"];\n // ES6TODO: Ember.A\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var computed = __dependency4__.computed;\n var cacheFor = __dependency4__.cacheFor;\n var isNone = __dependency5__.isNone;\n var none = __dependency5__.none;\n var Enumerable = __dependency6__[\"default\"];\n var EnumerableUtils = __dependency7__[\"default\"];\n var Mixin = __dependency8__.Mixin;\n var required = __dependency8__.required;\n var propertyWillChange = __dependency9__.propertyWillChange;\n var propertyDidChange = __dependency9__.propertyDidChange;\n var addListener = __dependency10__.addListener;\n var removeListener = __dependency10__.removeListener;\n var sendEvent = __dependency10__.sendEvent;\n var hasListeners = __dependency10__.hasListeners;\n var isWatching = __dependency11__.isWatching;\n\n var map = EnumerableUtils.map;\n\n // ..........................................................\n // ARRAY\n //\n /**\n This mixin implements Observer-friendly Array-like behavior. It is not a\n concrete implementation, but it can be used up by other classes that want\n to appear like arrays.\n\n For example, ArrayProxy and ArrayController are both concrete classes that can\n be instantiated to implement array-like behavior. Both of these classes use\n the Array Mixin by way of the MutableArray mixin, which allows observable\n changes to be made to the underlying array.\n\n Unlike `Ember.Enumerable,` this mixin defines methods specifically for\n collections that provide index-ordered access to their contents. When you\n are designing code that needs to accept any kind of Array-like object, you\n should use these methods instead of Array primitives because these will\n properly notify observers of changes to the array.\n\n Although these methods are efficient, they do add a layer of indirection to\n your application so it is a good idea to use them only when you need the\n flexibility of using both true JavaScript arrays and \"virtual\" arrays such\n as controllers and collections.\n\n You can use the methods defined in this module to access and modify array\n contents in a KVO-friendly way. You can also be notified whenever the\n membership of an array changes by using `.observes('myArray.[]')`.\n\n To support `Ember.Array` in your own class, you must override two\n primitives to use it: `replace()` and `objectAt()`.\n\n Note that the Ember.Array mixin also incorporates the `Ember.Enumerable`\n mixin. All `Ember.Array`-like objects are also enumerable.\n\n @class Array\n @namespace Ember\n @uses Ember.Enumerable\n @since Ember 0.9.0\n */\n var EmberArray = Mixin.create(Enumerable, {\n\n /**\n Your array must support the `length` property. Your replace methods should\n set this property whenever it changes.\n\n @property {Number} length\n */\n length: required(),\n\n /**\n Returns the object at the given `index`. If the given `index` is negative\n or is greater or equal than the array length, returns `undefined`.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n If your object supports retrieving the value of an array item using `get()`\n (i.e. `myArray.get(0)`), then you do not need to implement this method\n yourself.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectAt(0); // \"a\"\n arr.objectAt(3); // \"d\"\n arr.objectAt(-1); // undefined\n arr.objectAt(4); // undefined\n arr.objectAt(5); // undefined\n ```\n\n @method objectAt\n @param {Number} idx The index of the item to return.\n @return {*} item at index or undefined\n */\n objectAt: function(idx) {\n if ((idx < 0) || (idx >= get(this, 'length'))) return undefined;\n return get(this, idx);\n },\n\n /**\n This returns the objects at the specified indexes, using `objectAt`.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectsAt([0, 1, 2]); // [\"a\", \"b\", \"c\"]\n arr.objectsAt([2, 3, 4]); // [\"c\", \"d\", undefined]\n ```\n\n @method objectsAt\n @param {Array} indexes An array of indexes of items to return.\n @return {Array}\n */\n objectsAt: function(indexes) {\n var self = this;\n return map(indexes, function(idx) { return self.objectAt(idx); });\n },\n\n // overrides Ember.Enumerable version\n nextObject: function(idx) {\n return this.objectAt(idx);\n },\n\n /**\n This is the handler for the special array content property. If you get\n this property, it will return this. If you set this property it a new\n array, it will replace the current content.\n\n This property overrides the default property defined in `Ember.Enumerable`.\n\n @property []\n @return this\n */\n '[]': computed(function(key, value) {\n if (value !== undefined) this.replace(0, get(this, 'length'), value) ;\n return this ;\n }),\n\n firstObject: computed(function() {\n return this.objectAt(0);\n }),\n\n lastObject: computed(function() {\n return this.objectAt(get(this, 'length')-1);\n }),\n\n // optimized version from Enumerable\n contains: function(obj) {\n return this.indexOf(obj) >= 0;\n },\n\n // Add any extra methods to Ember.Array that are native to the built-in Array.\n /**\n Returns a new array that is a slice of the receiver. This implementation\n uses the observable array methods to retrieve the objects for the new\n slice.\n\n ```javascript\n var arr = ['red', 'green', 'blue'];\n arr.slice(0); // ['red', 'green', 'blue']\n arr.slice(0, 2); // ['red', 'green']\n arr.slice(1, 100); // ['green', 'blue']\n ```\n\n @method slice\n @param {Integer} beginIndex (Optional) index to begin slicing from.\n @param {Integer} endIndex (Optional) index to end the slice at (but not included).\n @return {Array} New array with specified slice\n */\n slice: function(beginIndex, endIndex) {\n var ret = Ember.A();\n var length = get(this, 'length') ;\n if (isNone(beginIndex)) beginIndex = 0 ;\n if (isNone(endIndex) || (endIndex > length)) endIndex = length ;\n\n if (beginIndex < 0) beginIndex = length + beginIndex;\n if (endIndex < 0) endIndex = length + endIndex;\n\n while(beginIndex < endIndex) {\n ret[ret.length] = this.objectAt(beginIndex++) ;\n }\n return ret ;\n },\n\n /**\n Returns the index of the given object's first occurrence.\n If no `startAt` argument is given, the starting location to\n search is 0. If it's negative, will count backward from\n the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.indexOf(\"a\"); // 0\n arr.indexOf(\"z\"); // -1\n arr.indexOf(\"a\", 2); // 4\n arr.indexOf(\"a\", -1); // 4\n arr.indexOf(\"b\", 3); // -1\n arr.indexOf(\"a\", 100); // -1\n ```\n\n @method indexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n indexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined) startAt = 0;\n if (startAt < 0) startAt += len;\n\n for(idx = startAt; idx < len; idx++) {\n if (this.objectAt(idx) === object) return idx;\n }\n return -1;\n },\n\n /**\n Returns the index of the given object's last occurrence.\n If no `startAt` argument is given, the search starts from\n the last position. If it's negative, will count backward\n from the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.lastIndexOf(\"a\"); // 4\n arr.lastIndexOf(\"z\"); // -1\n arr.lastIndexOf(\"a\", 2); // 0\n arr.lastIndexOf(\"a\", -1); // 4\n arr.lastIndexOf(\"b\", 3); // 1\n arr.lastIndexOf(\"a\", 100); // 4\n ```\n\n @method lastIndexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n lastIndexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined || startAt >= len) startAt = len-1;\n if (startAt < 0) startAt += len;\n\n for(idx = startAt; idx >= 0; idx--) {\n if (this.objectAt(idx) === object) return idx;\n }\n return -1;\n },\n\n // ..........................................................\n // ARRAY OBSERVERS\n //\n\n /**\n Adds an array observer to the receiving array. The array observer object\n normally must implement two methods:\n\n * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be\n called just before the array is modified.\n * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be\n called just after the array is modified.\n\n Both callbacks will be passed the observed object, starting index of the\n change as well a a count of the items to be removed and added. You can use\n these callbacks to optionally inspect the array during the change, clear\n caches, or do any other bookkeeping necessary.\n\n In addition to passing a target, you can also include an options hash\n which you can use to override the method names that will be invoked on the\n target.\n\n @method addArrayObserver\n @param {Object} target The observer object.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n addArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (!hasObservers) propertyWillChange(this, 'hasArrayObservers');\n addListener(this, '@array:before', target, willChange);\n addListener(this, '@array:change', target, didChange);\n if (!hasObservers) propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Removes an array observer from the object if the observer is current\n registered. Calling this method multiple times with the same object will\n have no effect.\n\n @method removeArrayObserver\n @param {Object} target The object observing the array.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n removeArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (hasObservers) propertyWillChange(this, 'hasArrayObservers');\n removeListener(this, '@array:before', target, willChange);\n removeListener(this, '@array:change', target, didChange);\n if (hasObservers) propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property {Boolean} hasArrayObservers\n */\n hasArrayObservers: computed(function() {\n return hasListeners(this, '@array:change') || hasListeners(this, '@array:before');\n }),\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just before the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentWillChange\n @param {Number} startIdx The starting index in the array that will change.\n @param {Number} removeAmt The number of items that will be removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that will be added. If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentWillChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n // Make sure the @each proxy is set up if anyone is observing @each\n if (isWatching(this, '@each')) { get(this, '@each'); }\n\n sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);\n\n var removing, lim;\n if (startIdx>=0 && removeAmt>=0 && get(this, 'hasEnumerableObservers')) {\n removing = [];\n lim = startIdx+removeAmt;\n for(var idx=startIdx;idx<lim;idx++) removing.push(this.objectAt(idx));\n } else {\n removing = removeAmt;\n }\n\n this.enumerableContentWillChange(removing, addAmt);\n\n return this;\n },\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just after the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentDidChange\n @param {Number} startIdx The starting index in the array that did change.\n @param {Number} removeAmt The number of items that were removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that were added. If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentDidChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n var adding, lim;\n if (startIdx>=0 && addAmt>=0 && get(this, 'hasEnumerableObservers')) {\n adding = [];\n lim = startIdx+addAmt;\n for(var idx=startIdx;idx<lim;idx++) adding.push(this.objectAt(idx));\n } else {\n adding = addAmt;\n }\n\n this.enumerableContentDidChange(removeAmt, adding);\n sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]);\n\n var length = get(this, 'length'),\n cachedFirst = cacheFor(this, 'firstObject'),\n cachedLast = cacheFor(this, 'lastObject');\n if (this.objectAt(0) !== cachedFirst) {\n propertyWillChange(this, 'firstObject');\n propertyDidChange(this, 'firstObject');\n }\n if (this.objectAt(length-1) !== cachedLast) {\n propertyWillChange(this, 'lastObject');\n propertyDidChange(this, 'lastObject');\n }\n\n return this;\n },\n\n // ..........................................................\n // ENUMERATED PROPERTIES\n //\n\n /**\n Returns a special object that can be used to observe individual properties\n on the array. Just get an equivalent property on this object and it will\n return an enumerable that maps automatically to the named key on the\n member objects.\n\n If you merely want to watch for any items being added or removed to the array,\n use the `[]` property instead of `@each`.\n\n @property @each\n */\n '@each': computed(function() {\n if (!this.__each) {\n // ES6TODO: GRRRRR\n var EachProxy = requireModule('ember-runtime/system/each_proxy')['EachProxy'];\n\n this.__each = new EachProxy(this);\n }\n\n return this.__each;\n })\n\n });\n\n __exports__[\"default\"] = EmberArray;\n });\ndefine(\"ember-runtime/mixins/comparable\",\n [\"ember-metal/mixin\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Mixin = __dependency1__.Mixin;\n var required = __dependency1__.required;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n\n /**\n Implements some standard methods for comparing objects. Add this mixin to\n any class you create that can compare its instances.\n\n You should implement the `compare()` method.\n\n @class Comparable\n @namespace Ember\n @since Ember 0.9\n */\n var Comparable = Mixin.create({\n\n /**\n Override to return the result of the comparison of the two parameters. The\n compare method should return:\n\n - `-1` if `a < b`\n - `0` if `a == b`\n - `1` if `a > b`\n\n Default implementation raises an exception.\n\n @method compare\n @param a {Object} the first object to compare\n @param b {Object} the second object to compare\n @return {Integer} the result of the comparison\n */\n compare: required(Function)\n\n });\n\n __exports__[\"default\"] = Comparable;\n });\ndefine(\"ember-runtime/mixins/copyable\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/mixin\",\"ember-runtime/mixins/freezable\",\"ember-runtime/system/string\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var required = __dependency3__.required;\n var Freezable = __dependency4__.Freezable;\n var Mixin = __dependency3__.Mixin;\n var fmt = __dependency5__.fmt;\n var EmberError = __dependency6__[\"default\"];\n\n\n /**\n Implements some standard methods for copying an object. Add this mixin to\n any object you create that can create a copy of itself. This mixin is\n added automatically to the built-in array.\n\n You should generally implement the `copy()` method to return a copy of the\n receiver.\n\n Note that `frozenCopy()` will only work if you also implement\n `Ember.Freezable`.\n\n @class Copyable\n @namespace Ember\n @since Ember 0.9\n */\n var Copyable = Mixin.create({\n\n /**\n Override to return a copy of the receiver. Default implementation raises\n an exception.\n\n @method copy\n @param {Boolean} deep if `true`, a deep copy of the object should be made\n @return {Object} copy of receiver\n */\n copy: required(Function),\n\n /**\n If the object implements `Ember.Freezable`, then this will return a new\n copy if the object is not frozen and the receiver if the object is frozen.\n\n Raises an exception if you try to call this method on a object that does\n not support freezing.\n\n You should use this method whenever you want a copy of a freezable object\n since a freezable object can simply return itself without actually\n consuming more memory.\n\n @method frozenCopy\n @return {Object} copy of receiver or receiver\n */\n frozenCopy: function() {\n if (Freezable && Freezable.detect(this)) {\n return get(this, 'isFrozen') ? this : this.copy().freeze();\n } else {\n throw new EmberError(fmt(\"%@ does not support freezing\", [this]));\n }\n }\n });\n\n __exports__[\"default\"] = Copyable;\n });\ndefine(\"ember-runtime/mixins/deferred\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/mixin\",\"ember-metal/computed\",\"ember-metal/run_loop\",\"ember-runtime/ext/rsvp\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.FEATURES, Ember.Test\n var get = __dependency2__.get;\n var Mixin = __dependency3__.Mixin;\n var computed = __dependency4__.computed;\n var run = __dependency5__[\"default\"];\n var RSVP = __dependency6__[\"default\"];\n\n var asyncStart = function() {\n if (Ember.Test && Ember.Test.adapter) {\n Ember.Test.adapter.asyncStart();\n }\n };\n\n var asyncEnd = function() {\n if (Ember.Test && Ember.Test.adapter) {\n Ember.Test.adapter.asyncEnd();\n }\n };\n\n RSVP.configure('async', function(callback, promise) {\n var async = !run.currentRunLoop;\n\n if (Ember.testing && async) { asyncStart(); }\n\n run.backburner.schedule('actions', function(){\n if (Ember.testing && async) { asyncEnd(); }\n callback(promise);\n });\n });\n\n RSVP.Promise.prototype.fail = function(callback, label){\n Ember.deprecate('RSVP.Promise.fail has been renamed as RSVP.Promise.catch');\n return this['catch'](callback, label);\n };\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n\n /**\n @class Deferred\n @namespace Ember\n */\n var DeferredMixin = Mixin.create({\n /**\n Add handlers to be called when the Deferred object is resolved or rejected.\n\n @method then\n @param {Function} resolve a callback function to be called when done\n @param {Function} reject a callback function to be called when failed\n */\n then: function(resolve, reject, label) {\n var deferred, promise, entity;\n\n entity = this;\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n function fulfillmentHandler(fulfillment) {\n if (fulfillment === promise) {\n return resolve(entity);\n } else {\n return resolve(fulfillment);\n }\n }\n\n return promise.then(resolve && fulfillmentHandler, reject, label);\n },\n\n /**\n Resolve a Deferred object and call any `doneCallbacks` with the given args.\n\n @method resolve\n */\n resolve: function(value) {\n var deferred, promise;\n\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n if (value === this) {\n deferred.resolve(promise);\n } else {\n deferred.resolve(value);\n }\n },\n\n /**\n Reject a Deferred object and call any `failCallbacks` with the given args.\n\n @method reject\n */\n reject: function(value) {\n get(this, '_deferred').reject(value);\n },\n\n _deferred: computed(function() {\n return RSVP.defer('Ember: DeferredMixin - ' + this);\n })\n });\n\n __exports__[\"default\"] = DeferredMixin;\n });\ndefine(\"ember-runtime/mixins/enumerable\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/mixin\",\"ember-metal/enumerable_utils\",\"ember-metal/computed\",\"ember-metal/property_events\",\"ember-metal/events\",\"ember-runtime/compare\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n // ..........................................................\n // HELPERS\n //\n\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var apply = __dependency4__.apply;\n var Mixin = __dependency5__.Mixin;\n var required = __dependency5__.required;\n var aliasMethod = __dependency5__.aliasMethod;\n var EnumerableUtils = __dependency6__[\"default\"];\n var computed = __dependency7__.computed;\n var propertyWillChange = __dependency8__.propertyWillChange;\n var propertyDidChange = __dependency8__.propertyDidChange;\n var addListener = __dependency9__.addListener;\n var removeListener = __dependency9__.removeListener;\n var sendEvent = __dependency9__.sendEvent;\n var hasListeners = __dependency9__.hasListeners;\n var compare = __dependency10__[\"default\"];\n\n var a_slice = Array.prototype.slice;\n var a_indexOf = EnumerableUtils.indexOf;\n\n var contexts = [];\n\n function popCtx() {\n return contexts.length===0 ? {} : contexts.pop();\n }\n\n function pushCtx(ctx) {\n contexts.push(ctx);\n return null;\n }\n\n function iter(key, value) {\n var valueProvided = arguments.length === 2;\n\n function i(item) {\n var cur = get(item, key);\n return valueProvided ? value===cur : !!cur;\n }\n return i ;\n }\n\n /**\n This mixin defines the common interface implemented by enumerable objects\n in Ember. Most of these methods follow the standard Array iteration\n API defined up to JavaScript 1.8 (excluding language-specific features that\n cannot be emulated in older versions of JavaScript).\n\n This mixin is applied automatically to the Array class on page load, so you\n can use any of these methods on simple arrays. If Array already implements\n one of these methods, the mixin will not override them.\n\n ## Writing Your Own Enumerable\n\n To make your own custom class enumerable, you need two items:\n\n 1. You must have a length property. This property should change whenever\n the number of items in your enumerable object changes. If you use this\n with an `Ember.Object` subclass, you should be sure to change the length\n property using `set().`\n\n 2. You must implement `nextObject().` See documentation.\n\n Once you have these two methods implemented, apply the `Ember.Enumerable` mixin\n to your class and you will be able to enumerate the contents of your object\n like any other collection.\n\n ## Using Ember Enumeration with Other Libraries\n\n Many other libraries provide some kind of iterator or enumeration like\n facility. This is often where the most common API conflicts occur.\n Ember's API is designed to be as friendly as possible with other\n libraries by implementing only methods that mostly correspond to the\n JavaScript 1.8 API.\n\n @class Enumerable\n @namespace Ember\n @since Ember 0.9\n */\n var Enumerable = Mixin.create({\n\n /**\n Implement this method to make your class enumerable.\n\n This method will be call repeatedly during enumeration. The index value\n will always begin with 0 and increment monotonically. You don't have to\n rely on the index value to determine what object to return, but you should\n always check the value and start from the beginning when you see the\n requested index is 0.\n\n The `previousObject` is the object that was returned from the last call\n to `nextObject` for the current iteration. This is a useful way to\n manage iteration if you are tracing a linked list, for example.\n\n Finally the context parameter will always contain a hash you can use as\n a \"scratchpad\" to maintain any other state you need in order to iterate\n properly. The context object is reused and is not reset between\n iterations so make sure you setup the context with a fresh state whenever\n the index parameter is 0.\n\n Generally iterators will continue to call `nextObject` until the index\n reaches the your current length-1. If you run out of data before this\n time for some reason, you should simply return undefined.\n\n The default implementation of this method simply looks up the index.\n This works great on any Array-like objects.\n\n @method nextObject\n @param {Number} index the current index of the iteration\n @param {Object} previousObject the value returned by the last call to\n `nextObject`.\n @param {Object} context a context object you can use to maintain state.\n @return {Object} the next object in the iteration or undefined\n */\n nextObject: required(Function),\n\n /**\n Helper method returns the first object from a collection. This is usually\n used by bindings and other parts of the framework to extract a single\n object if the enumerable contains only one item.\n\n If you override this method, you should implement it so that it will\n always return the same value each time it is called. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('firstObject'); // \"a\"\n\n var arr = [];\n arr.get('firstObject'); // undefined\n ```\n\n @property firstObject\n @return {Object} the object or undefined\n */\n firstObject: computed(function() {\n if (get(this, 'length')===0) return undefined ;\n\n // handle generic enumerables\n var context = popCtx(), ret;\n ret = this.nextObject(0, null, context);\n pushCtx(context);\n return ret ;\n }).property('[]'),\n\n /**\n Helper method returns the last object from a collection. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('lastObject'); // \"c\"\n\n var arr = [];\n arr.get('lastObject'); // undefined\n ```\n\n @property lastObject\n @return {Object} the last object or undefined\n */\n lastObject: computed(function() {\n var len = get(this, 'length');\n if (len===0) return undefined ;\n var context = popCtx(), idx=0, cur, last = null;\n do {\n last = cur;\n cur = this.nextObject(idx++, last, context);\n } while (cur !== undefined);\n pushCtx(context);\n return last;\n }).property('[]'),\n\n /**\n Returns `true` if the passed object can be found in the receiver. The\n default version will iterate through the enumerable until the object\n is found. You may want to override this with a more efficient version.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.contains(\"a\"); // true\n arr.contains(\"z\"); // false\n ```\n\n @method contains\n @param {Object} obj The object to search for.\n @return {Boolean} `true` if object is found in enumerable.\n */\n contains: function(obj) {\n return this.find(function(item) { return item===obj; }) !== undefined;\n },\n\n /**\n Iterates through the enumerable, calling the passed function on each\n item. This method corresponds to the `forEach()` method defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method forEach\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} receiver\n */\n forEach: function(callback, target) {\n if (typeof callback !== \"function\") throw new TypeError() ;\n var len = get(this, 'length'), last = null, context = popCtx();\n\n if (target === undefined) target = null;\n\n for(var idx=0;idx<len;idx++) {\n var next = this.nextObject(idx, last, context) ;\n callback.call(target, next, idx, this);\n last = next ;\n }\n last = null ;\n context = pushCtx(context);\n return this ;\n },\n\n /**\n Alias for `mapBy`\n\n @method getEach\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n getEach: function(key) {\n return this.mapBy(key);\n },\n\n /**\n Sets the value on the named property for each member. This is more\n efficient than using other methods defined on this helper. If the object\n implements Ember.Observable, the value will be changed to `set(),` otherwise\n it will be set directly. `null` objects are skipped.\n\n @method setEach\n @param {String} key The key to set\n @param {Object} value The object to set\n @return {Object} receiver\n */\n setEach: function(key, value) {\n return this.forEach(function(item) {\n set(item, key, value);\n });\n },\n\n /**\n Maps all of the items in the enumeration to another value, returning\n a new array. This method corresponds to `map()` defined in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the mapped value.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method map\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} The mapped array.\n */\n map: function(callback, target) {\n var ret = Ember.A();\n this.forEach(function(x, idx, i) {\n ret[idx] = callback.call(target, x, idx,i);\n });\n return ret ;\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapBy\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n mapBy: function(key) {\n return this.map(function(next) {\n return get(next, key);\n });\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapProperty\n @param {String} key name of the property\n @return {Array} The mapped array.\n @deprecated Use `mapBy` instead\n */\n\n mapProperty: aliasMethod('mapBy'),\n\n /**\n Returns an array with all of the items in the enumeration that the passed\n function returns true for. This method corresponds to `filter()` defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method filter\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A filtered array.\n */\n filter: function(callback, target) {\n var ret = Ember.A();\n this.forEach(function(x, idx, i) {\n if (callback.call(target, x, idx, i)) ret.push(x);\n });\n return ret ;\n },\n\n /**\n Returns an array with all of the items in the enumeration where the passed\n function returns false for. This method is the inverse of filter().\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - *item* is the current item in the iteration.\n - *index* is the current index in the iteration\n - *enumerable* is the enumerable object itself.\n\n It should return the a falsey value to include the item in the results.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as \"this\" on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method reject\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A rejected array.\n */\n reject: function(callback, target) {\n return this.filter(function() {\n return !(apply(target, callback, arguments));\n });\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterBy\n @param {String} key the property to test\n @param {*} [value] optional value to test against.\n @return {Array} filtered array\n */\n filterBy: function(key, value) {\n return this.filter(apply(this, iter, arguments));\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} filtered array\n @deprecated Use `filterBy` instead\n */\n filterProperty: aliasMethod('filterBy'),\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n */\n rejectBy: function(key, value) {\n var exactValue = function(item) { return get(item, key) === value; },\n hasValue = function(item) { return !!get(item, key); },\n use = (arguments.length === 2 ? exactValue : hasValue);\n\n return this.reject(use);\n },\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n @deprecated Use `rejectBy` instead\n */\n rejectProperty: aliasMethod('rejectBy'),\n\n /**\n Returns the first item in the array for which the callback returns true.\n This method works similar to the `filter()` method defined in JavaScript 1.6\n except that it will stop working on the array once a match is found.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method find\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} Found item or `undefined`.\n */\n find: function(callback, target) {\n var len = get(this, 'length') ;\n if (target === undefined) target = null;\n\n var last = null, next, found = false, ret ;\n var context = popCtx();\n for(var idx=0;idx<len && !found;idx++) {\n next = this.nextObject(idx, last, context) ;\n if (found = callback.call(target, next, idx, this)) ret = next ;\n last = next ;\n }\n next = last = null ;\n context = pushCtx(context);\n return ret ;\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n */\n findBy: function(key, value) {\n return this.find(apply(this, iter, arguments));\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n @deprecated Use `findBy` instead\n */\n findProperty: aliasMethod('findBy'),\n\n /**\n Returns `true` if the passed function returns true for every item in the\n enumeration. This corresponds with the `every()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` or `false`.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Example Usage:\n\n ```javascript\n if (people.every(isEngineer)) { Paychecks.addBigBonus(); }\n ```\n\n @method every\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean}\n */\n every: function(callback, target) {\n return !this.find(function(x, idx, i) {\n return !callback.call(target, x, idx, i);\n });\n },\n\n /**\n @method everyBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @deprecated Use `isEvery` instead\n @return {Boolean}\n */\n everyBy: aliasMethod('isEvery'),\n\n /**\n @method everyProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @deprecated Use `isEvery` instead\n @return {Boolean}\n */\n everyProperty: aliasMethod('isEvery'),\n\n /**\n Returns `true` if the passed property resolves to `true` for all items in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method isEvery\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean}\n @since 1.3.0\n */\n isEvery: function(key, value) {\n return this.every(apply(this, iter, arguments));\n },\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.any(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method any\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean} `true` if the passed function returns `true` for any item\n */\n any: function(callback, target) {\n var len = get(this, 'length'),\n context = popCtx(),\n found = false,\n last = null,\n next, idx;\n\n if (target === undefined) { target = null; }\n\n for (idx = 0; idx < len && !found; idx++) {\n next = this.nextObject(idx, last, context);\n found = callback.call(target, next, idx, this);\n last = next;\n }\n\n next = last = null;\n context = pushCtx(context);\n return found;\n },\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.some(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method some\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `any` instead\n */\n some: aliasMethod('any'),\n\n /**\n Returns `true` if the passed property resolves to `true` for any item in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method isAny\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n @since 1.3.0\n */\n isAny: function(key, value) {\n return this.any(apply(this, iter, arguments));\n },\n\n /**\n @method anyBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `isAny` instead\n */\n anyBy: aliasMethod('isAny'),\n\n /**\n @method someProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `isAny` instead\n */\n someProperty: aliasMethod('isAny'),\n\n /**\n This will combine the values of the enumerator into a single value. It\n is a useful way to collect a summary value from an enumeration. This\n corresponds to the `reduce()` method defined in JavaScript 1.8.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(previousValue, item, index, enumerable);\n ```\n\n - `previousValue` is the value returned by the last call to the iterator.\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Return the new cumulative value.\n\n In addition to the callback you can also pass an `initialValue`. An error\n will be raised if you do not pass an initial value and the enumerator is\n empty.\n\n Note that unlike the other methods, this method does not allow you to\n pass a target object to set as this for the callback. It's part of the\n spec. Sorry.\n\n @method reduce\n @param {Function} callback The callback to execute\n @param {Object} initialValue Initial value for the reduce\n @param {String} reducerProperty internal use only.\n @return {Object} The reduced value.\n */\n reduce: function(callback, initialValue, reducerProperty) {\n if (typeof callback !== \"function\") { throw new TypeError(); }\n\n var ret = initialValue;\n\n this.forEach(function(item, i) {\n ret = callback(ret, item, i, this, reducerProperty);\n }, this);\n\n return ret;\n },\n\n /**\n Invokes the named method on every object in the receiver that\n implements it. This method corresponds to the implementation in\n Prototype 1.6.\n\n @method invoke\n @param {String} methodName the name of the method\n @param {Object...} args optional arguments to pass as well.\n @return {Array} return values from calling invoke.\n */\n invoke: function(methodName) {\n var args, ret = Ember.A();\n if (arguments.length>1) args = a_slice.call(arguments, 1);\n\n this.forEach(function(x, idx) {\n var method = x && x[methodName];\n if ('function' === typeof method) {\n ret[idx] = args ? apply(x, method, args) : x[methodName]();\n }\n }, this);\n\n return ret;\n },\n\n /**\n Simply converts the enumerable into a genuine array. The order is not\n guaranteed. Corresponds to the method implemented by Prototype.\n\n @method toArray\n @return {Array} the enumerable as an array.\n */\n toArray: function() {\n var ret = Ember.A();\n this.forEach(function(o, idx) { ret[idx] = o; });\n return ret;\n },\n\n /**\n Returns a copy of the array with all null and undefined elements removed.\n\n ```javascript\n var arr = [\"a\", null, \"c\", undefined];\n arr.compact(); // [\"a\", \"c\"]\n ```\n\n @method compact\n @return {Array} the array without null and undefined elements.\n */\n compact: function() {\n return this.filter(function(value) { return value != null; });\n },\n\n /**\n Returns a new enumerable that excludes the passed value. The default\n implementation returns an array regardless of the receiver type unless\n the receiver does not contain the value.\n\n ```javascript\n var arr = [\"a\", \"b\", \"a\", \"c\"];\n arr.without(\"a\"); // [\"b\", \"c\"]\n ```\n\n @method without\n @param {Object} value\n @return {Ember.Enumerable}\n */\n without: function(value) {\n if (!this.contains(value)) return this; // nothing to do\n var ret = Ember.A();\n this.forEach(function(k) {\n if (k !== value) ret[ret.length] = k;\n }) ;\n return ret ;\n },\n\n /**\n Returns a new enumerable that contains only unique values. The default\n implementation returns an array regardless of the receiver type.\n\n ```javascript\n var arr = [\"a\", \"a\", \"b\", \"b\"];\n arr.uniq(); // [\"a\", \"b\"]\n ```\n\n @method uniq\n @return {Ember.Enumerable}\n */\n uniq: function() {\n var ret = Ember.A();\n this.forEach(function(k) {\n if (a_indexOf(ret, k)<0) ret.push(k);\n });\n return ret;\n },\n\n /**\n This property will trigger anytime the enumerable's content changes.\n You can observe this property to be notified of changes to the enumerables\n content.\n\n For plain enumerables, this property is read only. `Array` overrides\n this method.\n\n @property []\n @type Array\n @return this\n */\n '[]': computed(function(key, value) {\n return this;\n }),\n\n // ..........................................................\n // ENUMERABLE OBSERVERS\n //\n\n /**\n Registers an enumerable observer. Must implement `Ember.EnumerableObserver`\n mixin.\n\n @method addEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n addEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (!hasObservers) propertyWillChange(this, 'hasEnumerableObservers');\n addListener(this, '@enumerable:before', target, willChange);\n addListener(this, '@enumerable:change', target, didChange);\n if (!hasObservers) propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Removes a registered enumerable observer.\n\n @method removeEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n removeEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (hasObservers) propertyWillChange(this, 'hasEnumerableObservers');\n removeListener(this, '@enumerable:before', target, willChange);\n removeListener(this, '@enumerable:change', target, didChange);\n if (hasObservers) propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property hasEnumerableObservers\n @type Boolean\n */\n hasEnumerableObservers: computed(function() {\n return hasListeners(this, '@enumerable:change') || hasListeners(this, '@enumerable:before');\n }),\n\n\n /**\n Invoke this method just before the contents of your enumerable will\n change. You can either omit the parameters completely or pass the objects\n to be removed or added if available or just a count.\n\n @method enumerableContentWillChange\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to be\n added or the number of items to be added.\n @chainable\n */\n enumerableContentWillChange: function(removing, adding) {\n\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding,'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n propertyWillChange(this, '[]');\n if (hasDelta) propertyWillChange(this, 'length');\n sendEvent(this, '@enumerable:before', [this, removing, adding]);\n\n return this;\n },\n\n /**\n Invoke this method when the contents of your enumerable has changed.\n This will notify any observers watching for content changes. If your are\n implementing an ordered enumerable (such as an array), also pass the\n start and end values where the content changed so that it can be used to\n notify range observers.\n\n @method enumerableContentDidChange\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to\n be added or the number of items to be added.\n @chainable\n */\n enumerableContentDidChange: function(removing, adding) {\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding, 'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n sendEvent(this, '@enumerable:change', [this, removing, adding]);\n if (hasDelta) propertyDidChange(this, 'length');\n propertyDidChange(this, '[]');\n\n return this ;\n },\n\n /**\n Converts the enumerable into an array and sorts by the keys\n specified in the argument.\n\n You may provide multiple arguments to sort by multiple properties.\n\n @method sortBy\n @param {String} property name(s) to sort on\n @return {Array} The sorted array.\n @since 1.2.0\n */\n sortBy: function() {\n var sortKeys = arguments;\n return this.toArray().sort(function(a, b){\n for(var i = 0; i < sortKeys.length; i++) {\n var key = sortKeys[i],\n propA = get(a, key),\n propB = get(b, key);\n // return 1 or -1 else continue to the next sortKey\n var compareValue = compare(propA, propB);\n if (compareValue) { return compareValue; }\n }\n return 0;\n });\n }\n });\n\n __exports__[\"default\"] = Enumerable;\n });\ndefine(\"ember-runtime/mixins/evented\",\n [\"ember-metal/mixin\",\"ember-metal/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Mixin = __dependency1__.Mixin;\n var addListener = __dependency2__.addListener;\n var removeListener = __dependency2__.removeListener;\n var hasListeners = __dependency2__.hasListeners;\n var sendEvent = __dependency2__.sendEvent;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n /**\n This mixin allows for Ember objects to subscribe to and emit events.\n\n ```javascript\n App.Person = Ember.Object.extend(Ember.Evented, {\n greet: function() {\n // ...\n this.trigger('greet');\n }\n });\n\n var person = App.Person.create();\n\n person.on('greet', function() {\n console.log('Our person has greeted');\n });\n\n person.greet();\n\n // outputs: 'Our person has greeted'\n ```\n\n You can also chain multiple event subscriptions:\n\n ```javascript\n person.on('greet', function() {\n console.log('Our person has greeted');\n }).one('greet', function() {\n console.log('Offer one-time special');\n }).off('event', this, forgetThis);\n ```\n\n @class Evented\n @namespace Ember\n */\n var Evented = Mixin.create({\n\n /**\n Subscribes to a named event with given function.\n\n ```javascript\n person.on('didLoad', function() {\n // fired once the person has loaded\n });\n ```\n\n An optional target can be passed in as the 2nd argument that will\n be set as the \"this\" for the callback. This is a good way to give your\n function access to the object triggering the event. When the target\n parameter is used the callback becomes the third argument.\n\n @method on\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n on: function(name, target, method) {\n addListener(this, name, target, method);\n return this;\n },\n\n /**\n Subscribes a function to a named event and then cancels the subscription\n after the first time the event is triggered. It is good to use ``one`` when\n you only care about the first time an event has taken place.\n\n This function takes an optional 2nd argument that will become the \"this\"\n value for the callback. If this argument is passed then the 3rd argument\n becomes the function.\n\n @method one\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n one: function(name, target, method) {\n if (!method) {\n method = target;\n target = null;\n }\n\n addListener(this, name, target, method, true);\n return this;\n },\n\n /**\n Triggers a named event for the object. Any additional arguments\n will be passed as parameters to the functions that are subscribed to the\n event.\n\n ```javascript\n person.on('didEat', function(food) {\n console.log('person ate some ' + food);\n });\n\n person.trigger('didEat', 'broccoli');\n\n // outputs: person ate some broccoli\n ```\n @method trigger\n @param {String} name The name of the event\n @param {Object...} args Optional arguments to pass on\n */\n trigger: function(name) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n sendEvent(this, name, args);\n },\n\n /**\n Cancels subscription for given name, target, and method.\n\n @method off\n @param {String} name The name of the event\n @param {Object} target The target of the subscription\n @param {Function} method The function of the subscription\n @return this\n */\n off: function(name, target, method) {\n removeListener(this, name, target, method);\n return this;\n },\n\n /**\n Checks to see if object has any subscriptions for named event.\n\n @method has\n @param {String} name The name of the event\n @return {Boolean} does the object have a subscription for event\n */\n has: function(name) {\n return hasListeners(this, name);\n }\n });\n\n __exports__[\"default\"] = Evented;\n });\ndefine(\"ember-runtime/mixins/freezable\",\n [\"ember-metal/mixin\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Mixin = __dependency1__.Mixin;\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n\n /**\n The `Ember.Freezable` mixin implements some basic methods for marking an\n object as frozen. Once an object is frozen it should be read only. No changes\n may be made the internal state of the object.\n\n ## Enforcement\n\n To fully support freezing in your subclass, you must include this mixin and\n override any method that might alter any property on the object to instead\n raise an exception. You can check the state of an object by checking the\n `isFrozen` property.\n\n Although future versions of JavaScript may support language-level freezing\n object objects, that is not the case today. Even if an object is freezable,\n it is still technically possible to modify the object, even though it could\n break other parts of your application that do not expect a frozen object to\n change. It is, therefore, very important that you always respect the\n `isFrozen` property on all freezable objects.\n\n ## Example Usage\n\n The example below shows a simple object that implement the `Ember.Freezable`\n protocol.\n\n ```javascript\n Contact = Ember.Object.extend(Ember.Freezable, {\n firstName: null,\n lastName: null,\n\n // swaps the names\n swapNames: function() {\n if (this.get('isFrozen')) throw Ember.FROZEN_ERROR;\n var tmp = this.get('firstName');\n this.set('firstName', this.get('lastName'));\n this.set('lastName', tmp);\n return this;\n }\n\n });\n\n c = Contact.create({ firstName: \"John\", lastName: \"Doe\" });\n c.swapNames(); // returns c\n c.freeze();\n c.swapNames(); // EXCEPTION\n ```\n\n ## Copying\n\n Usually the `Ember.Freezable` protocol is implemented in cooperation with the\n `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will\n return a frozen object, if the object implements this method as well.\n\n @class Freezable\n @namespace Ember\n @since Ember 0.9\n */\n var Freezable = Mixin.create({\n\n /**\n Set to `true` when the object is frozen. Use this property to detect\n whether your object is frozen or not.\n\n @property isFrozen\n @type Boolean\n */\n isFrozen: false,\n\n /**\n Freezes the object. Once this method has been called the object should\n no longer allow any properties to be edited.\n\n @method freeze\n @return {Object} receiver\n */\n freeze: function() {\n if (get(this, 'isFrozen')) return this;\n set(this, 'isFrozen', true);\n return this;\n }\n\n });\n\n var FROZEN_ERROR = \"Frozen object cannot be modified.\";\n\n __exports__.Freezable = Freezable;\n __exports__.FROZEN_ERROR = FROZEN_ERROR;\n });\ndefine(\"ember-runtime/mixins/mutable_array\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/error\",\"ember-metal/mixin\",\"ember-runtime/mixins/array\",\"ember-runtime/mixins/mutable_enumerable\",\"ember-runtime/mixins/enumerable\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n\n // require('ember-runtime/mixins/array');\n // require('ember-runtime/mixins/mutable_enumerable');\n\n // ..........................................................\n // CONSTANTS\n //\n\n var OUT_OF_RANGE_EXCEPTION = \"Index out of range\";\n var EMPTY = [];\n\n // ..........................................................\n // HELPERS\n //\n\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var isArray = __dependency3__.isArray;\n var EmberError = __dependency4__[\"default\"];\n var Mixin = __dependency5__.Mixin;\n var required = __dependency5__.required;\n var EmberArray = __dependency6__[\"default\"];\n var MutableEnumerable = __dependency7__[\"default\"];\n var Enumerable = __dependency8__[\"default\"];\n /**\n This mixin defines the API for modifying array-like objects. These methods\n can be applied only to a collection that keeps its items in an ordered set.\n It builds upon the Array mixin and adds methods to modify the array.\n Concrete implementations of this class include ArrayProxy and ArrayController.\n\n It is important to use the methods in this class to modify arrays so that\n changes are observable. This allows the binding system in Ember to function\n correctly.\n\n\n Note that an Array can change even if it does not implement this mixin.\n For example, one might implement a SparseArray that cannot be directly\n modified, but if its underlying enumerable changes, it will change also.\n\n @class MutableArray\n @namespace Ember\n @uses Ember.Array\n @uses Ember.MutableEnumerable\n */\n var MutableArray = Mixin.create(EmberArray, MutableEnumerable, {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n You should replace amt objects started at idx with the objects in the\n passed array. You should also call `this.enumerableContentDidChange()`\n\n @method replace\n @param {Number} idx Starting index in the array to replace. If\n idx >= length, then append to the end of the array.\n @param {Number} amt Number of elements that should be removed from\n the array, starting at *idx*.\n @param {Array} objects An array of zero or more objects that should be\n inserted into the array at *idx*\n */\n replace: required(),\n\n /**\n Remove all elements from the array. This is useful if you\n want to reuse an existing array without having to recreate it.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n color.length(); // 3\n colors.clear(); // []\n colors.length(); // 0\n ```\n\n @method clear\n @return {Ember.Array} An empty Array.\n */\n clear: function () {\n var len = get(this, 'length');\n if (len === 0) return this;\n this.replace(0, len, EMPTY);\n return this;\n },\n\n /**\n This will use the primitive `replace()` method to insert an object at the\n specified index.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.insertAt(2, \"yellow\"); // [\"red\", \"green\", \"yellow\", \"blue\"]\n colors.insertAt(5, \"orange\"); // Error: Index out of range\n ```\n\n @method insertAt\n @param {Number} idx index of insert the object at.\n @param {Object} object object to insert\n @return {Ember.Array} receiver\n */\n insertAt: function(idx, object) {\n if (idx > get(this, 'length')) throw new EmberError(OUT_OF_RANGE_EXCEPTION);\n this.replace(idx, 0, [object]);\n return this;\n },\n\n /**\n Remove an object at the specified index using the `replace()` primitive\n method. You can pass either a single index, or a start and a length.\n\n If you pass a start and length that is beyond the\n length this method will throw an `OUT_OF_RANGE_EXCEPTION`.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\", \"yellow\", \"orange\"];\n colors.removeAt(0); // [\"green\", \"blue\", \"yellow\", \"orange\"]\n colors.removeAt(2, 2); // [\"green\", \"blue\"]\n colors.removeAt(4, 2); // Error: Index out of range\n ```\n\n @method removeAt\n @param {Number} start index, start of range\n @param {Number} len length of passing range\n @return {Ember.Array} receiver\n */\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new EmberError(OUT_OF_RANGE_EXCEPTION);\n }\n\n // fast case\n if (len === undefined) len = 1;\n this.replace(start, len, EMPTY);\n }\n\n return this;\n },\n\n /**\n Push the object onto the end of the array. Works just like `push()` but it\n is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\"];\n colors.pushObject(\"black\"); // [\"red\", \"green\", \"black\"]\n colors.pushObject([\"yellow\"]); // [\"red\", \"green\", [\"yellow\"]]\n ```\n\n @method pushObject\n @param {*} obj object to push\n @return object same object passed as a param\n */\n pushObject: function(obj) {\n this.insertAt(get(this, 'length'), obj);\n return obj;\n },\n\n /**\n Add the objects in the passed numerable to the end of the array. Defers\n notifying observers of the change until all objects are added.\n\n ```javascript\n var colors = [\"red\"];\n colors.pushObjects([\"yellow\", \"orange\"]); // [\"red\", \"yellow\", \"orange\"]\n ```\n\n @method pushObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n pushObjects: function(objects) {\n if (!(Enumerable.detect(objects) || isArray(objects))) {\n throw new TypeError(\"Must pass Ember.Enumerable to Ember.MutableArray#pushObjects\");\n }\n this.replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n /**\n Pop object from array or nil if none are left. Works just like `pop()` but\n it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.popObject(); // \"blue\"\n console.log(colors); // [\"red\", \"green\"]\n ```\n\n @method popObject\n @return object\n */\n popObject: function() {\n var len = get(this, 'length');\n if (len === 0) return null;\n\n var ret = this.objectAt(len-1);\n this.removeAt(len-1, 1);\n return ret;\n },\n\n /**\n Shift an object from start of array or nil if none are left. Works just\n like `shift()` but it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.shiftObject(); // \"red\"\n console.log(colors); // [\"green\", \"blue\"]\n ```\n\n @method shiftObject\n @return object\n */\n shiftObject: function() {\n if (get(this, 'length') === 0) return null;\n var ret = this.objectAt(0);\n this.removeAt(0);\n return ret;\n },\n\n /**\n Unshift an object to start of array. Works just like `unshift()` but it is\n KVO-compliant.\n\n ```javascript\n var colors = [\"red\"];\n colors.unshiftObject(\"yellow\"); // [\"yellow\", \"red\"]\n colors.unshiftObject([\"black\"]); // [[\"black\"], \"yellow\", \"red\"]\n ```\n\n @method unshiftObject\n @param {*} obj object to unshift\n @return object same object passed as a param\n */\n unshiftObject: function(obj) {\n this.insertAt(0, obj);\n return obj;\n },\n\n /**\n Adds the named objects to the beginning of the array. Defers notifying\n observers until all objects have been added.\n\n ```javascript\n var colors = [\"red\"];\n colors.unshiftObjects([\"black\", \"white\"]); // [\"black\", \"white\", \"red\"]\n colors.unshiftObjects(\"yellow\"); // Type Error: 'undefined' is not a function\n ```\n\n @method unshiftObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n unshiftObjects: function(objects) {\n this.replace(0, 0, objects);\n return this;\n },\n\n /**\n Reverse objects in the array. Works just like `reverse()` but it is\n KVO-compliant.\n\n @method reverseObjects\n @return {Ember.Array} receiver\n */\n reverseObjects: function() {\n var len = get(this, 'length');\n if (len === 0) return this;\n var objects = this.toArray().reverse();\n this.replace(0, len, objects);\n return this;\n },\n\n /**\n Replace all the the receiver's content with content of the argument.\n If argument is an empty array receiver will be cleared.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.setObjects([\"black\", \"white\"]); // [\"black\", \"white\"]\n colors.setObjects([]); // []\n ```\n\n @method setObjects\n @param {Ember.Array} objects array whose content will be used for replacing\n the content of the receiver\n @return {Ember.Array} receiver with the new content\n */\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this.replace(0, len, objects);\n return this;\n },\n\n // ..........................................................\n // IMPLEMENT Ember.MutableEnumerable\n //\n\n /**\n Remove all occurances of an object in the array.\n\n ```javascript\n var cities = [\"Chicago\", \"Berlin\", \"Lima\", \"Chicago\"];\n cities.removeObject(\"Chicago\"); // [\"Berlin\", \"Lima\"]\n cities.removeObject(\"Lima\"); // [\"Berlin\"]\n cities.removeObject(\"Tokyo\") // [\"Berlin\"]\n ```\n\n @method removeObject\n @param {*} obj object to remove\n @return {Ember.Array} receiver\n */\n removeObject: function(obj) {\n var loc = get(this, 'length') || 0;\n while(--loc >= 0) {\n var curObject = this.objectAt(loc);\n if (curObject === obj) this.removeAt(loc);\n }\n return this;\n },\n\n /**\n Push the object onto the end of the array if it is not already\n present in the array.\n\n ```javascript\n var cities = [\"Chicago\", \"Berlin\"];\n cities.addObject(\"Lima\"); // [\"Chicago\", \"Berlin\", \"Lima\"]\n cities.addObject(\"Berlin\"); // [\"Chicago\", \"Berlin\", \"Lima\"]\n ```\n\n @method addObject\n @param {*} obj object to add, if not already present\n @return {Ember.Array} receiver\n */\n addObject: function(obj) {\n if (!this.contains(obj)) this.pushObject(obj);\n return this;\n }\n\n });\n\n __exports__[\"default\"] = MutableArray;\n });\ndefine(\"ember-runtime/mixins/mutable_enumerable\",\n [\"ember-metal/enumerable_utils\",\"ember-runtime/mixins/enumerable\",\"ember-metal/mixin\",\"ember-metal/property_events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {\n \"use strict\";\n var EnumerableUtils = __dependency1__[\"default\"];\n var Enumerable = __dependency2__[\"default\"];\n var Mixin = __dependency3__.Mixin;\n var required = __dependency3__.required;\n var beginPropertyChanges = __dependency4__.beginPropertyChanges;\n var endPropertyChanges = __dependency4__.endPropertyChanges;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var forEach = EnumerableUtils.forEach;\n\n /**\n This mixin defines the API for modifying generic enumerables. These methods\n can be applied to an object regardless of whether it is ordered or\n unordered.\n\n Note that an Enumerable can change even if it does not implement this mixin.\n For example, a MappedEnumerable cannot be directly modified but if its\n underlying enumerable changes, it will change also.\n\n ## Adding Objects\n\n To add an object to an enumerable, use the `addObject()` method. This\n method will only add the object to the enumerable if the object is not\n already present and is of a type supported by the enumerable.\n\n ```javascript\n set.addObject(contact);\n ```\n\n ## Removing Objects\n\n To remove an object from an enumerable, use the `removeObject()` method. This\n will only remove the object if it is present in the enumerable, otherwise\n this method has no effect.\n\n ```javascript\n set.removeObject(contact);\n ```\n\n ## Implementing In Your Own Code\n\n If you are implementing an object and want to support this API, just include\n this mixin in your class and implement the required methods. In your unit\n tests, be sure to apply the Ember.MutableEnumerableTests to your object.\n\n @class MutableEnumerable\n @namespace Ember\n @uses Ember.Enumerable\n */\n var MutableEnumerable = Mixin.create(Enumerable, {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to add the passed object to the receiver if the object is not\n already present in the collection. If the object is present, this method\n has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method addObject\n @param {Object} object The object to add to the enumerable.\n @return {Object} the passed object\n */\n addObject: required(Function),\n\n /**\n Adds each object in the passed enumerable to the receiver.\n\n @method addObjects\n @param {Ember.Enumerable} objects the objects to add.\n @return {Object} receiver\n */\n addObjects: function(objects) {\n beginPropertyChanges(this);\n forEach(objects, function(obj) { this.addObject(obj); }, this);\n endPropertyChanges(this);\n return this;\n },\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to remove the passed object from the receiver collection if the\n object is present in the collection. If the object is not present,\n this method has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method removeObject\n @param {Object} object The object to remove from the enumerable.\n @return {Object} the passed object\n */\n removeObject: required(Function),\n\n\n /**\n Removes each object in the passed enumerable from the receiver.\n\n @method removeObjects\n @param {Ember.Enumerable} objects the objects to remove\n @return {Object} receiver\n */\n removeObjects: function(objects) {\n beginPropertyChanges(this);\n for (var i = objects.length - 1; i >= 0; i--) {\n this.removeObject(objects[i]);\n }\n endPropertyChanges(this);\n return this;\n }\n });\n\n __exports__[\"default\"] = MutableEnumerable;\n });\ndefine(\"ember-runtime/mixins/observable\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/get_properties\",\"ember-metal/set_properties\",\"ember-metal/mixin\",\"ember-metal/events\",\"ember-metal/property_events\",\"ember-metal/observer\",\"ember-metal/computed\",\"ember-metal/is_none\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n\n var get = __dependency2__.get;\n var getWithDefault = __dependency2__.getWithDefault;\n var set = __dependency3__.set;\n var apply = __dependency4__.apply;\n var getProperties = __dependency5__[\"default\"];\n var setProperties = __dependency6__[\"default\"];\n var Mixin = __dependency7__.Mixin;\n var hasListeners = __dependency8__.hasListeners;\n var beginPropertyChanges = __dependency9__.beginPropertyChanges;\n var propertyWillChange = __dependency9__.propertyWillChange;\n var propertyDidChange = __dependency9__.propertyDidChange;\n var endPropertyChanges = __dependency9__.endPropertyChanges;\n var addObserver = __dependency10__.addObserver;\n var addBeforeObserver = __dependency10__.addBeforeObserver;\n var removeObserver = __dependency10__.removeObserver;\n var observersFor = __dependency10__.observersFor;\n var cacheFor = __dependency11__.cacheFor;\n var isNone = __dependency12__.isNone;\n\n\n var slice = Array.prototype.slice;\n /**\n ## Overview\n\n This mixin provides properties and property observing functionality, core\n features of the Ember object model.\n\n Properties and observers allow one object to observe changes to a\n property on another object. This is one of the fundamental ways that\n models, controllers and views communicate with each other in an Ember\n application.\n\n Any object that has this mixin applied can be used in observer\n operations. That includes `Ember.Object` and most objects you will\n interact with as you write your Ember application.\n\n Note that you will not generally apply this mixin to classes yourself,\n but you will use the features provided by this module frequently, so it\n is important to understand how to use it.\n\n ## Using `get()` and `set()`\n\n Because of Ember's support for bindings and observers, you will always\n access properties using the get method, and set properties using the\n set method. This allows the observing objects to be notified and\n computed properties to be handled properly.\n\n More documentation about `get` and `set` are below.\n\n ## Observing Property Changes\n\n You typically observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n Although this is the most common way to add an observer, this capability\n is actually built into the `Ember.Object` class on top of two methods\n defined in this mixin: `addObserver` and `removeObserver`. You can use\n these two methods to add and remove observers yourself if you need to\n do so at runtime.\n\n To add an observer for a property, call:\n\n ```javascript\n object.addObserver('propertyKey', targetObject, targetAction)\n ```\n\n This will call the `targetAction` method on the `targetObject` whenever\n the value of the `propertyKey` changes.\n\n Note that if `propertyKey` is a computed property, the observer will be\n called when any of the property dependencies are changed, even if the\n resulting value of the computed property is unchanged. This is necessary\n because computed properties are not computed until `get` is called.\n\n @class Observable\n @namespace Ember\n */\n var Observable = Mixin.create({\n\n /**\n Retrieves the value of a property from the object.\n\n This method is usually similar to using `object[keyName]` or `object.keyName`,\n however it supports both computed properties and the unknownProperty\n handler.\n\n Because `get` unifies the syntax for accessing all these kinds\n of properties, it can make many refactorings easier, such as replacing a\n simple property with a computed property, or vice versa.\n\n ### Computed Properties\n\n Computed properties are methods defined with the `property` modifier\n declared at the end, such as:\n\n ```javascript\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n }.property('firstName', 'lastName')\n ```\n\n When you call `get` on a computed property, the function will be\n called and the return value will be returned instead of the function\n itself.\n\n ### Unknown Properties\n\n Likewise, if you try to call `get` on a property whose value is\n `undefined`, the `unknownProperty()` method will be called on the object.\n If this method returns any value other than `undefined`, it will be returned\n instead. This allows you to implement \"virtual\" properties that are\n not defined upfront.\n\n @method get\n @param {String} keyName The property to retrieve\n @return {Object} The property value or undefined.\n */\n get: function(keyName) {\n return get(this, keyName);\n },\n\n /**\n To get multiple properties at once, call `getProperties`\n with a list of strings or an array:\n\n ```javascript\n record.getProperties('firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n record.getProperties(['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param {String...|Array} list of keys to get\n @return {Hash}\n */\n getProperties: function() {\n return apply(null, getProperties, [this].concat(slice.call(arguments)));\n },\n\n /**\n Sets the provided key or path to the value.\n\n This method is generally very similar to calling `object[key] = value` or\n `object.key = value`, except that it provides support for computed\n properties, the `setUnknownProperty()` method and property observers.\n\n ### Computed Properties\n\n If you try to set a value on a key that has a computed property handler\n defined (see the `get()` method for an example), then `set()` will call\n that method, passing both the value and key instead of simply changing\n the value itself. This is useful for those times when you need to\n implement a property that is composed of one or more member\n properties.\n\n ### Unknown Properties\n\n If you try to set a value on a key that is undefined in the target\n object, then the `setUnknownProperty()` handler will be called instead. This\n gives you an opportunity to implement complex \"virtual\" properties that\n are not predefined on the object. If `setUnknownProperty()` returns\n undefined, then `set()` will simply set the value on the object.\n\n ### Property Observers\n\n In addition to changing the property, `set()` will also register a property\n change with the object. Unless you have placed this call inside of a\n `beginPropertyChanges()` and `endPropertyChanges(),` any \"local\" observers\n (i.e. observer methods declared on the same object), will be called\n immediately. Any \"remote\" observers (i.e. observer methods declared on\n another object) will be placed in a queue and called at a later time in a\n coalesced manner.\n\n ### Chaining\n\n In addition to property changes, `set()` returns the value of the object\n itself so you can do chaining like this:\n\n ```javascript\n record.set('firstName', 'Charles').set('lastName', 'Jolley');\n ```\n\n @method set\n @param {String} keyName The property to set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n set: function(keyName, value) {\n set(this, keyName, value);\n return this;\n },\n\n\n /**\n Sets a list of properties at once. These properties are set inside\n a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n observers will be buffered.\n\n ```javascript\n record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });\n ```\n\n @method setProperties\n @param {Hash} hash the hash of keys and values to set\n @return {Ember.Observable}\n */\n setProperties: function(hash) {\n return setProperties(this, hash);\n },\n\n /**\n Begins a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call this\n method at the beginning of the changes to begin deferring change\n notifications. When you are done making changes, call\n `endPropertyChanges()` to deliver the deferred change notifications and end\n deferring.\n\n @method beginPropertyChanges\n @return {Ember.Observable}\n */\n beginPropertyChanges: function() {\n beginPropertyChanges();\n return this;\n },\n\n /**\n Ends a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call\n `beginPropertyChanges()` at the beginning of the changes to defer change\n notifications. When you are done making changes, call this method to\n deliver the deferred change notifications and end deferring.\n\n @method endPropertyChanges\n @return {Ember.Observable}\n */\n endPropertyChanges: function() {\n endPropertyChanges();\n return this;\n },\n\n /**\n Notify the observer system that a property is about to change.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyDidChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyWillChange\n @param {String} keyName The property key that is about to change.\n @return {Ember.Observable}\n */\n propertyWillChange: function(keyName) {\n propertyWillChange(this, keyName);\n return this;\n },\n\n /**\n Notify the observer system that a property has just changed.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyWillChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyDidChange\n @param {String} keyName The property key that has just changed.\n @return {Ember.Observable}\n */\n propertyDidChange: function(keyName) {\n propertyDidChange(this, keyName);\n return this;\n },\n\n /**\n Convenience method to call `propertyWillChange` and `propertyDidChange` in\n succession.\n\n @method notifyPropertyChange\n @param {String} keyName The property key to be notified about.\n @return {Ember.Observable}\n */\n notifyPropertyChange: function(keyName) {\n this.propertyWillChange(keyName);\n this.propertyDidChange(keyName);\n return this;\n },\n\n addBeforeObserver: function(key, target, method) {\n addBeforeObserver(this, key, target, method);\n },\n\n /**\n Adds an observer on a property.\n\n This is the core method used to register an observer for a property.\n\n Once you call this method, any time the key's value is set, your observer\n will be notified. Note that the observers are triggered any time the\n value is set, regardless of whether it has actually changed. Your\n observer should be prepared to handle that.\n\n You can also pass an optional context parameter to this method. The\n context will be passed to your observer method whenever it is triggered.\n Note that if you add the same target/method pair on a key multiple times\n with different context parameters, your observer will only be called once\n with the last context you passed.\n\n ### Observer Methods\n\n Observer methods you pass should generally have the following signature if\n you do not pass a `context` parameter:\n\n ```javascript\n fooDidChange: function(sender, key, value, rev) { };\n ```\n\n The sender is the object that changed. The key is the property that\n changes. The value property is currently reserved and unused. The rev\n is the last property revision of the object when it changed, which you can\n use to detect if the key value has really changed or not.\n\n If you pass a `context` parameter, the context will be passed before the\n revision like so:\n\n ```javascript\n fooDidChange: function(sender, key, value, context, rev) { };\n ```\n\n Usually you will not need the value, context or revision parameters at\n the end. In this case, it is common to write observer methods that take\n only a sender and key value as parameters or, if you aren't interested in\n any of these values, to write an observer that has no parameters at all.\n\n @method addObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n */\n addObserver: function(key, target, method) {\n addObserver(this, key, target, method);\n },\n\n /**\n Remove an observer you have previously registered on this object. Pass\n the same key, target, and method you passed to `addObserver()` and your\n target will no longer receive notifications.\n\n @method removeObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n */\n removeObserver: function(key, target, method) {\n removeObserver(this, key, target, method);\n },\n\n /**\n Returns `true` if the object currently has observers registered for a\n particular key. You can use this method to potentially defer performing\n an expensive action until someone begins observing a particular property\n on the object.\n\n @method hasObserverFor\n @param {String} key Key to check\n @return {Boolean}\n */\n hasObserverFor: function(key) {\n return hasListeners(this, key+':change');\n },\n\n /**\n Retrieves the value of a property, or a default value in the case that the\n property returns `undefined`.\n\n ```javascript\n person.getWithDefault('lastName', 'Doe');\n ```\n\n @method getWithDefault\n @param {String} keyName The name of the property to retrieve\n @param {Object} defaultValue The value to return if the property value is undefined\n @return {Object} The property value or the defaultValue.\n */\n getWithDefault: function(keyName, defaultValue) {\n return getWithDefault(this, keyName, defaultValue);\n },\n\n /**\n Set the value of a property to the current value plus some amount.\n\n ```javascript\n person.incrementProperty('age');\n team.incrementProperty('score', 2);\n ```\n\n @method incrementProperty\n @param {String} keyName The name of the property to increment\n @param {Number} increment The amount to increment by. Defaults to 1\n @return {Number} The new property value\n */\n incrementProperty: function(keyName, increment) {\n if (isNone(increment)) { increment = 1; }\n Ember.assert(\"Must pass a numeric value to incrementProperty\", (!isNaN(parseFloat(increment)) && isFinite(increment)));\n set(this, keyName, (parseFloat(get(this, keyName)) || 0) + increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a property to the current value minus some amount.\n\n ```javascript\n player.decrementProperty('lives');\n orc.decrementProperty('health', 5);\n ```\n\n @method decrementProperty\n @param {String} keyName The name of the property to decrement\n @param {Number} decrement The amount to decrement by. Defaults to 1\n @return {Number} The new property value\n */\n decrementProperty: function(keyName, decrement) {\n if (isNone(decrement)) { decrement = 1; }\n Ember.assert(\"Must pass a numeric value to decrementProperty\", (!isNaN(parseFloat(decrement)) && isFinite(decrement)));\n set(this, keyName, (get(this, keyName) || 0) - decrement);\n return get(this, keyName);\n },\n\n /**\n Set the value of a boolean property to the opposite of it's\n current value.\n\n ```javascript\n starship.toggleProperty('warpDriveEngaged');\n ```\n\n @method toggleProperty\n @param {String} keyName The name of the property to toggle\n @return {Object} The new property value\n */\n toggleProperty: function(keyName) {\n set(this, keyName, !get(this, keyName));\n return get(this, keyName);\n },\n\n /**\n Returns the cached value of a computed property, if it exists.\n This allows you to inspect the value of a computed property\n without accidentally invoking it if it is intended to be\n generated lazily.\n\n @method cacheFor\n @param {String} keyName\n @return {Object} The cached value of the computed property, if any\n */\n cacheFor: function(keyName) {\n return cacheFor(this, keyName);\n },\n\n // intended for debugging purposes\n observersForKey: function(keyName) {\n return observersFor(this, keyName);\n }\n });\n\n __exports__[\"default\"] = Observable;\n });\ndefine(\"ember-runtime/mixins/promise_proxy\",\n [\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/computed\",\"ember-metal/mixin\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var set = __dependency2__.set;\n var computed = __dependency3__.computed;\n var Mixin = __dependency4__.Mixin;\n var EmberError = __dependency5__[\"default\"];\n\n var not = computed.not, or = computed.or;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n function tap(proxy, promise) {\n set(proxy, 'isFulfilled', false);\n set(proxy, 'isRejected', false);\n\n return promise.then(function(value) {\n set(proxy, 'isFulfilled', true);\n set(proxy, 'content', value);\n return value;\n }, function(reason) {\n set(proxy, 'isRejected', true);\n set(proxy, 'reason', reason);\n throw reason;\n }, \"Ember: PromiseProxy\");\n }\n\n /**\n A low level mixin making ObjectProxy, ObjectController or ArrayController's promise aware.\n\n ```javascript\n var ObjectPromiseController = Ember.ObjectController.extend(Ember.PromiseProxyMixin);\n\n var controller = ObjectPromiseController.create({\n promise: $.getJSON('/some/remote/data.json')\n });\n\n controller.then(function(json){\n // the json\n }, function(reason) {\n // the reason why you have no json\n });\n ```\n\n the controller has bindable attributes which\n track the promises life cycle\n\n ```javascript\n controller.get('isPending') //=> true\n controller.get('isSettled') //=> false\n controller.get('isRejected') //=> false\n controller.get('isFulfilled') //=> false\n ```\n\n When the the $.getJSON completes, and the promise is fulfilled\n with json, the life cycle attributes will update accordingly.\n\n ```javascript\n controller.get('isPending') //=> false\n controller.get('isSettled') //=> true\n controller.get('isRejected') //=> false\n controller.get('isFulfilled') //=> true\n ```\n\n As the controller is an ObjectController, and the json now its content,\n all the json properties will be available directly from the controller.\n\n ```javascript\n // Assuming the following json:\n {\n firstName: 'Stefan',\n lastName: 'Penner'\n }\n\n // both properties will accessible on the controller\n controller.get('firstName') //=> 'Stefan'\n controller.get('lastName') //=> 'Penner'\n ```\n\n If the controller is backing a template, the attributes are\n bindable from within that template\n\n ```handlebars\n {{#if isPending}}\n loading...\n {{else}}\n firstName: {{firstName}}\n lastName: {{lastName}}\n {{/if}}\n ```\n @class Ember.PromiseProxyMixin\n */\n var PromiseProxyMixin = Mixin.create({\n /**\n If the proxied promise is rejected this will contain the reason\n provided.\n\n @property reason\n @default null\n */\n reason: null,\n\n /**\n Once the proxied promise has settled this will become `false`.\n\n @property isPending\n @default true\n */\n isPending: not('isSettled').readOnly(),\n\n /**\n Once the proxied promise has settled this will become `true`.\n\n @property isSettled\n @default false\n */\n isSettled: or('isRejected', 'isFulfilled').readOnly(),\n\n /**\n Will become `true` if the proxied promise is rejected.\n\n @property isRejected\n @default false\n */\n isRejected: false,\n\n /**\n Will become `true` if the proxied promise is fulfilled.\n\n @property isFullfilled\n @default false\n */\n isFulfilled: false,\n\n /**\n The promise whose fulfillment value is being proxied by this object.\n\n This property must be specified upon creation, and should not be\n changed once created.\n\n Example:\n\n ```javascript\n Ember.ObjectController.extend(Ember.PromiseProxyMixin).create({\n promise: <thenable>\n });\n ```\n\n @property promise\n */\n promise: computed(function(key, promise) {\n if (arguments.length === 2) {\n return tap(this, promise);\n } else {\n throw new EmberError(\"PromiseProxy's promise must be set\");\n }\n }),\n\n /**\n An alias to the proxied promise's `then`.\n\n See RSVP.Promise.then.\n\n @method then\n @param {Function} callback\n @return {RSVP.Promise}\n */\n then: promiseAlias('then'),\n\n /**\n An alias to the proxied promise's `catch`.\n\n See RSVP.Promise.catch.\n\n @method catch\n @param {Function} callback\n @return {RSVP.Promise}\n @since 1.3.0\n */\n 'catch': promiseAlias('catch'),\n\n /**\n An alias to the proxied promise's `finally`.\n\n See RSVP.Promise.finally.\n\n @method finally\n @param {Function} callback\n @return {RSVP.Promise}\n @since 1.3.0\n */\n 'finally': promiseAlias('finally')\n\n });\n\n function promiseAlias(name) {\n return function () {\n var promise = get(this, 'promise');\n return promise[name].apply(promise, arguments);\n };\n }\n\n __exports__[\"default\"] = PromiseProxyMixin;\n });\ndefine(\"ember-runtime/mixins/sortable\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/enumerable_utils\",\"ember-metal/mixin\",\"ember-runtime/mixins/mutable_enumerable\",\"ember-runtime/compare\",\"ember-metal/observer\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.A\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EnumerableUtils = __dependency4__[\"default\"];\n var Mixin = __dependency5__.Mixin;\n var MutableEnumerable = __dependency6__[\"default\"];\n var compare = __dependency7__[\"default\"];\n var addObserver = __dependency8__.addObserver;\n var removeObserver = __dependency8__.removeObserver;\n var computed = __dependency9__.computed;\n var beforeObserver = __dependency5__.beforeObserver;\n var observer = __dependency5__.observer;\n //ES6TODO: should we access these directly from their package or from how thier exposed in ember-metal?\n\n var forEach = EnumerableUtils.forEach;\n\n /**\n `Ember.SortableMixin` provides a standard interface for array proxies\n to specify a sort order and maintain this sorting when objects are added,\n removed, or updated without changing the implicit order of their underlying\n content array:\n\n ```javascript\n songs = [\n {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'},\n {trackNumber: 2, title: 'Back in the U.S.S.R.'},\n {trackNumber: 3, title: 'Glass Onion'},\n ];\n\n songsController = Ember.ArrayController.create({\n content: songs,\n sortProperties: ['trackNumber'],\n sortAscending: true\n });\n\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.addObject({trackNumber: 1, title: 'Dear Prudence'});\n songsController.get('firstObject'); // {trackNumber: 1, title: 'Dear Prudence'}\n ```\n\n If you add or remove the properties to sort by or change the sort direction the content\n sort order will be automatically updated.\n\n ```javascript\n songsController.set('sortProperties', ['title']);\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.toggleProperty('sortAscending');\n songsController.get('firstObject'); // {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'}\n ```\n\n SortableMixin works by sorting the arrangedContent array, which is the array that\n arrayProxy displays. Due to the fact that the underlying 'content' array is not changed, that\n array will not display the sorted list:\n\n ```javascript\n songsController.get('content').get('firstObject'); // Returns the unsorted original content\n songsController.get('firstObject'); // Returns the sorted content.\n ```\n\n Although the sorted content can also be accessed through the arrangedContent property,\n it is preferable to use the proxied class and not the arrangedContent array directly.\n\n @class SortableMixin\n @namespace Ember\n @uses Ember.MutableEnumerable\n */\n var SortableMixin = Mixin.create(MutableEnumerable, {\n\n /**\n Specifies which properties dictate the arrangedContent's sort order.\n\n When specifying multiple properties the sorting will use properties\n from the `sortProperties` array prioritized from first to last.\n\n @property {Array} sortProperties\n */\n sortProperties: null,\n\n /**\n Specifies the arrangedContent's sort direction.\n Sorts the content in ascending order by default. Set to `false` to\n use descending order.\n\n @property {Boolean} sortAscending\n @default true\n */\n sortAscending: true,\n\n /**\n The function used to compare two values. You can override this if you\n want to do custom comparisons. Functions must be of the type expected by\n Array#sort, i.e.\n return 0 if the two parameters are equal,\n return a negative value if the first parameter is smaller than the second or\n return a positive value otherwise:\n\n ```javascript\n function(x,y) { // These are assumed to be integers\n if (x === y)\n return 0;\n return x < y ? -1 : 1;\n }\n ```\n\n @property sortFunction\n @type {Function}\n @default Ember.compare\n */\n sortFunction: compare,\n\n orderBy: function(item1, item2) {\n var result = 0,\n sortProperties = get(this, 'sortProperties'),\n sortAscending = get(this, 'sortAscending'),\n sortFunction = get(this, 'sortFunction');\n\n Ember.assert(\"you need to define `sortProperties`\", !!sortProperties);\n\n forEach(sortProperties, function(propertyName) {\n if (result === 0) {\n result = sortFunction.call(this, get(item1, propertyName), get(item2, propertyName));\n if ((result !== 0) && !sortAscending) {\n result = (-1) * result;\n }\n }\n }, this);\n\n return result;\n },\n\n destroy: function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super();\n },\n\n isSorted: computed.notEmpty('sortProperties'),\n\n /**\n Overrides the default arrangedContent from arrayProxy in order to sort by sortFunction.\n Also sets up observers for each sortProperty on each item in the content Array.\n\n @property arrangedContent\n */\n\n arrangedContent: computed('content', 'sortProperties.@each', function(key, value) {\n var content = get(this, 'content'),\n isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties'),\n self = this;\n\n if (content && isSorted) {\n content = content.slice();\n content.sort(function(item1, item2) {\n return self.orderBy(item1, item2);\n });\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n return Ember.A(content);\n }\n\n return content;\n }),\n\n _contentWillChange: beforeObserver('content', function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n this._super();\n }),\n\n sortPropertiesWillChange: beforeObserver('sortProperties', function() {\n this._lastSortAscending = undefined;\n }),\n\n sortPropertiesDidChange: observer('sortProperties', function() {\n this._lastSortAscending = undefined;\n }),\n\n sortAscendingWillChange: beforeObserver('sortAscending', function() {\n this._lastSortAscending = get(this, 'sortAscending');\n }),\n\n sortAscendingDidChange: observer('sortAscending', function() {\n if (this._lastSortAscending !== undefined && get(this, 'sortAscending') !== this._lastSortAscending) {\n var arrangedContent = get(this, 'arrangedContent');\n arrangedContent.reverseObjects();\n }\n }),\n\n contentArrayWillChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted');\n\n if (isSorted) {\n var arrangedContent = get(this, 'arrangedContent');\n var removedObjects = array.slice(idx, idx+removedCount);\n var sortProperties = get(this, 'sortProperties');\n\n forEach(removedObjects, function(item) {\n arrangedContent.removeObject(item);\n\n forEach(sortProperties, function(sortProperty) {\n removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n contentArrayDidChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties');\n\n if (isSorted) {\n var addedObjects = array.slice(idx, idx+addedCount);\n\n forEach(addedObjects, function(item) {\n this.insertItemSorted(item);\n\n forEach(sortProperties, function(sortProperty) {\n addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n insertItemSorted: function(item) {\n var arrangedContent = get(this, 'arrangedContent');\n var length = get(arrangedContent, 'length');\n\n var idx = this._binarySearch(item, 0, length);\n arrangedContent.insertAt(idx, item);\n },\n\n contentItemSortPropertyDidChange: function(item) {\n var arrangedContent = get(this, 'arrangedContent'),\n oldIndex = arrangedContent.indexOf(item),\n leftItem = arrangedContent.objectAt(oldIndex - 1),\n rightItem = arrangedContent.objectAt(oldIndex + 1),\n leftResult = leftItem && this.orderBy(item, leftItem),\n rightResult = rightItem && this.orderBy(item, rightItem);\n\n if (leftResult < 0 || rightResult > 0) {\n arrangedContent.removeObject(item);\n this.insertItemSorted(item);\n }\n },\n\n _binarySearch: function(item, low, high) {\n var mid, midItem, res, arrangedContent;\n\n if (low === high) {\n return low;\n }\n\n arrangedContent = get(this, 'arrangedContent');\n\n mid = low + Math.floor((high - low) / 2);\n midItem = arrangedContent.objectAt(mid);\n\n res = this.orderBy(midItem, item);\n\n if (res < 0) {\n return this._binarySearch(item, mid+1, high);\n } else if (res > 0) {\n return this._binarySearch(item, low, mid);\n }\n\n return mid;\n }\n });\n\n __exports__[\"default\"] = SortableMixin;\n });\ndefine(\"ember-runtime/mixins/target_action_support\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/mixin\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.lookup, Ember.assert\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var typeOf = __dependency4__.typeOf;\n var Mixin = __dependency5__.Mixin;\n var computed = __dependency6__.computed;\n\n /**\n `Ember.TargetActionSupport` is a mixin that can be included in a class\n to add a `triggerAction` method with semantics similar to the Handlebars\n `{{action}}` helper. In normal Ember usage, the `{{action}}` helper is\n usually the best choice. This mixin is most often useful when you are\n doing more complex event handling in View objects.\n\n See also `Ember.ViewTargetActionSupport`, which has\n view-aware defaults for target and actionContext.\n\n @class TargetActionSupport\n @namespace Ember\n @extends Ember.Mixin\n */\n var TargetActionSupport = Mixin.create({\n target: null,\n action: null,\n actionContext: null,\n\n targetObject: computed(function() {\n var target = get(this, 'target');\n\n if (typeOf(target) === \"string\") {\n var value = get(this, target);\n if (value === undefined) { value = get(Ember.lookup, target); }\n return value;\n } else {\n return target;\n }\n }).property('target'),\n\n actionContextObject: computed(function() {\n var actionContext = get(this, 'actionContext');\n\n if (typeOf(actionContext) === \"string\") {\n var value = get(this, actionContext);\n if (value === undefined) { value = get(Ember.lookup, actionContext); }\n return value;\n } else {\n return actionContext;\n }\n }).property('actionContext'),\n\n /**\n Send an `action` with an `actionContext` to a `target`. The action, actionContext\n and target will be retrieved from properties of the object. For example:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n action: 'save',\n actionContext: Ember.computed.alias('context'),\n click: function() {\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `target`, `action`, and `actionContext` can be provided as properties of\n an optional object argument to `triggerAction` as well.\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n click: function() {\n this.triggerAction({\n action: 'save',\n target: this.get('controller'),\n actionContext: this.get('context'),\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `actionContext` defaults to the object you are mixing `TargetActionSupport` into.\n But `target` and `action` must be specified either as properties or with the argument\n to `triggerAction`, or a combination:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n click: function() {\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with a reference to `this`,\n // to the current controller\n }\n });\n ```\n\n @method triggerAction\n @param opts {Hash} (optional, with the optional keys action, target and/or actionContext)\n @return {Boolean} true if the action was sent successfully and did not return false\n */\n triggerAction: function(opts) {\n opts = opts || {};\n var action = opts.action || get(this, 'action'),\n target = opts.target || get(this, 'targetObject'),\n actionContext = opts.actionContext;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n return ret.concat(options);\n }\n\n if (typeof actionContext === 'undefined') {\n actionContext = get(this, 'actionContextObject') || this;\n }\n\n if (target && action) {\n var ret;\n\n if (target.send) {\n ret = target.send.apply(target, args(actionContext, action));\n } else {\n Ember.assert(\"The action '\" + action + \"' did not exist on \" + target, typeof target[action] === 'function');\n ret = target[action].apply(target, args(actionContext));\n }\n\n if (ret !== false) ret = true;\n\n return ret;\n } else {\n return false;\n }\n }\n });\n\n __exports__[\"default\"] = TargetActionSupport;\n });\ndefine(\"ember-runtime/system/application\",\n [\"ember-runtime/system/namespace\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Namespace = __dependency1__[\"default\"];\n\n var Application = Namespace.extend();\n __exports__[\"default\"] = Application;\n });\ndefine(\"ember-runtime/system/array_proxy\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/computed\",\"ember-metal/mixin\",\"ember-metal/property_events\",\"ember-metal/error\",\"ember-runtime/system/object\",\"ember-runtime/mixins/mutable_array\",\"ember-runtime/mixins/enumerable\",\"ember-runtime/system/string\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.K, Ember.assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var isArray = __dependency4__.isArray;\n var apply = __dependency4__.apply;\n var computed = __dependency5__.computed;\n var beforeObserver = __dependency6__.beforeObserver;\n var observer = __dependency6__.observer;\n var beginPropertyChanges = __dependency7__.beginPropertyChanges;\n var endPropertyChanges = __dependency7__.endPropertyChanges;\n var EmberError = __dependency8__[\"default\"];\n var EmberObject = __dependency9__[\"default\"];var MutableArray = __dependency10__[\"default\"];var Enumerable = __dependency11__[\"default\"];\n var fmt = __dependency12__.fmt;\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var OUT_OF_RANGE_EXCEPTION = \"Index out of range\";\n var EMPTY = [];\n var alias = computed.alias;\n var K = Ember.K;\n\n /**\n An ArrayProxy wraps any other object that implements `Ember.Array` and/or\n `Ember.MutableArray,` forwarding all requests. This makes it very useful for\n a number of binding use cases or other cases where being able to swap\n out the underlying array is useful.\n\n A simple example of usage:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });\n\n ap.get('firstObject'); // 'dog'\n ap.set('content', ['amoeba', 'paramecium']);\n ap.get('firstObject'); // 'amoeba'\n ```\n\n This class can also be useful as a layer to transform the contents of\n an array, as they are accessed. This can be done by overriding\n `objectAtContent`:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({\n content: Ember.A(pets),\n objectAtContent: function(idx) {\n return this.get('content').objectAt(idx).toUpperCase();\n }\n });\n\n ap.get('firstObject'); // . 'DOG'\n ```\n\n @class ArrayProxy\n @namespace Ember\n @extends Ember.Object\n @uses Ember.MutableArray\n */\n var ArrayProxy = EmberObject.extend(MutableArray, {\n\n /**\n The content array. Must be an object that implements `Ember.Array` and/or\n `Ember.MutableArray.`\n\n @property content\n @type Ember.Array\n */\n content: null,\n\n /**\n The array that the proxy pretends to be. In the default `ArrayProxy`\n implementation, this and `content` are the same. Subclasses of `ArrayProxy`\n can override this property to provide things like sorting and filtering.\n\n @property arrangedContent\n */\n arrangedContent: alias('content'),\n\n /**\n Should actually retrieve the object at the specified index from the\n content. You can override this method in subclasses to transform the\n content item to something new.\n\n This method will only be called if content is non-`null`.\n\n @method objectAtContent\n @param {Number} idx The index to retrieve.\n @return {Object} the value or undefined if none found\n */\n objectAtContent: function(idx) {\n return get(this, 'arrangedContent').objectAt(idx);\n },\n\n /**\n Should actually replace the specified objects on the content array.\n You can override this method in subclasses to transform the content item\n into something new.\n\n This method will only be called if content is non-`null`.\n\n @method replaceContent\n @param {Number} idx The starting index\n @param {Number} amt The number of items to remove from the content.\n @param {Array} objects Optional array of objects to insert or null if no\n objects.\n @return {void}\n */\n replaceContent: function(idx, amt, objects) {\n get(this, 'content').replace(idx, amt, objects);\n },\n\n /**\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @private\n @method _contentWillChange\n */\n _contentWillChange: beforeObserver('content', function() {\n this._teardownContent();\n }),\n\n _teardownContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n contentArrayWillChange: K,\n contentArrayDidChange: K,\n\n /**\n Invoked when the content property changes. Notifies observers that the\n entire array content has changed.\n\n @private\n @method _contentDidChange\n */\n _contentDidChange: observer('content', function() {\n var content = get(this, 'content');\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", content !== this);\n\n this._setupContent();\n }),\n\n _setupContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n Ember.assert(fmt('ArrayProxy expects an Array or ' +\n 'Ember.ArrayProxy, but you passed %@', [typeof content]),\n isArray(content) || content.isDestroyed);\n\n content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n _arrangedContentWillChange: beforeObserver('arrangedContent', function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n this.arrangedContentArrayWillChange(this, 0, len, undefined);\n this.arrangedContentWillChange(this);\n\n this._teardownArrangedContent(arrangedContent);\n }),\n\n _arrangedContentDidChange: observer('arrangedContent', function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", arrangedContent !== this);\n\n this._setupArrangedContent();\n\n this.arrangedContentDidChange(this);\n this.arrangedContentArrayDidChange(this, 0, undefined, len);\n }),\n\n _setupArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n Ember.assert(fmt('ArrayProxy expects an Array or ' +\n 'Ember.ArrayProxy, but you passed %@', [typeof arrangedContent]),\n isArray(arrangedContent) || arrangedContent.isDestroyed);\n\n arrangedContent.addArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n _teardownArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.removeArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n arrangedContentWillChange: K,\n arrangedContentDidChange: K,\n\n objectAt: function(idx) {\n return get(this, 'content') && this.objectAtContent(idx);\n },\n\n length: computed(function() {\n var arrangedContent = get(this, 'arrangedContent');\n return arrangedContent ? get(arrangedContent, 'length') : 0;\n // No dependencies since Enumerable notifies length of change\n }),\n\n _replace: function(idx, amt, objects) {\n var content = get(this, 'content');\n Ember.assert('The content property of '+ this.constructor + ' should be set before modifying it', content);\n if (content) this.replaceContent(idx, amt, objects);\n return this;\n },\n\n replace: function() {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n apply(this, this._replace, arguments);\n } else {\n throw new EmberError(\"Using replace on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n _insertAt: function(idx, object) {\n if (idx > get(this, 'content.length')) throw new EmberError(OUT_OF_RANGE_EXCEPTION);\n this._replace(idx, 0, [object]);\n return this;\n },\n\n insertAt: function(idx, object) {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n return this._insertAt(idx, object);\n } else {\n throw new EmberError(\"Using insertAt on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n var content = get(this, 'content'),\n arrangedContent = get(this, 'arrangedContent'),\n indices = [], i;\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new EmberError(OUT_OF_RANGE_EXCEPTION);\n }\n\n if (len === undefined) len = 1;\n\n // Get a list of indices in original content to remove\n for (i=start; i<start+len; i++) {\n // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent\n indices.push(content.indexOf(arrangedContent.objectAt(i)));\n }\n\n // Replace in reverse order since indices will change\n indices.sort(function(a,b) { return b - a; });\n\n beginPropertyChanges();\n for (i=0; i<indices.length; i++) {\n this._replace(indices[i], 1, EMPTY);\n }\n endPropertyChanges();\n }\n\n return this ;\n },\n\n pushObject: function(obj) {\n this._insertAt(get(this, 'content.length'), obj) ;\n return obj ;\n },\n\n pushObjects: function(objects) {\n if (!(Enumerable.detect(objects) || isArray(objects))) {\n throw new TypeError(\"Must pass Ember.Enumerable to Ember.MutableArray#pushObjects\");\n }\n this._replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this._replace(0, len, objects);\n return this;\n },\n\n unshiftObject: function(obj) {\n this._insertAt(0, obj) ;\n return obj ;\n },\n\n unshiftObjects: function(objects) {\n this._replace(0, 0, objects);\n return this;\n },\n\n slice: function() {\n var arr = this.toArray();\n return arr.slice.apply(arr, arguments);\n },\n\n arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentWillChange(idx, removedCnt, addedCnt);\n },\n\n arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentDidChange(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n this._setupContent();\n this._setupArrangedContent();\n },\n\n willDestroy: function() {\n this._teardownArrangedContent();\n this._teardownContent();\n }\n });\n\n __exports__[\"default\"] = ArrayProxy;\n });\ndefine(\"ember-runtime/system/container\",\n [\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var set = __dependency1__[\"default\"];\n\n var Container = requireModule('container')[\"default\"];\n Container.set = set;\n\n __exports__[\"default\"] = Container;\n });\ndefine(\"ember-runtime/system/core_object\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/platform\",\"ember-metal/watching\",\"ember-metal/chains\",\"ember-metal/events\",\"ember-metal/mixin\",\"ember-metal/enumerable_utils\",\"ember-metal/error\",\"ember-runtime/keys\",\"ember-runtime/mixins/action_handler\",\"ember-metal/properties\",\"ember-metal/binding\",\"ember-metal/computed\",\"ember-metal/run_loop\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.ENV.MANDATORY_SETTER, Ember.assert, Ember.K, Ember.config\n\n // NOTE: this object should never be included directly. Instead use `Ember.Object`.\n // We only define this separately so that `Ember.Set` can depend on it.\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n var apply = __dependency4__.apply;\n var create = __dependency5__.create;\n var generateGuid = __dependency4__.generateGuid;\n var GUID_KEY = __dependency4__.GUID_KEY;\n var meta = __dependency4__.meta;\n var META_KEY = __dependency4__.META_KEY;\n var makeArray = __dependency4__.makeArray;\n var rewatch = __dependency6__.rewatch;\n var finishChains = __dependency7__.finishChains;\n var sendEvent = __dependency8__.sendEvent;\n var IS_BINDING = __dependency9__.IS_BINDING;\n var Mixin = __dependency9__.Mixin;\n var required = __dependency9__.required;\n var EnumerableUtils = __dependency10__[\"default\"];\n var EmberError = __dependency11__[\"default\"];\n var platform = __dependency5__.platform;\n var keys = __dependency12__[\"default\"];\n var ActionHandler = __dependency13__[\"default\"];\n var defineProperty = __dependency14__.defineProperty;\n var Binding = __dependency15__.Binding;\n var ComputedProperty = __dependency16__.ComputedProperty;\n var run = __dependency17__[\"default\"];\n var destroy = __dependency6__.destroy;\n\n\n var o_create = create,\n o_defineProperty = platform.defineProperty,\n schedule = run.schedule,\n applyMixin = Mixin._apply,\n finishPartial = Mixin.finishPartial,\n reopen = Mixin.prototype.reopen,\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n indexOf = EnumerableUtils.indexOf,\n K = Ember.K;\n\n var undefinedDescriptor = {\n configurable: true,\n writable: true,\n enumerable: false,\n value: undefined\n };\n\n var nullDescriptor = {\n configurable: true,\n writable: true,\n enumerable: false,\n value: null\n };\n\n function makeCtor() {\n\n // Note: avoid accessing any properties on the object since it makes the\n // method a lot faster. This is glue code so we want it to be as fast as\n // possible.\n\n var wasApplied = false, initMixins, initProperties;\n\n var Class = function() {\n if (!wasApplied) {\n Class.proto(); // prepare prototype...\n }\n o_defineProperty(this, GUID_KEY, nullDescriptor);\n o_defineProperty(this, '__nextSuper', undefinedDescriptor);\n var m = meta(this), proto = m.proto;\n m.proto = this;\n if (initMixins) {\n // capture locally so we can clear the closed over variable\n var mixins = initMixins;\n initMixins = null;\n apply(this, this.reopen, mixins);\n }\n if (initProperties) {\n // capture locally so we can clear the closed over variable\n var props = initProperties;\n initProperties = null;\n\n var concatenatedProperties = this.concatenatedProperties;\n\n for (var i = 0, l = props.length; i < l; i++) {\n var properties = props[i];\n\n Ember.assert(\"Ember.Object.create no longer supports mixing in other definitions, use createWithMixins instead.\", !(properties instanceof Mixin));\n\n if (typeof properties !== 'object' && properties !== undefined) {\n throw new EmberError(\"Ember.Object.create only accepts objects.\");\n }\n\n if (!properties) { continue; }\n\n var keyNames = keys(properties);\n\n for (var j = 0, ll = keyNames.length; j < ll; j++) {\n var keyName = keyNames[j];\n if (!properties.hasOwnProperty(keyName)) { continue; }\n\n var value = properties[keyName];\n\n if (IS_BINDING.test(keyName)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[keyName] = value;\n }\n\n var desc = m.descs[keyName];\n\n Ember.assert(\"Ember.Object.create no longer supports defining computed properties. Define computed properties using extend() or reopen() before calling create().\", !(value instanceof ComputedProperty));\n Ember.assert(\"Ember.Object.create no longer supports defining methods that call _super.\", !(typeof value === 'function' && value.toString().indexOf('._super') !== -1));\n Ember.assert(\"`actions` must be provided at extend time, not at create \" +\n \"time, when Ember.ActionHandler is used (i.e. views, \" +\n \"controllers & routes).\", !((keyName === 'actions') && ActionHandler.detect(this)));\n\n if (concatenatedProperties && indexOf(concatenatedProperties, keyName) >= 0) {\n var baseValue = this[keyName];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n value = baseValue.concat(value);\n } else {\n value = makeArray(baseValue).concat(value);\n }\n } else {\n value = makeArray(value);\n }\n }\n\n if (desc) {\n desc.set(this, keyName, value);\n } else {\n if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) {\n this.setUnknownProperty(keyName, value);\n } else if (MANDATORY_SETTER) {\n defineProperty(this, keyName, null, value); // setup mandatory setter\n } else {\n this[keyName] = value;\n }\n }\n }\n }\n }\n finishPartial(this, m);\n apply(this, this.init, arguments);\n m.proto = proto;\n finishChains(this);\n sendEvent(this, \"init\");\n };\n\n Class.toString = Mixin.prototype.toString;\n Class.willReopen = function() {\n if (wasApplied) {\n Class.PrototypeMixin = Mixin.create(Class.PrototypeMixin);\n }\n\n wasApplied = false;\n };\n Class._initMixins = function(args) { initMixins = args; };\n Class._initProperties = function(args) { initProperties = args; };\n\n Class.proto = function() {\n var superclass = Class.superclass;\n if (superclass) { superclass.proto(); }\n\n if (!wasApplied) {\n wasApplied = true;\n Class.PrototypeMixin.applyPartial(Class.prototype);\n rewatch(Class.prototype);\n }\n\n return this.prototype;\n };\n\n return Class;\n\n }\n\n /**\n @class CoreObject\n @namespace Ember\n */\n var CoreObject = makeCtor();\n CoreObject.toString = function() { return \"Ember.CoreObject\"; };\n\n CoreObject.PrototypeMixin = Mixin.create({\n reopen: function() {\n applyMixin(this, arguments, true);\n return this;\n },\n\n /**\n An overridable method called when objects are instantiated. By default,\n does nothing unless it is overridden during class definition.\n\n Example:\n\n ```javascript\n App.Person = Ember.Object.extend({\n init: function() {\n alert('Name is ' + this.get('name'));\n }\n });\n\n var steve = App.Person.create({\n name: \"Steve\"\n });\n\n // alerts 'Name is Steve'.\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n @method init\n */\n init: function() {},\n\n /**\n Defines the properties that will be concatenated from the superclass\n (instead of overridden).\n\n By default, when you extend an Ember class a property defined in\n the subclass overrides a property with the same name that is defined\n in the superclass. However, there are some cases where it is preferable\n to build up a property's value by combining the superclass' property\n value with the subclass' value. An example of this in use within Ember\n is the `classNames` property of `Ember.View`.\n\n Here is some sample code showing the difference between a concatenated\n property and a normal one:\n\n ```javascript\n App.BarView = Ember.View.extend({\n someNonConcatenatedProperty: ['bar'],\n classNames: ['bar']\n });\n\n App.FooBarView = App.BarView.extend({\n someNonConcatenatedProperty: ['foo'],\n classNames: ['foo'],\n });\n\n var fooBarView = App.FooBarView.create();\n fooBarView.get('someNonConcatenatedProperty'); // ['foo']\n fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']\n ```\n\n This behavior extends to object creation as well. Continuing the\n above example:\n\n ```javascript\n var view = App.FooBarView.create({\n someNonConcatenatedProperty: ['baz'],\n classNames: ['baz']\n })\n view.get('someNonConcatenatedProperty'); // ['baz']\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n Adding a single property that is not an array will just add it in the array:\n\n ```javascript\n var view = App.FooBarView.create({\n classNames: 'baz'\n })\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n\n Using the `concatenatedProperties` property, we can tell to Ember that mix\n the content of the properties.\n\n In `Ember.View` the `classNameBindings` and `attributeBindings` properties\n are also concatenated, in addition to `classNames`.\n\n This feature is available for you to use throughout the Ember object model,\n although typical app developers are likely to use it infrequently. Since\n it changes expectations about behavior of properties, you should properly\n document its usage in each individual concatenated property (to not\n mislead your users to think they can override the property in a subclass).\n\n @property concatenatedProperties\n @type Array\n @default null\n */\n concatenatedProperties: null,\n\n /**\n Destroyed object property flag.\n\n if this property is `true` the observers and bindings were already\n removed by the effect of calling the `destroy()` method.\n\n @property isDestroyed\n @default false\n */\n isDestroyed: false,\n\n /**\n Destruction scheduled flag. The `destroy()` method has been called.\n\n The object stays intact until the end of the run loop at which point\n the `isDestroyed` flag is set.\n\n @property isDestroying\n @default false\n */\n isDestroying: false,\n\n /**\n Destroys an object by setting the `isDestroyed` flag and removing its\n metadata, which effectively destroys observers and bindings.\n\n If you try to set a property on a destroyed object, an exception will be\n raised.\n\n Note that destruction is scheduled for the end of the run loop and does not\n happen immediately. It will set an isDestroying flag immediately.\n\n @method destroy\n @return {Ember.Object} receiver\n */\n destroy: function() {\n if (this.isDestroying) { return; }\n this.isDestroying = true;\n\n schedule('actions', this, this.willDestroy);\n schedule('destroy', this, this._scheduledDestroy);\n return this;\n },\n\n /**\n Override to implement teardown.\n\n @method willDestroy\n */\n willDestroy: K,\n\n /**\n Invoked by the run loop to actually destroy the object. This is\n scheduled for execution by the `destroy` method.\n\n @private\n @method _scheduledDestroy\n */\n _scheduledDestroy: function() {\n if (this.isDestroyed) { return; }\n destroy(this);\n this.isDestroyed = true;\n },\n\n bind: function(to, from) {\n if (!(from instanceof Binding)) { from = Binding.from(from); }\n from.to(to).connect(this);\n return from;\n },\n\n /**\n Returns a string representation which attempts to provide more information\n than Javascript's `toString` typically does, in a generic way for all Ember\n objects.\n\n ```javascript\n App.Person = Em.Object.extend()\n person = App.Person.create()\n person.toString() //=> \"<App.Person:ember1024>\"\n ```\n\n If the object's class is not defined on an Ember namespace, it will\n indicate it is a subclass of the registered superclass:\n\n ```javascript\n Student = App.Person.extend()\n student = Student.create()\n student.toString() //=> \"<(subclass of App.Person):ember1025>\"\n ```\n\n If the method `toStringExtension` is defined, its return value will be\n included in the output.\n\n ```javascript\n App.Teacher = App.Person.extend({\n toStringExtension: function() {\n return this.get('fullName');\n }\n });\n teacher = App.Teacher.create()\n teacher.toString(); //=> \"<App.Teacher:ember1026:Tom Dale>\"\n ```\n\n @method toString\n @return {String} string representation\n */\n toString: function toString() {\n var hasToStringExtension = typeof this.toStringExtension === 'function',\n extension = hasToStringExtension ? \":\" + this.toStringExtension() : '';\n var ret = '<'+this.constructor.toString()+':'+guidFor(this)+extension+'>';\n this.toString = makeToString(ret);\n return ret;\n }\n });\n\n CoreObject.PrototypeMixin.ownerConstructor = CoreObject;\n\n function makeToString(ret) {\n return function() { return ret; };\n }\n\n if (Ember.config.overridePrototypeMixin) {\n Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);\n }\n\n CoreObject.__super__ = null;\n\n var ClassMixin = Mixin.create({\n\n ClassMixin: required(),\n\n PrototypeMixin: required(),\n\n isClass: true,\n\n isMethod: false,\n\n /**\n Creates a new subclass.\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n alert(thing);\n }\n });\n ```\n\n This defines a new subclass of Ember.Object: `App.Person`. It contains one method: `say()`.\n\n You can also create a subclass from any existing class by calling its `extend()` method. For example, you might want to create a subclass of Ember's built-in `Ember.View` class:\n\n ```javascript\n App.PersonView = Ember.View.extend({\n tagName: 'li',\n classNameBindings: ['isAdministrator']\n });\n ```\n\n When defining a subclass, you can override methods but still access the implementation of your parent class by calling the special `_super()` method:\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n var name = this.get('name');\n alert(name + ' says: ' + thing);\n }\n });\n\n App.Soldier = App.Person.extend({\n say: function(thing) {\n this._super(thing + \", sir!\");\n },\n march: function(numberOfHours) {\n alert(this.get('name') + ' marches for ' + numberOfHours + ' hours.')\n }\n });\n\n var yehuda = App.Soldier.create({\n name: \"Yehuda Katz\"\n });\n\n yehuda.say(\"Yes\"); // alerts \"Yehuda Katz says: Yes, sir!\"\n ```\n\n The `create()` on line #17 creates an *instance* of the `App.Soldier` class. The `extend()` on line #8 creates a *subclass* of `App.Person`. Any instance of the `App.Person` class will *not* have the `march()` method.\n\n You can also pass `Mixin` classes to add additional properties to the subclass.\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n alert(this.get('name') + ' says: ' + thing);\n }\n });\n\n App.SingingMixin = Mixin.create({\n sing: function(thing){\n alert(this.get('name') + ' sings: la la la ' + thing);\n }\n });\n\n App.BroadwayStar = App.Person.extend(App.SingingMixin, {\n dance: function() {\n alert(this.get('name') + ' dances: tap tap tap tap ');\n }\n });\n ```\n\n The `App.BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`.\n\n @method extend\n @static\n\n @param {Mixin} [mixins]* One or more Mixin classes\n @param {Object} [arguments]* Object containing values to use within the new class\n */\n extend: function() {\n var Class = makeCtor(), proto;\n Class.ClassMixin = Mixin.create(this.ClassMixin);\n Class.PrototypeMixin = Mixin.create(this.PrototypeMixin);\n\n Class.ClassMixin.ownerConstructor = Class;\n Class.PrototypeMixin.ownerConstructor = Class;\n\n reopen.apply(Class.PrototypeMixin, arguments);\n\n Class.superclass = this;\n Class.__super__ = this.prototype;\n\n proto = Class.prototype = o_create(this.prototype);\n proto.constructor = Class;\n generateGuid(proto);\n meta(proto).proto = proto; // this will disable observers on prototype\n\n Class.ClassMixin.apply(Class);\n return Class;\n },\n\n /**\n Equivalent to doing `extend(arguments).create()`.\n If possible use the normal `create` method instead.\n\n @method createWithMixins\n @static\n @param [arguments]*\n */\n createWithMixins: function() {\n var C = this;\n if (arguments.length>0) { this._initMixins(arguments); }\n return new C();\n },\n\n /**\n Creates an instance of a class. Accepts either no arguments, or an object\n containing values to initialize the newly instantiated object with.\n\n ```javascript\n App.Person = Ember.Object.extend({\n helloWorld: function() {\n alert(\"Hi, my name is \" + this.get('name'));\n }\n });\n\n var tom = App.Person.create({\n name: 'Tom Dale'\n });\n\n tom.helloWorld(); // alerts \"Hi, my name is Tom Dale\".\n ```\n\n `create` will call the `init` function if defined during\n `Ember.AnyObject.extend`\n\n If no arguments are passed to `create`, it will not set values to the new\n instance during initialization:\n\n ```javascript\n var noName = App.Person.create();\n noName.helloWorld(); // alerts undefined\n ```\n\n NOTE: For performance reasons, you cannot declare methods or computed\n properties during `create`. You should instead declare methods and computed\n properties when using `extend` or use the `createWithMixins` shorthand.\n\n @method create\n @static\n @param [arguments]*\n */\n create: function() {\n var C = this;\n if (arguments.length>0) { this._initProperties(arguments); }\n return new C();\n },\n\n /**\n Augments a constructor's prototype with additional\n properties and functions:\n\n ```javascript\n MyObject = Ember.Object.extend({\n name: 'an object'\n });\n\n o = MyObject.create();\n o.get('name'); // 'an object'\n\n MyObject.reopen({\n say: function(msg){\n console.log(msg);\n }\n })\n\n o2 = MyObject.create();\n o2.say(\"hello\"); // logs \"hello\"\n\n o.say(\"goodbye\"); // logs \"goodbye\"\n ```\n\n To add functions and properties to the constructor itself,\n see `reopenClass`\n\n @method reopen\n */\n reopen: function() {\n this.willReopen();\n apply(this.PrototypeMixin, reopen, arguments);\n return this;\n },\n\n /**\n Augments a constructor's own properties and functions:\n\n ```javascript\n MyObject = Ember.Object.extend({\n name: 'an object'\n });\n\n MyObject.reopenClass({\n canBuild: false\n });\n\n MyObject.canBuild; // false\n o = MyObject.create();\n ```\n\n In other words, this creates static properties and functions for the class. These are only available on the class\n and not on any instance of that class.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name : \"\",\n sayHello : function(){\n alert(\"Hello. My name is \" + this.get('name'));\n }\n });\n\n App.Person.reopenClass({\n species : \"Homo sapiens\",\n createPerson: function(newPersonsName){\n return App.Person.create({\n name:newPersonsName\n });\n }\n });\n\n var tom = App.Person.create({\n name : \"Tom Dale\"\n });\n var yehuda = App.Person.createPerson(\"Yehuda Katz\");\n\n tom.sayHello(); // \"Hello. My name is Tom Dale\"\n yehuda.sayHello(); // \"Hello. My name is Yehuda Katz\"\n alert(App.Person.species); // \"Homo sapiens\"\n ```\n\n Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda`\n variables. They are only valid on `App.Person`.\n\n To add functions and properties to instances of\n a constructor by extending the constructor's prototype\n see `reopen`\n\n @method reopenClass\n */\n reopenClass: function() {\n apply(this.ClassMixin, reopen, arguments);\n applyMixin(this, arguments, false);\n return this;\n },\n\n detect: function(obj) {\n if ('function' !== typeof obj) { return false; }\n while(obj) {\n if (obj===this) { return true; }\n obj = obj.superclass;\n }\n return false;\n },\n\n detectInstance: function(obj) {\n return obj instanceof this;\n },\n\n /**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For\n example, computed property functions may close over variables that are then\n no longer available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```javascript\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n Once you've done this, you can retrieve the values saved to the computed\n property from your class like this:\n\n ```javascript\n MyClass.metaForProperty('person');\n ```\n\n This will return the original hash that was passed to `meta()`.\n\n @method metaForProperty\n @param key {String} property name\n */\n metaForProperty: function(key) {\n var meta = this.proto()[META_KEY],\n desc = meta && meta.descs[key];\n\n Ember.assert(\"metaForProperty() could not find a computed property with key '\"+key+\"'.\", !!desc && desc instanceof ComputedProperty);\n return desc._meta || {};\n },\n\n /**\n Iterate over each computed property for the class, passing its name\n and any associated metadata (see `metaForProperty`) to the callback.\n\n @method eachComputedProperty\n @param {Function} callback\n @param {Object} binding\n */\n eachComputedProperty: function(callback, binding) {\n var proto = this.proto(),\n descs = meta(proto).descs,\n empty = {},\n property;\n\n for (var name in descs) {\n property = descs[name];\n\n if (property instanceof ComputedProperty) {\n callback.call(binding || this, name, property._meta || empty);\n }\n }\n }\n\n });\n\n ClassMixin.ownerConstructor = CoreObject;\n\n if (Ember.config.overrideClassMixin) {\n Ember.config.overrideClassMixin(ClassMixin);\n }\n\n CoreObject.ClassMixin = ClassMixin;\n ClassMixin.apply(CoreObject);\n\n __exports__[\"default\"] = CoreObject;\n });\ndefine(\"ember-runtime/system/deferred\",\n [\"ember-runtime/mixins/deferred\",\"ember-metal/property_get\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var DeferredMixin = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var EmberObject = __dependency3__[\"default\"];\n\n var Deferred = EmberObject.extend(DeferredMixin);\n\n Deferred.reopenClass({\n promise: function(callback, binding) {\n var deferred = Deferred.create();\n callback.call(binding, deferred);\n return deferred;\n }\n });\n\n __exports__[\"default\"] = Deferred;\n });\ndefine(\"ember-runtime/system/each_proxy\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/enumerable_utils\",\"ember-metal/array\",\"ember-runtime/mixins/array\",\"ember-runtime/system/object\",\"ember-metal/computed\",\"ember-metal/observer\",\"ember-metal/events\",\"ember-metal/properties\",\"ember-metal/property_events\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n var EnumerableUtils = __dependency5__[\"default\"];\n var indexOf = __dependency6__.indexOf;\n var EmberArray = __dependency7__[\"default\"];\n // ES6TODO: WAT? Circular dep?\n var EmberObject = __dependency8__[\"default\"];\n var computed = __dependency9__.computed;\n var addObserver = __dependency10__.addObserver;\n var addBeforeObserver = __dependency10__.addBeforeObserver;\n var removeBeforeObserver = __dependency10__.removeBeforeObserver;\n var removeObserver = __dependency10__.removeObserver;\n var typeOf = __dependency4__.typeOf;\n var watchedEvents = __dependency11__.watchedEvents;\n var defineProperty = __dependency12__.defineProperty;\n var beginPropertyChanges = __dependency13__.beginPropertyChanges;\n var propertyDidChange = __dependency13__.propertyDidChange;\n var propertyWillChange = __dependency13__.propertyWillChange;\n var endPropertyChanges = __dependency13__.endPropertyChanges;\n var changeProperties = __dependency13__.changeProperties;\n\n var forEach = EnumerableUtils.forEach;\n\n var EachArray = EmberObject.extend(EmberArray, {\n\n init: function(content, keyName, owner) {\n this._super();\n this._keyName = keyName;\n this._owner = owner;\n this._content = content;\n },\n\n objectAt: function(idx) {\n var item = this._content.objectAt(idx);\n return item && get(item, this._keyName);\n },\n\n length: computed(function() {\n var content = this._content;\n return content ? get(content, 'length') : 0;\n })\n\n });\n\n var IS_OBSERVER = /^.+:(before|change)$/;\n\n function addObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects, guid;\n if (!objects) objects = proxy._objects = {};\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.assert('When using @each to observe the array ' + content + ', the array must return an object', typeOf(item) === 'instance' || typeOf(item) === 'object');\n addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n addObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n // keep track of the index each item was found at so we can map\n // it back when the obj changes.\n guid = guidFor(item);\n if (!objects[guid]) objects[guid] = [];\n objects[guid].push(loc);\n }\n }\n }\n\n function removeObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects;\n if (!objects) objects = proxy._objects = {};\n var indicies, guid;\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n removeObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n guid = guidFor(item);\n indicies = objects[guid];\n indicies[indexOf.call(indicies, loc)] = null;\n }\n }\n }\n\n /**\n This is the object instance returned when you get the `@each` property on an\n array. It uses the unknownProperty handler to automatically create\n EachArray instances for property names.\n\n @private\n @class EachProxy\n @namespace Ember\n @extends Ember.Object\n */\n var EachProxy = EmberObject.extend({\n\n init: function(content) {\n this._super();\n this._content = content;\n content.addArrayObserver(this);\n\n // in case someone is already observing some keys make sure they are\n // added\n forEach(watchedEvents(this), function(eventName) {\n this.didAddListener(eventName);\n }, this);\n },\n\n /**\n You can directly access mapped properties by simply requesting them.\n The `unknownProperty` handler will generate an EachArray of each item.\n\n @method unknownProperty\n @param keyName {String}\n @param value {*}\n */\n unknownProperty: function(keyName, value) {\n var ret;\n ret = new EachArray(this._content, keyName, this);\n defineProperty(this, keyName, null, ret);\n this.beginObservingContentKey(keyName);\n return ret;\n },\n\n // ..........................................................\n // ARRAY CHANGES\n // Invokes whenever the content array itself changes.\n\n arrayWillChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = removedCnt>0 ? idx+removedCnt : -1;\n beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) { removeObserverForContentKey(content, key, this, idx, lim); }\n\n propertyWillChange(this, key);\n }\n\n propertyWillChange(this._content, '@each');\n endPropertyChanges(this);\n },\n\n arrayDidChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, lim;\n\n lim = addedCnt>0 ? idx+addedCnt : -1;\n changeProperties(function() {\n for(var key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) { addObserverForContentKey(content, key, this, idx, lim); }\n\n propertyDidChange(this, key);\n }\n\n propertyDidChange(this._content, '@each');\n }, this);\n },\n\n // ..........................................................\n // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS\n // Start monitoring keys based on who is listening...\n\n didAddListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.beginObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n didRemoveListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.stopObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n // ..........................................................\n // CONTENT KEY OBSERVING\n // Actual watch keys on the source content.\n\n beginObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (!keys) keys = this._keys = {};\n if (!keys[keyName]) {\n keys[keyName] = 1;\n var content = this._content,\n len = get(content, 'length');\n addObserverForContentKey(content, keyName, this, 0, len);\n } else {\n keys[keyName]++;\n }\n },\n\n stopObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {\n var content = this._content,\n len = get(content, 'length');\n removeObserverForContentKey(content, keyName, this, 0, len);\n }\n },\n\n contentKeyWillChange: function(obj, keyName) {\n propertyWillChange(this, keyName);\n },\n\n contentKeyDidChange: function(obj, keyName) {\n propertyDidChange(this, keyName);\n }\n\n });\n\n __exports__.EachArray = EachArray;\n __exports__.EachProxy = EachProxy;\n });\ndefine(\"ember-runtime/system/lazy_load\",\n [\"ember-metal/core\",\"ember-metal/array\",\"ember-runtime/system/native_array\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n /*globals CustomEvent */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.ENV.EMBER_LOAD_HOOKS\n var forEach = __dependency2__.forEach;\n // make sure Ember.A is setup.\n\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var loadHooks = Ember.ENV.EMBER_LOAD_HOOKS || {};\n var loaded = {};\n\n /**\n Detects when a specific package of Ember (e.g. 'Ember.Handlebars')\n has fully loaded and is available for extension.\n\n The provided `callback` will be called with the `name` passed\n resolved from a string into the object:\n\n ``` javascript\n Ember.onLoad('Ember.Handlebars' function(hbars) {\n hbars.registerHelper(...);\n });\n ```\n\n @method onLoad\n @for Ember\n @param name {String} name of hook\n @param callback {Function} callback to be called\n */\n function onLoad(name, callback) {\n var object;\n\n loadHooks[name] = loadHooks[name] || Ember.A();\n loadHooks[name].pushObject(callback);\n\n if (object = loaded[name]) {\n callback(object);\n }\n };\n\n /**\n Called when an Ember.js package (e.g Ember.Handlebars) has finished\n loading. Triggers any callbacks registered for this event.\n\n @method runLoadHooks\n @for Ember\n @param name {String} name of hook\n @param object {Object} object to pass to callbacks\n */\n function runLoadHooks(name, object) {\n loaded[name] = object;\n\n if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === \"function\") {\n var event = new CustomEvent(name, {detail: object, name: name});\n window.dispatchEvent(event);\n }\n\n if (loadHooks[name]) {\n forEach.call(loadHooks[name], function(callback) {\n callback(object);\n });\n }\n };\n\n __exports__.onLoad = onLoad;\n __exports__.runLoadHooks = runLoadHooks;\n });\ndefine(\"ember-runtime/system/namespace\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/array\",\"ember-metal/utils\",\"ember-metal/mixin\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n // Ember.lookup, Ember.BOOTED, Ember.deprecate, Ember.NAME_KEY, Ember.anyUnprocessedMixins\n var Ember = __dependency1__[\"default\"];\n var get = __dependency2__.get;\n var indexOf = __dependency3__.indexOf;\n var GUID_KEY = __dependency4__.GUID_KEY;\n var guidFor = __dependency4__.guidFor;\n var Mixin = __dependency5__.Mixin;\n\n var EmberObject = __dependency6__[\"default\"];\n\n /**\n A Namespace is an object usually used to contain other objects or methods\n such as an application or framework. Create a namespace anytime you want\n to define one of these new containers.\n\n # Example Usage\n\n ```javascript\n MyFramework = Ember.Namespace.create({\n VERSION: '1.0.0'\n });\n ```\n\n @class Namespace\n @namespace Ember\n @extends Ember.Object\n */\n var Namespace = EmberObject.extend({\n isNamespace: true,\n\n init: function() {\n Namespace.NAMESPACES.push(this);\n Namespace.PROCESSED = false;\n },\n\n toString: function() {\n var name = get(this, 'name');\n if (name) { return name; }\n\n findNamespaces();\n return this[NAME_KEY];\n },\n\n nameClasses: function() {\n processNamespace([this.toString()], this, {});\n },\n\n destroy: function() {\n var namespaces = Namespace.NAMESPACES,\n toString = this.toString();\n\n if (toString) {\n Ember.lookup[toString] = undefined;\n delete Namespace.NAMESPACES_BY_ID[toString];\n }\n namespaces.splice(indexOf.call(namespaces, this), 1);\n this._super();\n }\n });\n\n Namespace.reopenClass({\n NAMESPACES: [Ember],\n NAMESPACES_BY_ID: {},\n PROCESSED: false,\n processAll: processAllNamespaces,\n byName: function(name) {\n if (!Ember.BOOTED) {\n processAllNamespaces();\n }\n\n return NAMESPACES_BY_ID[name];\n }\n });\n\n var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;\n\n var hasOwnProp = ({}).hasOwnProperty;\n\n function processNamespace(paths, root, seen) {\n var idx = paths.length;\n\n NAMESPACES_BY_ID[paths.join('.')] = root;\n\n // Loop over all of the keys in the namespace, looking for classes\n for(var key in root) {\n if (!hasOwnProp.call(root, key)) { continue; }\n var obj = root[key];\n\n // If we are processing the `Ember` namespace, for example, the\n // `paths` will start with `[\"Ember\"]`. Every iteration through\n // the loop will update the **second** element of this list with\n // the key, so processing `Ember.View` will make the Array\n // `['Ember', 'View']`.\n paths[idx] = key;\n\n // If we have found an unprocessed class\n if (obj && obj.toString === classToString) {\n // Replace the class' `toString` with the dot-separated path\n // and set its `NAME_KEY`\n obj.toString = makeToString(paths.join('.'));\n obj[NAME_KEY] = paths.join('.');\n\n // Support nested namespaces\n } else if (obj && obj.isNamespace) {\n // Skip aliased namespaces\n if (seen[guidFor(obj)]) { continue; }\n seen[guidFor(obj)] = true;\n\n // Process the child namespace\n processNamespace(paths, obj, seen);\n }\n }\n\n paths.length = idx; // cut out last item\n }\n\n var STARTS_WITH_UPPERCASE = /^[A-Z]/;\n\n function findNamespaces() {\n var lookup = Ember.lookup, obj, isNamespace;\n\n if (Namespace.PROCESSED) { return; }\n\n for (var prop in lookup) {\n // Only process entities that start with uppercase A-Z\n if (!STARTS_WITH_UPPERCASE.test(prop)) { continue; }\n\n // Unfortunately, some versions of IE don't support window.hasOwnProperty\n if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }\n\n // At times we are not allowed to access certain properties for security reasons.\n // There are also times where even if we can access them, we are not allowed to access their properties.\n try {\n obj = lookup[prop];\n isNamespace = obj && obj.isNamespace;\n } catch (e) {\n continue;\n }\n\n if (isNamespace) {\n obj[NAME_KEY] = prop;\n }\n }\n }\n\n var NAME_KEY = Ember.NAME_KEY = GUID_KEY + '_name';\n\n function superClassString(mixin) {\n var superclass = mixin.superclass;\n if (superclass) {\n if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }\n else { return superClassString(superclass); }\n } else {\n return;\n }\n }\n\n function classToString() {\n if (!Ember.BOOTED && !this[NAME_KEY]) {\n processAllNamespaces();\n }\n\n var ret;\n\n if (this[NAME_KEY]) {\n ret = this[NAME_KEY];\n } else if (this._toString) {\n ret = this._toString;\n } else {\n var str = superClassString(this);\n if (str) {\n ret = \"(subclass of \" + str + \")\";\n } else {\n ret = \"(unknown mixin)\";\n }\n this.toString = makeToString(ret);\n }\n\n return ret;\n }\n\n function processAllNamespaces() {\n var unprocessedNamespaces = !Namespace.PROCESSED,\n unprocessedMixins = Ember.anyUnprocessedMixins;\n\n if (unprocessedNamespaces) {\n findNamespaces();\n Namespace.PROCESSED = true;\n }\n\n if (unprocessedNamespaces || unprocessedMixins) {\n var namespaces = Namespace.NAMESPACES, namespace;\n for (var i=0, l=namespaces.length; i<l; i++) {\n namespace = namespaces[i];\n processNamespace([namespace.toString()], namespace, {});\n }\n\n Ember.anyUnprocessedMixins = false;\n }\n }\n\n function makeToString(ret) {\n return function() { return ret; };\n }\n\n Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB.\n\n __exports__[\"default\"] = Namespace;\n });\ndefine(\"ember-runtime/system/native_array\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/enumerable_utils\",\"ember-metal/mixin\",\"ember-runtime/mixins/array\",\"ember-runtime/mixins/mutable_array\",\"ember-runtime/mixins/observable\",\"ember-runtime/mixins/copyable\",\"ember-runtime/mixins/freezable\",\"ember-runtime/copy\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.EXTEND_PROTOTYPES\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var EnumerableUtils = __dependency4__[\"default\"];\n var Mixin = __dependency5__.Mixin;\n var EmberArray = __dependency6__[\"default\"];\n var MutableArray = __dependency7__[\"default\"];\n var Observable = __dependency8__[\"default\"];\n var Copyable = __dependency9__[\"default\"];\n var FROZEN_ERROR = __dependency10__.FROZEN_ERROR;\n var copy = __dependency11__[\"default\"];\n\n var replace = EnumerableUtils._replace,\n forEach = EnumerableUtils.forEach;\n\n // Add Ember.Array to Array.prototype. Remove methods with native\n // implementations and supply some more optimized versions of generic methods\n // because they are so common.\n\n /**\n The NativeArray mixin contains the properties needed to to make the native\n Array support Ember.MutableArray and all of its dependent APIs. Unless you\n have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to\n false, this will be applied automatically. Otherwise you can apply the mixin\n at anytime by calling `Ember.NativeArray.activate`.\n\n @class NativeArray\n @namespace Ember\n @uses Ember.MutableArray\n @uses Ember.Observable\n @uses Ember.Copyable\n */\n var NativeArray = Mixin.create(MutableArray, Observable, Copyable, {\n\n // because length is a built-in property we need to know to just get the\n // original property.\n get: function(key) {\n if (key==='length') return this.length;\n else if ('number' === typeof key) return this[key];\n else return this._super(key);\n },\n\n objectAt: function(idx) {\n return this[idx];\n },\n\n // primitive for array support.\n replace: function(idx, amt, objects) {\n\n if (this.isFrozen) throw FROZEN_ERROR;\n\n // if we replaced exactly the same number of items, then pass only the\n // replaced range. Otherwise, pass the full remaining array length\n // since everything has shifted\n var len = objects ? get(objects, 'length') : 0;\n this.arrayContentWillChange(idx, amt, len);\n\n if (len === 0) {\n this.splice(idx, amt);\n } else {\n replace(this, idx, amt, objects);\n }\n\n this.arrayContentDidChange(idx, amt, len);\n return this;\n },\n\n // If you ask for an unknown property, then try to collect the value\n // from member items.\n unknownProperty: function(key, value) {\n var ret;// = this.reducedProperty(key, value) ;\n if ((value !== undefined) && ret === undefined) {\n ret = this[key] = value;\n }\n return ret ;\n },\n\n // If browser did not implement indexOf natively, then override with\n // specialized version\n indexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = 0;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n lastIndexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = len-1;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n copy: function(deep) {\n if (deep) {\n return this.map(function(item) { return copy(item, true); });\n }\n\n return this.slice();\n }\n });\n\n // Remove any methods implemented natively so we don't override them\n var ignore = ['length'];\n forEach(NativeArray.keys(), function(methodName) {\n if (Array.prototype[methodName]) ignore.push(methodName);\n });\n\n if (ignore.length>0) {\n NativeArray = NativeArray.without.apply(NativeArray, ignore);\n }\n\n /**\n Creates an `Ember.NativeArray` from an Array like object.\n Does not modify the original object. Ember.A is not needed if\n `Ember.EXTEND_PROTOTYPES` is `true` (the default value). However,\n it is recommended that you use Ember.A when creating addons for\n ember or when you can not guarantee that `Ember.EXTEND_PROTOTYPES`\n will be `true`.\n\n Example\n\n ```js\n var Pagination = Ember.CollectionView.extend({\n tagName: 'ul',\n classNames: ['pagination'],\n\n init: function() {\n this._super();\n if (!this.get('content')) {\n this.set('content', Ember.A());\n }\n }\n });\n ```\n\n @method A\n @for Ember\n @return {Ember.NativeArray}\n */\n var A = function(arr) {\n if (arr === undefined) { arr = []; }\n return EmberArray.detect(arr) ? arr : NativeArray.apply(arr);\n };\n\n /**\n Activates the mixin on the Array.prototype if not already applied. Calling\n this method more than once is safe. This will be called when ember is loaded\n unless you have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array`\n set to `false`.\n\n Example\n\n ```js\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n Ember.NativeArray.activate();\n }\n ```\n\n @method activate\n @for Ember.NativeArray\n @static\n @return {void}\n */\n NativeArray.activate = function() {\n NativeArray.apply(Array.prototype);\n\n A = function(arr) { return arr || []; };\n };\n\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n NativeArray.activate();\n }\n\n Ember.A = A; // ES6TODO: Setting A onto the object returned by ember-metal/core to avoid circles\n __exports__.A = A;\n __exports__.NativeArray = NativeArray;__exports__[\"default\"] = NativeArray;\n });\ndefine(\"ember-runtime/system/object\",\n [\"ember-runtime/system/core_object\",\"ember-runtime/mixins/observable\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n\n var CoreObject = __dependency1__[\"default\"];\n var Observable = __dependency2__[\"default\"];\n\n /**\n `Ember.Object` is the main base class for all Ember objects. It is a subclass\n of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,\n see the documentation for each of these.\n\n @class Object\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.Observable\n */\n var EmberObject = CoreObject.extend(Observable);\n EmberObject.toString = function() { return \"Ember.Object\"; };\n\n __exports__[\"default\"] = EmberObject;\n });\ndefine(\"ember-runtime/system/object_proxy\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/observer\",\"ember-metal/property_events\",\"ember-metal/computed\",\"ember-metal/properties\",\"ember-metal/mixin\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var meta = __dependency4__.meta;\n var addObserver = __dependency5__.addObserver;\n var removeObserver = __dependency5__.removeObserver;\n var addBeforeObserver = __dependency5__.addBeforeObserver;\n var removeBeforeObserver = __dependency5__.removeBeforeObserver;\n var propertyWillChange = __dependency6__.propertyWillChange;\n var propertyDidChange = __dependency6__.propertyDidChange;\n var computed = __dependency7__.computed;\n var defineProperty = __dependency8__.defineProperty;\n var observer = __dependency9__.observer;\n var fmt = __dependency10__.fmt;\n var EmberObject = __dependency11__[\"default\"];\n\n function contentPropertyWillChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyWillChange(this, key);\n }\n\n function contentPropertyDidChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyDidChange(this, key);\n }\n\n /**\n `Ember.ObjectProxy` forwards all properties not defined by the proxy itself\n to a proxied `content` object.\n\n ```javascript\n object = Ember.Object.create({\n name: 'Foo'\n });\n\n proxy = Ember.ObjectProxy.create({\n content: object\n });\n\n // Access and change existing properties\n proxy.get('name') // 'Foo'\n proxy.set('name', 'Bar');\n object.get('name') // 'Bar'\n\n // Create new 'description' property on `object`\n proxy.set('description', 'Foo is a whizboo baz');\n object.get('description') // 'Foo is a whizboo baz'\n ```\n\n While `content` is unset, setting a property to be delegated will throw an\n Error.\n\n ```javascript\n proxy = Ember.ObjectProxy.create({\n content: null,\n flag: null\n });\n proxy.set('flag', true);\n proxy.get('flag'); // true\n proxy.get('foo'); // undefined\n proxy.set('foo', 'data'); // throws Error\n ```\n\n Delegated properties can be bound to and will change when content is updated.\n\n Computed properties on the proxy itself can depend on delegated properties.\n\n ```javascript\n ProxyWithComputedProperty = Ember.ObjectProxy.extend({\n fullName: function () {\n var firstName = this.get('firstName'),\n lastName = this.get('lastName');\n if (firstName && lastName) {\n return firstName + ' ' + lastName;\n }\n return firstName || lastName;\n }.property('firstName', 'lastName')\n });\n\n proxy = ProxyWithComputedProperty.create();\n\n proxy.get('fullName'); // undefined\n proxy.set('content', {\n firstName: 'Tom', lastName: 'Dale'\n }); // triggers property change for fullName on proxy\n\n proxy.get('fullName'); // 'Tom Dale'\n ```\n\n @class ObjectProxy\n @namespace Ember\n @extends Ember.Object\n */\n var ObjectProxy = EmberObject.extend({\n /**\n The object whose properties will be forwarded.\n\n @property content\n @type Ember.Object\n @default null\n */\n content: null,\n _contentDidChange: observer('content', function() {\n Ember.assert(\"Can't set ObjectProxy's content to itself\", get(this, 'content') !== this);\n }),\n\n isTruthy: computed.bool('content'),\n\n _debugContainerKey: null,\n\n willWatchProperty: function (key) {\n var contentKey = 'content.' + key;\n addBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n addObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n didUnwatchProperty: function (key) {\n var contentKey = 'content.' + key;\n removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n removeObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n unknownProperty: function (key) {\n var content = get(this, 'content');\n if (content) {\n return get(content, key);\n }\n },\n\n setUnknownProperty: function (key, value) {\n var m = meta(this);\n if (m.proto === this) {\n // if marked as prototype then just defineProperty\n // rather than delegate\n defineProperty(this, key, null, value);\n return value;\n }\n\n var content = get(this, 'content');\n Ember.assert(fmt(\"Cannot delegate set('%@', %@) to the 'content' property of object proxy %@: its 'content' is undefined.\", [key, value, this]), content);\n return set(content, key, value);\n }\n\n });\n\n __exports__[\"default\"] = ObjectProxy;\n });\ndefine(\"ember-runtime/system/set\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/utils\",\"ember-metal/is_none\",\"ember-runtime/system/string\",\"ember-runtime/system/core_object\",\"ember-runtime/mixins/mutable_enumerable\",\"ember-runtime/mixins/enumerable\",\"ember-runtime/mixins/copyable\",\"ember-runtime/mixins/freezable\",\"ember-metal/error\",\"ember-metal/property_events\",\"ember-metal/mixin\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.isNone\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var guidFor = __dependency4__.guidFor;\n var isNone = __dependency5__.isNone;\n var fmt = __dependency6__.fmt;\n var CoreObject = __dependency7__[\"default\"];\n var MutableEnumerable = __dependency8__[\"default\"];\n var Enumerable = __dependency9__[\"default\"];\n var Copyable = __dependency10__[\"default\"];\n var Freezable = __dependency11__.Freezable;\n var FROZEN_ERROR = __dependency11__.FROZEN_ERROR;\n var EmberError = __dependency12__[\"default\"];\n var propertyWillChange = __dependency13__.propertyWillChange;\n var propertyDidChange = __dependency13__.propertyDidChange;\n var aliasMethod = __dependency14__.aliasMethod;\n var computed = __dependency15__.computed;\n\n /**\n An unordered collection of objects.\n\n A Set works a bit like an array except that its items are not ordered. You\n can create a set to efficiently test for membership for an object. You can\n also iterate through a set just like an array, even accessing objects by\n index, however there is no guarantee as to their order.\n\n All Sets are observable via the Enumerable Observer API - which works\n on any enumerable object including both Sets and Arrays.\n\n ## Creating a Set\n\n You can create a set like you would most objects using\n `new Ember.Set()`. Most new sets you create will be empty, but you can\n also initialize the set with some content by passing an array or other\n enumerable of objects to the constructor.\n\n Finally, you can pass in an existing set and the set will be copied. You\n can also create a copy of a set by calling `Ember.Set#copy()`.\n\n ```javascript\n // creates a new empty set\n var foundNames = new Ember.Set();\n\n // creates a set with four names in it.\n var names = new Ember.Set([\"Charles\", \"Tom\", \"Juan\", \"Alex\"]); // :P\n\n // creates a copy of the names set.\n var namesCopy = new Ember.Set(names);\n\n // same as above.\n var anotherNamesCopy = names.copy();\n ```\n\n ## Adding/Removing Objects\n\n You generally add or remove objects from a set using `add()` or\n `remove()`. You can add any type of object including primitives such as\n numbers, strings, and booleans.\n\n Unlike arrays, objects can only exist one time in a set. If you call `add()`\n on a set with the same object multiple times, the object will only be added\n once. Likewise, calling `remove()` with the same object multiple times will\n remove the object the first time and have no effect on future calls until\n you add the object to the set again.\n\n NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do\n so will be ignored.\n\n In addition to add/remove you can also call `push()`/`pop()`. Push behaves\n just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary\n object, remove it and return it. This is a good way to use a set as a job\n queue when you don't care which order the jobs are executed in.\n\n ## Testing for an Object\n\n To test for an object's presence in a set you simply call\n `Ember.Set#contains()`.\n\n ## Observing changes\n\n When using `Ember.Set`, you can observe the `\"[]\"` property to be\n alerted whenever the content changes. You can also add an enumerable\n observer to the set to be notified of specific objects that are added and\n removed from the set. See [Ember.Enumerable](/api/classes/Ember.Enumerable.html)\n for more information on enumerables.\n\n This is often unhelpful. If you are filtering sets of objects, for instance,\n it is very inefficient to re-filter all of the items each time the set\n changes. It would be better if you could just adjust the filtered set based\n on what was changed on the original set. The same issue applies to merging\n sets, as well.\n\n ## Other Methods\n\n `Ember.Set` primary implements other mixin APIs. For a complete reference\n on the methods you will use with `Ember.Set`, please consult these mixins.\n The most useful ones will be `Ember.Enumerable` and\n `Ember.MutableEnumerable` which implement most of the common iterator\n methods you are used to on Array.\n\n Note that you can also use the `Ember.Copyable` and `Ember.Freezable`\n APIs on `Ember.Set` as well. Once a set is frozen it can no longer be\n modified. The benefit of this is that when you call `frozenCopy()` on it,\n Ember will avoid making copies of the set. This allows you to write\n code that can know with certainty when the underlying set data will or\n will not be modified.\n\n @class Set\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.MutableEnumerable\n @uses Ember.Copyable\n @uses Ember.Freezable\n @since Ember 0.9\n */\n var Set = CoreObject.extend(MutableEnumerable, Copyable, Freezable,\n {\n\n // ..........................................................\n // IMPLEMENT ENUMERABLE APIS\n //\n\n /**\n This property will change as the number of objects in the set changes.\n\n @property length\n @type number\n @default 0\n */\n length: 0,\n\n /**\n Clears the set. This is useful if you want to reuse an existing set\n without having to recreate it.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.length; // 3\n colors.clear();\n colors.length; // 0\n ```\n\n @method clear\n @return {Ember.Set} An empty Set\n */\n clear: function() {\n if (this.isFrozen) { throw new EmberError(FROZEN_ERROR); }\n\n var len = get(this, 'length');\n if (len === 0) { return this; }\n\n var guid;\n\n this.enumerableContentWillChange(len, 0);\n propertyWillChange(this, 'firstObject');\n propertyWillChange(this, 'lastObject');\n\n for (var i=0; i < len; i++) {\n guid = guidFor(this[i]);\n delete this[guid];\n delete this[i];\n }\n\n set(this, 'length', 0);\n\n propertyDidChange(this, 'firstObject');\n propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(len, 0);\n\n return this;\n },\n\n /**\n Returns true if the passed object is also an enumerable that contains the\n same objects as the receiver.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"],\n same_colors = new Ember.Set(colors);\n\n same_colors.isEqual(colors); // true\n same_colors.isEqual([\"purple\", \"brown\"]); // false\n ```\n\n @method isEqual\n @param {Ember.Set} obj the other object.\n @return {Boolean}\n */\n isEqual: function(obj) {\n // fail fast\n if (!Enumerable.detect(obj)) return false;\n\n var loc = get(this, 'length');\n if (get(obj, 'length') !== loc) return false;\n\n while(--loc >= 0) {\n if (!obj.contains(this[loc])) return false;\n }\n\n return true;\n },\n\n /**\n Adds an object to the set. Only non-`null` objects can be added to a set\n and those can only be added once. If the object is already in the set or\n the passed value is null this method will have no effect.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"red\"); // [\"blue\", \"red\"]\n colors.add(null); // [\"blue\", \"red\"]\n colors.add(undefined); // [\"blue\", \"red\"]\n ```\n\n @method add\n @param {Object} obj The object to add.\n @return {Ember.Set} The set itself.\n */\n add: aliasMethod('addObject'),\n\n /**\n Removes the object from the set if it is found. If you pass a `null` value\n or an object that is already not in the set, this method will have no\n effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.remove(\"red\"); // [\"blue\", \"green\"]\n colors.remove(\"purple\"); // [\"blue\", \"green\"]\n colors.remove(null); // [\"blue\", \"green\"]\n ```\n\n @method remove\n @param {Object} obj The object to remove\n @return {Ember.Set} The set itself.\n */\n remove: aliasMethod('removeObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.pop(); // \"blue\"\n colors.pop(); // \"green\"\n colors.pop(); // null\n ```\n\n @method pop\n @return {Object} The removed object from the set or null.\n */\n pop: function() {\n if (get(this, 'isFrozen')) throw new EmberError(FROZEN_ERROR);\n var obj = this.length > 0 ? this[this.length-1] : null;\n this.remove(obj);\n return obj;\n },\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.push(\"red\"); // [\"red\"]\n colors.push(\"green\"); // [\"red\", \"green\"]\n colors.push(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method push\n @return {Ember.Set} The set itself.\n */\n push: aliasMethod('addObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n This is an alias for `Ember.Set.pop()`.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.shift(); // \"blue\"\n colors.shift(); // \"green\"\n colors.shift(); // null\n ```\n\n @method shift\n @return {Object} The removed object from the set or null.\n */\n shift: aliasMethod('pop'),\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias of `Ember.Set.push()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.unshift(\"red\"); // [\"red\"]\n colors.unshift(\"green\"); // [\"red\", \"green\"]\n colors.unshift(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method unshift\n @return {Ember.Set} The set itself.\n */\n unshift: aliasMethod('push'),\n\n /**\n Adds each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.addObjects()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.addEach([\"red\", \"green\", \"blue\"]); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method addEach\n @param {Ember.Enumerable} objects the objects to add.\n @return {Ember.Set} The set itself.\n */\n addEach: aliasMethod('addObjects'),\n\n /**\n Removes each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.removeObjects()`\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.removeEach([\"red\", \"blue\"]); // [\"green\"]\n ```\n\n @method removeEach\n @param {Ember.Enumerable} objects the objects to remove.\n @return {Ember.Set} The set itself.\n */\n removeEach: aliasMethod('removeObjects'),\n\n // ..........................................................\n // PRIVATE ENUMERABLE SUPPORT\n //\n\n init: function(items) {\n this._super();\n if (items) this.addObjects(items);\n },\n\n // implement Ember.Enumerable\n nextObject: function(idx) {\n return this[idx];\n },\n\n // more optimized version\n firstObject: computed(function() {\n return this.length > 0 ? this[0] : undefined;\n }),\n\n // more optimized version\n lastObject: computed(function() {\n return this.length > 0 ? this[this.length-1] : undefined;\n }),\n\n // implements Ember.MutableEnumerable\n addObject: function(obj) {\n if (get(this, 'isFrozen')) throw new EmberError(FROZEN_ERROR);\n if (isNone(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n added ;\n\n if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added\n\n added = [obj];\n\n this.enumerableContentWillChange(null, added);\n propertyWillChange(this, 'lastObject');\n\n len = get(this, 'length');\n this[guid] = len;\n this[len] = obj;\n set(this, 'length', len+1);\n\n propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(null, added);\n\n return this;\n },\n\n // implements Ember.MutableEnumerable\n removeObject: function(obj) {\n if (get(this, 'isFrozen')) throw new EmberError(FROZEN_ERROR);\n if (isNone(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n isFirst = idx === 0,\n isLast = idx === len-1,\n last, removed;\n\n\n if (idx>=0 && idx<len && (this[idx] === obj)) {\n removed = [obj];\n\n this.enumerableContentWillChange(removed, null);\n if (isFirst) { propertyWillChange(this, 'firstObject'); }\n if (isLast) { propertyWillChange(this, 'lastObject'); }\n\n // swap items - basically move the item to the end so it can be removed\n if (idx < len-1) {\n last = this[len-1];\n this[idx] = last;\n this[guidFor(last)] = idx;\n }\n\n delete this[guid];\n delete this[len-1];\n set(this, 'length', len-1);\n\n if (isFirst) { propertyDidChange(this, 'firstObject'); }\n if (isLast) { propertyDidChange(this, 'lastObject'); }\n this.enumerableContentDidChange(removed, null);\n }\n\n return this;\n },\n\n // optimized version\n contains: function(obj) {\n return this[guidFor(obj)]>=0;\n },\n\n copy: function() {\n var C = this.constructor, ret = new C(), loc = get(this, 'length');\n set(ret, 'length', loc);\n while(--loc>=0) {\n ret[loc] = this[loc];\n ret[guidFor(this[loc])] = loc;\n }\n return ret;\n },\n\n toString: function() {\n var len = this.length, idx, array = [];\n for(idx = 0; idx < len; idx++) {\n array[idx] = this[idx];\n }\n return fmt(\"Ember.Set<%@>\", [array.join(',')]);\n }\n\n });\n\n\n __exports__[\"default\"] = Set;\n });\ndefine(\"ember-runtime/system/string\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-runtime\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.STRINGS, Ember.FEATURES\n var EmberInspect = __dependency2__.inspect;\n\n\n var STRING_DASHERIZE_REGEXP = (/[ _]/g);\n var STRING_DASHERIZE_CACHE = {};\n var STRING_DECAMELIZE_REGEXP = (/([a-z\\d])([A-Z])/g);\n var STRING_CAMELIZE_REGEXP = (/(\\-|_|\\.|\\s)+(.)?/g);\n var STRING_UNDERSCORE_REGEXP_1 = (/([a-z\\d])([A-Z]+)/g);\n var STRING_UNDERSCORE_REGEXP_2 = (/\\-|\\s+/g);\n\n function fmt(str, formats) {\n // first, replace any ORDERED replacements.\n var idx = 0; // the current index for non-numerical replacements\n return str.replace(/%@([0-9]+)?/g, function(s, argIndex) {\n argIndex = (argIndex) ? parseInt(argIndex, 10) - 1 : idx++;\n s = formats[argIndex];\n return (s === null) ? '(null)' : (s === undefined) ? '' : EmberInspect(s);\n }) ;\n }\n\n function loc(str, formats) {\n str = Ember.STRINGS[str] || str;\n return fmt(str, formats);\n }\n\n function w(str) {\n return str.split(/\\s+/);\n }\n\n function decamelize(str) {\n return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();\n }\n\n function dasherize(str) {\n var cache = STRING_DASHERIZE_CACHE,\n hit = cache.hasOwnProperty(str),\n ret;\n\n if (hit) {\n return cache[str];\n } else {\n ret = decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');\n cache[str] = ret;\n }\n\n return ret;\n }\n\n function camelize(str) {\n return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) {\n return chr ? chr.toUpperCase() : '';\n }).replace(/^([A-Z])/, function(match, separator, chr) {\n return match.toLowerCase();\n });\n }\n\n function classify(str) {\n var parts = str.split(\".\"),\n out = [];\n\n for (var i=0, l=parts.length; i<l; i++) {\n var camelized = camelize(parts[i]);\n out.push(camelized.charAt(0).toUpperCase() + camelized.substr(1));\n }\n\n return out.join(\".\");\n }\n\n function underscore(str) {\n return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').\n replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase();\n }\n\n function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substr(1);\n }\n\n /**\n Defines the hash of localized strings for the current language. Used by\n the `Ember.String.loc()` helper. To localize, add string values to this\n hash.\n\n @property STRINGS\n @for Ember\n @type Hash\n */\n Ember.STRINGS = {};\n\n /**\n Defines string helper methods including string formatting and localization.\n Unless `Ember.EXTEND_PROTOTYPES.String` is `false` these methods will also be\n added to the `String.prototype` as well.\n\n @class String\n @namespace Ember\n @static\n */\n var EmberStringUtils = {\n\n /**\n Apply formatting options to the string. This will look for occurrences\n of \"%@\" in your string and substitute them with the arguments you pass into\n this method. If you want to control the specific order of replacement,\n you can add a number after the key as well to indicate which argument\n you want to insert.\n\n Ordered insertions are most useful when building loc strings where values\n you need to insert may appear in different orders.\n\n ```javascript\n \"Hello %@ %@\".fmt('John', 'Doe'); // \"Hello John Doe\"\n \"Hello %@2, %@1\".fmt('John', 'Doe'); // \"Hello Doe, John\"\n ```\n\n @method fmt\n @param {String} str The string to format\n @param {Array} formats An array of parameters to interpolate into string.\n @return {String} formatted string\n */\n fmt: fmt,\n\n /**\n Formats the passed string, but first looks up the string in the localized\n strings hash. This is a convenient way to localize text. See\n `Ember.String.fmt()` for more information on formatting.\n\n Note that it is traditional but not required to prefix localized string\n keys with an underscore or other character so you can easily identify\n localized strings.\n\n ```javascript\n Ember.STRINGS = {\n '_Hello World': 'Bonjour le monde',\n '_Hello %@ %@': 'Bonjour %@ %@'\n };\n\n Ember.String.loc(\"_Hello World\"); // 'Bonjour le monde';\n Ember.String.loc(\"_Hello %@ %@\", [\"John\", \"Smith\"]); // \"Bonjour John Smith\";\n ```\n\n @method loc\n @param {String} str The string to format\n @param {Array} formats Optional array of parameters to interpolate into string.\n @return {String} formatted string\n */\n loc: loc,\n\n /**\n Splits a string into separate units separated by spaces, eliminating any\n empty strings in the process. This is a convenience method for split that\n is mostly useful when applied to the `String.prototype`.\n\n ```javascript\n Ember.String.w(\"alpha beta gamma\").forEach(function(key) {\n console.log(key);\n });\n\n // > alpha\n // > beta\n // > gamma\n ```\n\n @method w\n @param {String} str The string to split\n @return {Array} array containing the split strings\n */\n w: w,\n\n /**\n Converts a camelized string into all lower case separated by underscores.\n\n ```javascript\n 'innerHTML'.decamelize(); // 'inner_html'\n 'action_name'.decamelize(); // 'action_name'\n 'css-class-name'.decamelize(); // 'css-class-name'\n 'my favorite items'.decamelize(); // 'my favorite items'\n ```\n\n @method decamelize\n @param {String} str The string to decamelize.\n @return {String} the decamelized string.\n */\n decamelize: decamelize,\n\n /**\n Replaces underscores, spaces, or camelCase with dashes.\n\n ```javascript\n 'innerHTML'.dasherize(); // 'inner-html'\n 'action_name'.dasherize(); // 'action-name'\n 'css-class-name'.dasherize(); // 'css-class-name'\n 'my favorite items'.dasherize(); // 'my-favorite-items'\n ```\n\n @method dasherize\n @param {String} str The string to dasherize.\n @return {String} the dasherized string.\n */\n dasherize: dasherize,\n\n /**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.camelize(); // 'innerHTML'\n 'action_name'.camelize(); // 'actionName'\n 'css-class-name'.camelize(); // 'cssClassName'\n 'my favorite items'.camelize(); // 'myFavoriteItems'\n 'My Favorite Items'.camelize(); // 'myFavoriteItems'\n ```\n\n @method camelize\n @param {String} str The string to camelize.\n @return {String} the camelized string.\n */\n camelize: camelize,\n\n /**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.classify(); // 'InnerHTML'\n 'action_name'.classify(); // 'ActionName'\n 'css-class-name'.classify(); // 'CssClassName'\n 'my favorite items'.classify(); // 'MyFavoriteItems'\n ```\n\n @method classify\n @param {String} str the string to classify\n @return {String} the classified string\n */\n classify: classify,\n\n /**\n More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n form of a string.\n\n ```javascript\n 'innerHTML'.underscore(); // 'inner_html'\n 'action_name'.underscore(); // 'action_name'\n 'css-class-name'.underscore(); // 'css_class_name'\n 'my favorite items'.underscore(); // 'my_favorite_items'\n ```\n\n @method underscore\n @param {String} str The string to underscore.\n @return {String} the underscored string.\n */\n underscore: underscore,\n\n /**\n Returns the Capitalized form of a string\n\n ```javascript\n 'innerHTML'.capitalize() // 'InnerHTML'\n 'action_name'.capitalize() // 'Action_name'\n 'css-class-name'.capitalize() // 'Css-class-name'\n 'my favorite items'.capitalize() // 'My favorite items'\n ```\n\n @method capitalize\n @param {String} str The string to capitalize.\n @return {String} The capitalized string.\n */\n capitalize: capitalize\n };\n\n __exports__[\"default\"] = EmberStringUtils;\n __exports__.fmt = fmt;\n __exports__.loc = loc;\n __exports__.w = w;\n __exports__.decamelize = decamelize;\n __exports__.dasherize = dasherize;\n __exports__.camelize = camelize;\n __exports__.classify = classify;\n __exports__.underscore = underscore;\n __exports__.capitalize = capitalize;\n });\ndefine(\"ember-runtime/system/subarray\",\n [\"ember-metal/property_get\",\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var EmberError = __dependency2__[\"default\"];\n var EnumerableUtils = __dependency3__[\"default\"];\n\n var RETAIN = 'r',\n FILTER = 'f';\n\n function Operation (type, count) {\n this.type = type;\n this.count = count;\n }\n\n /**\n An `Ember.SubArray` tracks an array in a way similar to, but more specialized\n than, `Ember.TrackedArray`. It is useful for keeping track of the indexes of\n items within a filtered array.\n\n @class SubArray\n @namespace Ember\n */\n function SubArray (length) {\n if (arguments.length < 1) { length = 0; }\n\n if (length > 0) {\n this._operations = [new Operation(RETAIN, length)];\n } else {\n this._operations = [];\n }\n };\n\n SubArray.prototype = {\n /**\n Track that an item was added to the tracked array.\n\n @method addItem\n\n @param {number} index The index of the item in the tracked array.\n @param {boolean} match `true` iff the item is included in the subarray.\n\n @return {number} The index of the item in the subarray.\n */\n addItem: function(index, match) {\n var returnValue = -1,\n itemType = match ? RETAIN : FILTER,\n self = this;\n\n this._findOperation(index, function(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) {\n var newOperation, splitOperation;\n\n if (itemType === operation.type) {\n ++operation.count;\n } else if (index === rangeStart) {\n // insert to the left of `operation`\n self._operations.splice(operationIndex, 0, new Operation(itemType, 1));\n } else {\n newOperation = new Operation(itemType, 1);\n splitOperation = new Operation(operation.type, rangeEnd - index + 1);\n operation.count = index - rangeStart;\n\n self._operations.splice(operationIndex + 1, 0, newOperation, splitOperation);\n }\n\n if (match) {\n if (operation.type === RETAIN) {\n returnValue = seenInSubArray + (index - rangeStart);\n } else {\n returnValue = seenInSubArray;\n }\n }\n\n self._composeAt(operationIndex);\n }, function(seenInSubArray) {\n self._operations.push(new Operation(itemType, 1));\n\n if (match) {\n returnValue = seenInSubArray;\n }\n\n self._composeAt(self._operations.length-1);\n });\n\n return returnValue;\n },\n\n /**\n Track that an item was removed from the tracked array.\n\n @method removeItem\n\n @param {number} index The index of the item in the tracked array.\n\n @return {number} The index of the item in the subarray, or `-1` if the item\n was not in the subarray.\n */\n removeItem: function(index) {\n var returnValue = -1,\n self = this;\n\n this._findOperation(index, function (operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) {\n if (operation.type === RETAIN) {\n returnValue = seenInSubArray + (index - rangeStart);\n }\n\n if (operation.count > 1) {\n --operation.count;\n } else {\n self._operations.splice(operationIndex, 1);\n self._composeAt(operationIndex);\n }\n }, function() {\n throw new EmberError(\"Can't remove an item that has never been added.\");\n });\n\n return returnValue;\n },\n\n\n _findOperation: function (index, foundCallback, notFoundCallback) {\n var operationIndex,\n len,\n operation,\n rangeStart,\n rangeEnd,\n seenInSubArray = 0;\n\n // OPTIMIZE: change to balanced tree\n // find leftmost operation to the right of `index`\n for (operationIndex = rangeStart = 0, len = this._operations.length; operationIndex < len; rangeStart = rangeEnd + 1, ++operationIndex) {\n operation = this._operations[operationIndex];\n rangeEnd = rangeStart + operation.count - 1;\n\n if (index >= rangeStart && index <= rangeEnd) {\n foundCallback(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray);\n return;\n } else if (operation.type === RETAIN) {\n seenInSubArray += operation.count;\n }\n }\n\n notFoundCallback(seenInSubArray);\n },\n\n _composeAt: function(index) {\n var op = this._operations[index],\n otherOp;\n\n if (!op) {\n // Composing out of bounds is a no-op, as when removing the last operation\n // in the list.\n return;\n }\n\n if (index > 0) {\n otherOp = this._operations[index-1];\n if (otherOp.type === op.type) {\n op.count += otherOp.count;\n this._operations.splice(index-1, 1);\n --index;\n }\n }\n\n if (index < this._operations.length-1) {\n otherOp = this._operations[index+1];\n if (otherOp.type === op.type) {\n op.count += otherOp.count;\n this._operations.splice(index+1, 1);\n }\n }\n },\n\n toString: function () {\n var str = \"\";\n forEach(this._operations, function (operation) {\n str += \" \" + operation.type + \":\" + operation.count;\n });\n return str.substring(1);\n }\n };\n\n __exports__[\"default\"] = SubArray;\n });\ndefine(\"ember-runtime/system/tracked_array\",\n [\"ember-metal/property_get\",\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var get = __dependency1__.get;\n var EnumerableUtils = __dependency2__[\"default\"];\n\n var forEach = EnumerableUtils.forEach,\n RETAIN = 'r',\n INSERT = 'i',\n DELETE = 'd';\n\n\n /**\n An `Ember.TrackedArray` tracks array operations. It's useful when you want to\n lazily compute the indexes of items in an array after they've been shifted by\n subsequent operations.\n\n @class TrackedArray\n @namespace Ember\n @param {array} [items=[]] The array to be tracked. This is used just to get\n the initial items for the starting state of retain:n.\n */\n function TrackedArray(items) {\n if (arguments.length < 1) { items = []; }\n\n var length = get(items, 'length');\n\n if (length) {\n this._operations = [new ArrayOperation(RETAIN, length, items)];\n } else {\n this._operations = [];\n }\n }\n\n TrackedArray.RETAIN = RETAIN;\n TrackedArray.INSERT = INSERT;\n TrackedArray.DELETE = DELETE;\n\n TrackedArray.prototype = {\n\n /**\n Track that `newItems` were added to the tracked array at `index`.\n\n @method addItems\n @param index\n @param newItems\n */\n addItems: function (index, newItems) {\n var count = get(newItems, 'length');\n if (count < 1) { return; }\n\n var match = this._findArrayOperation(index),\n arrayOperation = match.operation,\n arrayOperationIndex = match.index,\n arrayOperationRangeStart = match.rangeStart,\n composeIndex,\n splitIndex,\n splitItems,\n splitArrayOperation,\n newArrayOperation;\n\n newArrayOperation = new ArrayOperation(INSERT, count, newItems);\n\n if (arrayOperation) {\n if (!match.split) {\n // insert left of arrayOperation\n this._operations.splice(arrayOperationIndex, 0, newArrayOperation);\n composeIndex = arrayOperationIndex;\n } else {\n this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation);\n composeIndex = arrayOperationIndex + 1;\n }\n } else {\n // insert at end\n this._operations.push(newArrayOperation);\n composeIndex = arrayOperationIndex;\n }\n\n this._composeInsert(composeIndex);\n },\n\n /**\n Track that `count` items were removed at `index`.\n\n @method removeItems\n @param index\n @param count\n */\n removeItems: function (index, count) {\n if (count < 1) { return; }\n\n var match = this._findArrayOperation(index),\n arrayOperation = match.operation,\n arrayOperationIndex = match.index,\n arrayOperationRangeStart = match.rangeStart,\n newArrayOperation,\n composeIndex;\n\n newArrayOperation = new ArrayOperation(DELETE, count);\n if (!match.split) {\n // insert left of arrayOperation\n this._operations.splice(arrayOperationIndex, 0, newArrayOperation);\n composeIndex = arrayOperationIndex;\n } else {\n this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation);\n composeIndex = arrayOperationIndex + 1;\n }\n\n return this._composeDelete(composeIndex);\n },\n\n /**\n Apply all operations, reducing them to retain:n, for `n`, the number of\n items in the array.\n\n `callback` will be called for each operation and will be passed the following arguments:\n\n * {array} items The items for the given operation\n * {number} offset The computed offset of the items, ie the index in the\n array of the first item for this operation.\n * {string} operation The type of the operation. One of\n `Ember.TrackedArray.{RETAIN, DELETE, INSERT}`\n\n @method apply\n @param {function} callback\n */\n apply: function (callback) {\n var items = [],\n offset = 0;\n\n forEach(this._operations, function (arrayOperation, operationIndex) {\n callback(arrayOperation.items, offset, arrayOperation.type, operationIndex);\n\n if (arrayOperation.type !== DELETE) {\n offset += arrayOperation.count;\n items = items.concat(arrayOperation.items);\n }\n });\n\n this._operations = [new ArrayOperation(RETAIN, items.length, items)];\n },\n\n /**\n Return an `ArrayOperationMatch` for the operation that contains the item at `index`.\n\n @method _findArrayOperation\n\n @param {number} index the index of the item whose operation information\n should be returned.\n @private\n */\n _findArrayOperation: function (index) {\n var arrayOperationIndex,\n len,\n split = false,\n arrayOperation,\n arrayOperationRangeStart,\n arrayOperationRangeEnd;\n\n // OPTIMIZE: we could search these faster if we kept a balanced tree.\n // find leftmost arrayOperation to the right of `index`\n for (arrayOperationIndex = arrayOperationRangeStart = 0, len = this._operations.length; arrayOperationIndex < len; ++arrayOperationIndex) {\n arrayOperation = this._operations[arrayOperationIndex];\n\n if (arrayOperation.type === DELETE) { continue; }\n\n arrayOperationRangeEnd = arrayOperationRangeStart + arrayOperation.count - 1;\n\n if (index === arrayOperationRangeStart) {\n break;\n } else if (index > arrayOperationRangeStart && index <= arrayOperationRangeEnd) {\n split = true;\n break;\n } else {\n arrayOperationRangeStart = arrayOperationRangeEnd + 1;\n }\n }\n\n return new ArrayOperationMatch(arrayOperation, arrayOperationIndex, split, arrayOperationRangeStart);\n },\n\n _split: function (arrayOperationIndex, splitIndex, newArrayOperation) {\n var arrayOperation = this._operations[arrayOperationIndex],\n splitItems = arrayOperation.items.slice(splitIndex),\n splitArrayOperation = new ArrayOperation(arrayOperation.type, splitItems.length, splitItems);\n\n // truncate LHS\n arrayOperation.count = splitIndex;\n arrayOperation.items = arrayOperation.items.slice(0, splitIndex);\n\n this._operations.splice(arrayOperationIndex + 1, 0, newArrayOperation, splitArrayOperation);\n },\n\n // see SubArray for a better implementation.\n _composeInsert: function (index) {\n var newArrayOperation = this._operations[index],\n leftArrayOperation = this._operations[index-1], // may be undefined\n rightArrayOperation = this._operations[index+1], // may be undefined\n leftOp = leftArrayOperation && leftArrayOperation.type,\n rightOp = rightArrayOperation && rightArrayOperation.type;\n\n if (leftOp === INSERT) {\n // merge left\n leftArrayOperation.count += newArrayOperation.count;\n leftArrayOperation.items = leftArrayOperation.items.concat(newArrayOperation.items);\n\n if (rightOp === INSERT) {\n // also merge right (we have split an insert with an insert)\n leftArrayOperation.count += rightArrayOperation.count;\n leftArrayOperation.items = leftArrayOperation.items.concat(rightArrayOperation.items);\n this._operations.splice(index, 2);\n } else {\n // only merge left\n this._operations.splice(index, 1);\n }\n } else if (rightOp === INSERT) {\n // merge right\n newArrayOperation.count += rightArrayOperation.count;\n newArrayOperation.items = newArrayOperation.items.concat(rightArrayOperation.items);\n this._operations.splice(index + 1, 1);\n }\n },\n\n _composeDelete: function (index) {\n var arrayOperation = this._operations[index],\n deletesToGo = arrayOperation.count,\n leftArrayOperation = this._operations[index-1], // may be undefined\n leftOp = leftArrayOperation && leftArrayOperation.type,\n nextArrayOperation,\n nextOp,\n nextCount,\n removeNewAndNextOp = false,\n removedItems = [];\n\n if (leftOp === DELETE) {\n arrayOperation = leftArrayOperation;\n index -= 1;\n }\n\n for (var i = index + 1; deletesToGo > 0; ++i) {\n nextArrayOperation = this._operations[i];\n nextOp = nextArrayOperation.type;\n nextCount = nextArrayOperation.count;\n\n if (nextOp === DELETE) {\n arrayOperation.count += nextCount;\n continue;\n }\n\n if (nextCount > deletesToGo) {\n // d:2 {r,i}:5 we reduce the retain or insert, but it stays\n removedItems = removedItems.concat(nextArrayOperation.items.splice(0, deletesToGo));\n nextArrayOperation.count -= deletesToGo;\n\n // In the case where we truncate the last arrayOperation, we don't need to\n // remove it; also the deletesToGo reduction is not the entirety of\n // nextCount\n i -= 1;\n nextCount = deletesToGo;\n\n deletesToGo = 0;\n } else {\n if (nextCount === deletesToGo) {\n // Handle edge case of d:2 i:2 in which case both operations go away\n // during composition.\n removeNewAndNextOp = true;\n }\n removedItems = removedItems.concat(nextArrayOperation.items);\n deletesToGo -= nextCount;\n }\n\n if (nextOp === INSERT) {\n // d:2 i:3 will result in delete going away\n arrayOperation.count -= nextCount;\n }\n }\n\n if (arrayOperation.count > 0) {\n // compose our new delete with possibly several operations to the right of\n // disparate types\n this._operations.splice(index+1, i-1-index);\n } else {\n // The delete operation can go away; it has merely reduced some other\n // operation, as in d:3 i:4; it may also have eliminated that operation,\n // as in d:3 i:3.\n this._operations.splice(index, removeNewAndNextOp ? 2 : 1);\n }\n\n return removedItems;\n },\n\n toString: function () {\n var str = \"\";\n forEach(this._operations, function (operation) {\n str += \" \" + operation.type + \":\" + operation.count;\n });\n return str.substring(1);\n }\n };\n\n /**\n Internal data structure to represent an array operation.\n\n @method ArrayOperation\n @private\n @param {string} type The type of the operation. One of\n `Ember.TrackedArray.{RETAIN, INSERT, DELETE}`\n @param {number} count The number of items in this operation.\n @param {array} items The items of the operation, if included. RETAIN and\n INSERT include their items, DELETE does not.\n */\n function ArrayOperation (operation, count, items) {\n this.type = operation; // RETAIN | INSERT | DELETE\n this.count = count;\n this.items = items;\n }\n\n /**\n Internal data structure used to include information when looking up operations\n by item index.\n\n @method ArrayOperationMatch\n @private\n @param {ArrayOperation} operation\n @param {number} index The index of `operation` in the array of operations.\n @param {boolean} split Whether or not the item index searched for would\n require a split for a new operation type.\n @param {number} rangeStart The index of the first item in the operation,\n with respect to the tracked array. The index of the last item can be computed\n from `rangeStart` and `operation.count`.\n */\n function ArrayOperationMatch(operation, index, split, rangeStart) {\n this.operation = operation;\n this.index = index;\n this.split = split;\n this.rangeStart = rangeStart;\n }\n\n __exports__[\"default\"] = TrackedArray;\n });\n})();\n//@ sourceURL=ember-runtime");minispade.register('ember-testing', "(function() {minispade.require(\"ember-routing\");\nminispade.require(\"ember-application\");\ndefine(\"ember-testing/adapters/adapter\",\n [\"ember-metal/core\",\"ember-metal/utils\",\"ember-runtime/system/object\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.K\n var inspect = __dependency2__.inspect;\n var EmberObject = __dependency3__[\"default\"];\n\n /**\n @module ember\n @submodule ember-testing\n */\n\n /**\n The primary purpose of this class is to create hooks that can be implemented\n by an adapter for various test frameworks.\n\n @class Adapter\n @namespace Ember.Test\n */\n var Adapter = EmberObject.extend({\n /**\n This callback will be called whenever an async operation is about to start.\n\n Override this to call your framework's methods that handle async\n operations.\n\n @public\n @method asyncStart\n */\n asyncStart: Ember.K,\n\n /**\n This callback will be called whenever an async operation has completed.\n\n @public\n @method asyncEnd\n */\n asyncEnd: Ember.K,\n\n /**\n Override this method with your testing framework's false assertion.\n This function is called whenever an exception occurs causing the testing\n promise to fail.\n\n QUnit example:\n\n ```javascript\n exception: function(error) {\n ok(false, error);\n };\n ```\n\n @public\n @method exception\n @param {String} error The exception to be raised.\n */\n exception: function(error) {\n throw error;\n }\n });\n\n __exports__[\"default\"] = Adapter;\n });\ndefine(\"ember-testing/adapters/qunit\",\n [\"ember-testing/adapters/adapter\",\"ember-metal/utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Adapter = __dependency1__[\"default\"];\n var inspect = __dependency2__.inspect;\n\n /**\n This class implements the methods defined by Ember.Test.Adapter for the\n QUnit testing framework.\n\n @class QUnitAdapter\n @namespace Ember.Test\n @extends Ember.Test.Adapter\n */\n var QUnitAdapter = Adapter.extend({\n asyncStart: function() {\n QUnit.stop();\n },\n asyncEnd: function() {\n QUnit.start();\n },\n exception: function(error) {\n ok(false, inspect(error));\n }\n });\n\n __exports__[\"default\"] = QUnitAdapter;\n });\ndefine(\"ember-testing/helpers\",\n [\"ember-metal/property_get\",\"ember-metal/error\",\"ember-metal/run_loop\",\"ember-views/system/jquery\",\"ember-testing/test\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {\n \"use strict\";\n var get = __dependency1__.get;\n var EmberError = __dependency2__[\"default\"];\n var run = __dependency3__[\"default\"];\n var jQuery = __dependency4__[\"default\"];\n var Test = __dependency5__[\"default\"];\n\n /**\n * @module ember\n * @submodule ember-testing\n */\n\n var helper = Test.registerHelper,\n asyncHelper = Test.registerAsyncHelper,\n countAsync = 0;\n\n function currentRouteName(app){\n var appController = app.__container__.lookup('controller:application');\n\n return get(appController, 'currentRouteName');\n }\n\n function currentPath(app){\n var appController = app.__container__.lookup('controller:application');\n\n return get(appController, 'currentPath');\n }\n\n function currentURL(app){\n var router = app.__container__.lookup('router:main');\n\n return get(router, 'location').getURL();\n }\n\n function visit(app, url) {\n var router = app.__container__.lookup('router:main');\n router.location.setURL(url);\n\n if (app._readinessDeferrals > 0) {\n router['initialURL'] = url;\n run(app, 'advanceReadiness');\n delete router['initialURL'];\n } else {\n run(app, app.handleURL, url);\n }\n\n return wait(app);\n }\n\n function click(app, selector, context) {\n var $el = findWithAssert(app, selector, context);\n run($el, 'mousedown');\n\n if ($el.is(':input')) {\n var type = $el.prop('type');\n if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {\n run($el, function(){\n // Firefox does not trigger the `focusin` event if the window\n // does not have focus. If the document doesn't have focus just\n // use trigger('focusin') instead.\n if (!document.hasFocus || document.hasFocus()) {\n this.focus();\n } else {\n this.trigger('focusin');\n }\n });\n }\n }\n\n run($el, 'mouseup');\n run($el, 'click');\n\n return wait(app);\n }\n\n function triggerEvent(app, selector, context, type, options){\n if (arguments.length === 3) {\n type = context;\n context = null;\n }\n\n if (typeof options === 'undefined') {\n options = {};\n }\n\n var $el = findWithAssert(app, selector, context);\n\n var event = jQuery.Event(type, options);\n\n run($el, 'trigger', event);\n\n return wait(app);\n }\n\n function keyEvent(app, selector, context, type, keyCode) {\n if (typeof keyCode === 'undefined') {\n keyCode = type;\n type = context;\n context = null;\n }\n\n return triggerEvent(app, selector, context, type, { keyCode: keyCode, which: keyCode });\n }\n\n function fillIn(app, selector, context, text) {\n var $el;\n if (typeof text === 'undefined') {\n text = context;\n context = null;\n }\n $el = findWithAssert(app, selector, context);\n run(function() {\n $el.val(text).change();\n });\n return wait(app);\n }\n\n function findWithAssert(app, selector, context) {\n var $el = find(app, selector, context);\n if ($el.length === 0) {\n throw new EmberError(\"Element \" + selector + \" not found.\");\n }\n return $el;\n }\n\n function find(app, selector, context) {\n var $el;\n context = context || get(app, 'rootElement');\n $el = app.$(selector, context);\n\n return $el;\n }\n\n function andThen(app, callback) {\n return wait(app, callback(app));\n }\n\n function wait(app, value) {\n return Test.promise(function(resolve) {\n // If this is the first async promise, kick off the async test\n if (++countAsync === 1) {\n Test.adapter.asyncStart();\n }\n\n // Every 10ms, poll for the async thing to have finished\n var watcher = setInterval(function() {\n // 1. If the router is loading, keep polling\n var routerIsLoading = !!app.__container__.lookup('router:main').router.activeTransition;\n if (routerIsLoading) { return; }\n\n // 2. If there are pending Ajax requests, keep polling\n if (Test.pendingAjaxRequests) { return; }\n\n // 3. If there are scheduled timers or we are inside of a run loop, keep polling\n if (run.hasScheduledTimers() || run.currentRunLoop) { return; }\n if (Test.waiters && Test.waiters.any(function(waiter) {\n var context = waiter[0];\n var callback = waiter[1];\n return !callback.call(context);\n })) { return; }\n // Stop polling\n clearInterval(watcher);\n\n // If this is the last async promise, end the async test\n if (--countAsync === 0) {\n Test.adapter.asyncEnd();\n }\n\n // Synchronously resolve the promise\n run(null, resolve, value);\n }, 10);\n });\n\n }\n\n\n /**\n * Loads a route, sets up any controllers, and renders any templates associated\n * with the route as though a real user had triggered the route change while\n * using your app.\n *\n * Example:\n *\n * ```javascript\n * visit('posts/index').then(function() {\n * // assert something\n * });\n * ```\n *\n * @method visit\n * @param {String} url the name of the route\n * @return {RSVP.Promise}\n */\n asyncHelper('visit', visit);\n\n /**\n * Clicks an element and triggers any actions triggered by the element's `click`\n * event.\n *\n * Example:\n *\n * ```javascript\n * click('.some-jQuery-selector').then(function() {\n * // assert something\n * });\n * ```\n *\n * @method click\n * @param {String} selector jQuery selector for finding element on the DOM\n * @return {RSVP.Promise}\n */\n asyncHelper('click', click);\n\n /**\n * Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode\n *\n * Example:\n *\n * ```javascript\n * keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {\n * // assert something\n * });\n * ```\n *\n * @method keyEvent\n * @param {String} selector jQuery selector for finding element on the DOM\n * @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup`\n * @param {Number} keyCode the keyCode of the simulated key event\n * @return {RSVP.Promise}\n * @since 1.5.0\n */\n asyncHelper('keyEvent', keyEvent);\n\n /**\n * Fills in an input element with some text.\n *\n * Example:\n *\n * ```javascript\n * fillIn('#email', 'you@example.com').then(function() {\n * // assert something\n * });\n * ```\n *\n * @method fillIn\n * @param {String} selector jQuery selector finding an input element on the DOM\n * to fill text with\n * @param {String} text text to place inside the input element\n * @return {RSVP.Promise}\n */\n asyncHelper('fillIn', fillIn);\n\n /**\n * Finds an element in the context of the app's container element. A simple alias\n * for `app.$(selector)`.\n *\n * Example:\n *\n * ```javascript\n * var $el = find('.my-selector');\n * ```\n *\n * @method find\n * @param {String} selector jQuery string selector for element lookup\n * @return {Object} jQuery object representing the results of the query\n */\n helper('find', find);\n\n /**\n * Like `find`, but throws an error if the element selector returns no results.\n *\n * Example:\n *\n * ```javascript\n * var $el = findWithAssert('.doesnt-exist'); // throws error\n * ```\n *\n * @method findWithAssert\n * @param {String} selector jQuery selector string for finding an element within\n * the DOM\n * @return {Object} jQuery object representing the results of the query\n * @throws {Error} throws error if jQuery object returned has a length of 0\n */\n helper('findWithAssert', findWithAssert);\n\n /**\n Causes the run loop to process any pending events. This is used to ensure that\n any async operations from other helpers (or your assertions) have been processed.\n\n This is most often used as the return value for the helper functions (see 'click',\n 'fillIn','visit',etc).\n\n Example:\n\n ```javascript\n Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) {\n visit('secured/path/here')\n .fillIn('#username', username)\n .fillIn('#password', username)\n .click('.submit')\n\n return wait();\n });\n\n @method wait\n @param {Object} value The value to be returned.\n @return {RSVP.Promise}\n */\n asyncHelper('wait', wait);\n asyncHelper('andThen', andThen);\n\n\n /**\n Returns the currently active route name.\n\n Example:\n\n ```javascript\n function validateRouteName(){\n equal(currentRouteName(), 'some.path', \"correct route was transitioned into.\");\n }\n\n visit('/some/path').then(validateRouteName)\n ```\n\n @method currentRouteName\n @return {Object} The name of the currently active route.\n @since 1.5.0\n */\n helper('currentRouteName', currentRouteName);\n\n /**\n Returns the current path.\n\n Example:\n\n ```javascript\n function validateURL(){\n equal(currentPath(), 'some.path.index', \"correct path was transitioned into.\");\n }\n\n click('#some-link-id').then(validateURL);\n ```\n\n @method currentPath\n @return {Object} The currently active path.\n @since 1.5.0\n */\n helper('currentPath', currentPath);\n\n /**\n Returns the current URL.\n\n Example:\n\n ```javascript\n function validateURL(){\n equal(currentURL(), '/some/path', \"correct URL was transitioned into.\");\n }\n\n click('#some-link-id').then(validateURL);\n ```\n\n @method currentURL\n @return {Object} The currently active URL.\n @since 1.5.0\n */\n helper('currentURL', currentURL);\n\n /**\n Triggers the given event on the element identified by the provided selector.\n\n Example:\n\n ```javascript\n triggerEvent('#some-elem-id', 'blur');\n ```\n\n This is actually used internally by the `keyEvent` helper like so:\n\n ```javascript\n triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 });\n ```\n\n @method triggerEvent\n @param {String} selector jQuery selector for finding element on the DOM\n @param {String} type The event type to be triggered.\n @param {String} options The options to be passed to jQuery.Event.\n @return {RSVP.Promise}\n @since 1.5.0\n */\n asyncHelper('triggerEvent', triggerEvent);\n });\ndefine(\"ember-testing/initializers\",\n [\"ember-runtime/system/lazy_load\"],\n function(__dependency1__) {\n \"use strict\";\n var onLoad = __dependency1__.onLoad;\n\n var name = 'deferReadiness in `testing` mode';\n\n onLoad('Ember.Application', function(Application) {\n if (!Application.initializers[name]) {\n Application.initializer({\n name: name,\n\n initialize: function(container, application){\n if (application.testing) {\n application.deferReadiness();\n }\n }\n });\n }\n });\n });\ndefine(\"ember-testing\",\n [\"ember-metal/core\",\"ember-testing/initializers\",\"ember-testing/support\",\"ember-testing/setup_for_testing\",\"ember-testing/test\",\"ember-testing/adapters/adapter\",\"ember-testing/adapters/qunit\",\"ember-testing/helpers\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n\n // to setup initializer\n // to handle various edge cases\n\n var setupForTesting = __dependency4__[\"default\"];\n var Test = __dependency5__[\"default\"];\n var Adapter = __dependency6__[\"default\"];\n var QUnitAdapter = __dependency7__[\"default\"];\n // adds helpers to helpers object in Test\n\n /**\n Ember Testing\n\n @module ember\n @submodule ember-testing\n @requires ember-application\n */\n\n Ember.Test = Test;\n Ember.Test.Adapter = Adapter;\n Ember.Test.QUnitAdapter = QUnitAdapter;\n Ember.setupForTesting = setupForTesting;\n });\ndefine(\"ember-testing/setup_for_testing\",\n [\"ember-metal/core\",\"ember-testing/adapters/qunit\",\"ember-views/system/jquery\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // import Test from \"ember-testing/test\"; // ES6TODO: fix when cycles are supported\n var QUnitAdapter = __dependency2__[\"default\"];\n var jQuery = __dependency3__[\"default\"];\n\n var Test;\n\n function incrementAjaxPendingRequests(){\n Test.pendingAjaxRequests++;\n }\n\n function decrementAjaxPendingRequests(){\n Ember.assert(\"An ajaxComplete event which would cause the number of pending AJAX \" +\n \"requests to be negative has been triggered. This is most likely \" +\n \"caused by AJAX events that were started before calling \" +\n \"`injectTestHelpers()`.\", Test.pendingAjaxRequests !== 0);\n Test.pendingAjaxRequests--;\n }\n\n /**\n Sets Ember up for testing. This is useful to perform\n basic setup steps in order to unit test.\n\n Use `App.setupForTesting` to perform integration tests (full\n application testing).\n\n @method setupForTesting\n @namespace Ember\n @since 1.5.0\n */\n function setupForTesting() {\n if (!Test) { Test = requireModule('ember-testing/test')['default']; }\n\n Ember.testing = true;\n\n // if adapter is not manually set default to QUnit\n if (!Test.adapter) {\n Test.adapter = QUnitAdapter.create();\n }\n\n if (!Test.pendingAjaxRequests) {\n Test.pendingAjaxRequests = 0;\n }\n\n jQuery(document).off('ajaxSend', incrementAjaxPendingRequests);\n jQuery(document).off('ajaxComplete', decrementAjaxPendingRequests);\n jQuery(document).on('ajaxSend', incrementAjaxPendingRequests);\n jQuery(document).on('ajaxComplete', decrementAjaxPendingRequests);\n };\n\n __exports__[\"default\"] = setupForTesting;\n });\ndefine(\"ember-testing/support\",\n [\"ember-metal/core\",\"ember-views/system/jquery\"],\n function(__dependency1__, __dependency2__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var jQuery = __dependency2__[\"default\"];\n\n /**\n @module ember\n @submodule ember-testing\n */\n\n var $ = jQuery;\n\n /**\n This method creates a checkbox and triggers the click event to fire the\n passed in handler. It is used to correct for a bug in older versions\n of jQuery (e.g 1.8.3).\n\n @private\n @method testCheckboxClick\n */\n function testCheckboxClick(handler) {\n $('<input type=\"checkbox\">')\n .css({ position: 'absolute', left: '-1000px', top: '-1000px' })\n .appendTo('body')\n .on('click', handler)\n .trigger('click')\n .remove();\n }\n\n $(function() {\n /*\n Determine whether a checkbox checked using jQuery's \"click\" method will have\n the correct value for its checked property.\n\n If we determine that the current jQuery version exhibits this behavior,\n patch it to work correctly as in the commit for the actual fix:\n https://github.com/jquery/jquery/commit/1fb2f92.\n */\n testCheckboxClick(function() {\n if (!this.checked && !$.event.special.click) {\n $.event.special.click = {\n // For checkbox, fire native event so checked state will be right\n trigger: function() {\n if ($.nodeName( this, \"input\" ) && this.type === \"checkbox\" && this.click) {\n this.click();\n return false;\n }\n }\n };\n }\n });\n\n // Try again to verify that the patch took effect or blow up.\n testCheckboxClick(function() {\n Ember.warn(\"clicked checkboxes should be checked! the jQuery patch didn't work\", this.checked);\n });\n });\n });\ndefine(\"ember-testing/test\",\n [\"ember-metal/core\",\"ember-metal/run_loop\",\"ember-metal/platform\",\"ember-runtime/compare\",\"ember-runtime/ext/rsvp\",\"ember-testing/setup_for_testing\",\"ember-application/system/application\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n var emberRun = __dependency2__[\"default\"];\n var create = __dependency3__.create;\n var compare = __dependency4__[\"default\"];\n var RSVP = __dependency5__[\"default\"];\n var setupForTesting = __dependency6__[\"default\"];\n var EmberApplication = __dependency7__[\"default\"];\n\n /**\n @module ember\n @submodule ember-testing\n */\n var slice = [].slice,\n helpers = {},\n injectHelpersCallbacks = [];\n\n /**\n This is a container for an assortment of testing related functionality:\n\n * Choose your default test adapter (for your framework of choice).\n * Register/Unregister additional test helpers.\n * Setup callbacks to be fired when the test helpers are injected into\n your application.\n\n @class Test\n @namespace Ember\n */\n var Test = {\n\n /**\n `registerHelper` is used to register a test helper that will be injected\n when `App.injectTestHelpers` is called.\n\n The helper method will always be called with the current Application as\n the first parameter.\n\n For example:\n\n ```javascript\n Ember.Test.registerHelper('boot', function(app) {\n Ember.run(app, app.advanceReadiness);\n });\n ```\n\n This helper can later be called without arguments because it will be\n called with `app` as the first parameter.\n\n ```javascript\n App = Ember.Application.create();\n App.injectTestHelpers();\n boot();\n ```\n\n @public\n @method registerHelper\n @param {String} name The name of the helper method to add.\n @param {Function} helperMethod\n @param options {Object}\n */\n registerHelper: function(name, helperMethod) {\n helpers[name] = {\n method: helperMethod,\n meta: { wait: false }\n };\n },\n\n /**\n `registerAsyncHelper` is used to register an async test helper that will be injected\n when `App.injectTestHelpers` is called.\n\n The helper method will always be called with the current Application as\n the first parameter.\n\n For example:\n\n ```javascript\n Ember.Test.registerAsyncHelper('boot', function(app) {\n Ember.run(app, app.advanceReadiness);\n });\n ```\n\n The advantage of an async helper is that it will not run\n until the last async helper has completed. All async helpers\n after it will wait for it complete before running.\n\n\n For example:\n\n ```javascript\n Ember.Test.registerAsyncHelper('deletePost', function(app, postId) {\n click('.delete-' + postId);\n });\n\n // ... in your test\n visit('/post/2');\n deletePost(2);\n visit('/post/3');\n deletePost(3);\n ```\n\n @public\n @method registerAsyncHelper\n @param {String} name The name of the helper method to add.\n @param {Function} helperMethod\n @since 1.2.0\n */\n registerAsyncHelper: function(name, helperMethod) {\n helpers[name] = {\n method: helperMethod,\n meta: { wait: true }\n };\n },\n\n /**\n Remove a previously added helper method.\n\n Example:\n\n ```javascript\n Ember.Test.unregisterHelper('wait');\n ```\n\n @public\n @method unregisterHelper\n @param {String} name The helper to remove.\n */\n unregisterHelper: function(name) {\n delete helpers[name];\n delete Test.Promise.prototype[name];\n },\n\n /**\n Used to register callbacks to be fired whenever `App.injectTestHelpers`\n is called.\n\n The callback will receive the current application as an argument.\n\n Example:\n\n ```javascript\n Ember.Test.onInjectHelpers(function() {\n Ember.$(document).ajaxSend(function() {\n Test.pendingAjaxRequests++;\n });\n\n Ember.$(document).ajaxComplete(function() {\n Test.pendingAjaxRequests--;\n });\n });\n ```\n\n @public\n @method onInjectHelpers\n @param {Function} callback The function to be called.\n */\n onInjectHelpers: function(callback) {\n injectHelpersCallbacks.push(callback);\n },\n\n /**\n This returns a thenable tailored for testing. It catches failed\n `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception`\n callback in the last chained then.\n\n This method should be returned by async helpers such as `wait`.\n\n @public\n @method promise\n @param {Function} resolver The function used to resolve the promise.\n */\n promise: function(resolver) {\n return new Test.Promise(resolver);\n },\n\n /**\n Used to allow ember-testing to communicate with a specific testing\n framework.\n\n You can manually set it before calling `App.setupForTesting()`.\n\n Example:\n\n ```javascript\n Ember.Test.adapter = MyCustomAdapter.create()\n ```\n\n If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`.\n\n @public\n @property adapter\n @type {Class} The adapter to be used.\n @default Ember.Test.QUnitAdapter\n */\n adapter: null,\n\n /**\n Replacement for `Ember.RSVP.resolve`\n The only difference is this uses\n and instance of `Ember.Test.Promise`\n\n @public\n @method resolve\n @param {Mixed} The value to resolve\n @since 1.2.0\n */\n resolve: function(val) {\n return Test.promise(function(resolve) {\n return resolve(val);\n });\n },\n\n /**\n This allows ember-testing to play nicely with other asynchronous\n events, such as an application that is waiting for a CSS3\n transition or an IndexDB transaction.\n\n For example:\n\n ```javascript\n Ember.Test.registerWaiter(function() {\n return myPendingTransactions() == 0;\n });\n ```\n The `context` argument allows you to optionally specify the `this`\n with which your callback will be invoked.\n\n For example:\n\n ```javascript\n Ember.Test.registerWaiter(MyDB, MyDB.hasPendingTransactions);\n ```\n\n @public\n @method registerWaiter\n @param {Object} context (optional)\n @param {Function} callback\n @since 1.2.0\n */\n registerWaiter: function(context, callback) {\n if (arguments.length === 1) {\n callback = context;\n context = null;\n }\n if (!this.waiters) {\n this.waiters = Ember.A();\n }\n this.waiters.push([context, callback]);\n },\n /**\n `unregisterWaiter` is used to unregister a callback that was\n registered with `registerWaiter`.\n\n @public\n @method unregisterWaiter\n @param {Object} context (optional)\n @param {Function} callback\n @since 1.2.0\n */\n unregisterWaiter: function(context, callback) {\n var pair;\n if (!this.waiters) { return; }\n if (arguments.length === 1) {\n callback = context;\n context = null;\n }\n pair = [context, callback];\n this.waiters = Ember.A(this.waiters.filter(function(elt) {\n return compare(elt, pair)!==0;\n }));\n }\n };\n\n function helper(app, name) {\n var fn = helpers[name].method,\n meta = helpers[name].meta;\n\n return function() {\n var args = slice.call(arguments),\n lastPromise = Test.lastPromise;\n\n args.unshift(app);\n\n // some helpers are not async and\n // need to return a value immediately.\n // example: `find`\n if (!meta.wait) {\n return fn.apply(app, args);\n }\n\n if (!lastPromise) {\n // It's the first async helper in current context\n lastPromise = fn.apply(app, args);\n } else {\n // wait for last helper's promise to resolve\n // and then execute\n run(function() {\n lastPromise = Test.resolve(lastPromise).then(function() {\n return fn.apply(app, args);\n });\n });\n }\n\n return lastPromise;\n };\n }\n\n function run(fn) {\n if (!emberRun.currentRunLoop) {\n emberRun(fn);\n } else {\n fn();\n }\n }\n\n EmberApplication.reopen({\n /**\n This property contains the testing helpers for the current application. These\n are created once you call `injectTestHelpers` on your `Ember.Application`\n instance. The included helpers are also available on the `window` object by\n default, but can be used from this object on the individual application also.\n\n @property testHelpers\n @type {Object}\n @default {}\n */\n testHelpers: {},\n\n /**\n This property will contain the original methods that were registered\n on the `helperContainer` before `injectTestHelpers` is called.\n\n When `removeTestHelpers` is called, these methods are restored to the\n `helperContainer`.\n\n @property originalMethods\n @type {Object}\n @default {}\n @private\n @since 1.3.0\n */\n originalMethods: {},\n\n\n /**\n This property indicates whether or not this application is currently in\n testing mode. This is set when `setupForTesting` is called on the current\n application.\n\n @property testing\n @type {Boolean}\n @default false\n @since 1.3.0\n */\n testing: false,\n\n /**\n This hook defers the readiness of the application, so that you can start\n the app when your tests are ready to run. It also sets the router's\n location to 'none', so that the window's location will not be modified\n (preventing both accidental leaking of state between tests and interference\n with your testing framework).\n\n Example:\n\n ```\n App.setupForTesting();\n ```\n\n @method setupForTesting\n */\n setupForTesting: function() {\n setupForTesting();\n\n this.testing = true;\n\n this.Router.reopen({\n location: 'none'\n });\n },\n\n /**\n This will be used as the container to inject the test helpers into. By\n default the helpers are injected into `window`.\n\n @property helperContainer\n @type {Object} The object to be used for test helpers.\n @default window\n @since 1.2.0\n */\n helperContainer: window,\n\n /**\n This injects the test helpers into the `helperContainer` object. If an object is provided\n it will be used as the helperContainer. If `helperContainer` is not set it will default\n to `window`. If a function of the same name has already been defined it will be cached\n (so that it can be reset if the helper is removed with `unregisterHelper` or\n `removeTestHelpers`).\n\n Any callbacks registered with `onInjectHelpers` will be called once the\n helpers have been injected.\n\n Example:\n ```\n App.injectTestHelpers();\n ```\n\n @method injectTestHelpers\n */\n injectTestHelpers: function(helperContainer) {\n if (helperContainer) { this.helperContainer = helperContainer; }\n\n this.testHelpers = {};\n for (var name in helpers) {\n this.originalMethods[name] = this.helperContainer[name];\n this.testHelpers[name] = this.helperContainer[name] = helper(this, name);\n protoWrap(Test.Promise.prototype, name, helper(this, name), helpers[name].meta.wait);\n }\n\n for(var i = 0, l = injectHelpersCallbacks.length; i < l; i++) {\n injectHelpersCallbacks[i](this);\n }\n },\n\n /**\n This removes all helpers that have been registered, and resets and functions\n that were overridden by the helpers.\n\n Example:\n\n ```javascript\n App.removeTestHelpers();\n ```\n\n @public\n @method removeTestHelpers\n */\n removeTestHelpers: function() {\n for (var name in helpers) {\n this.helperContainer[name] = this.originalMethods[name];\n delete this.testHelpers[name];\n delete this.originalMethods[name];\n }\n }\n });\n\n // This method is no longer needed\n // But still here for backwards compatibility\n // of helper chaining\n function protoWrap(proto, name, callback, isAsync) {\n proto[name] = function() {\n var args = arguments;\n if (isAsync) {\n return callback.apply(this, args);\n } else {\n return this.then(function() {\n return callback.apply(this, args);\n });\n }\n };\n }\n\n Test.Promise = function() {\n RSVP.Promise.apply(this, arguments);\n Test.lastPromise = this;\n };\n\n Test.Promise.prototype = create(RSVP.Promise.prototype);\n Test.Promise.prototype.constructor = Test.Promise;\n\n // Patch `then` to isolate async methods\n // specifically `Ember.Test.lastPromise`\n var originalThen = RSVP.Promise.prototype.then;\n Test.Promise.prototype.then = function(onSuccess, onFailure) {\n return originalThen.call(this, function(val) {\n return isolate(onSuccess, val);\n }, onFailure);\n };\n\n // This method isolates nested async methods\n // so that they don't conflict with other last promises.\n //\n // 1. Set `Ember.Test.lastPromise` to null\n // 2. Invoke method\n // 3. Return the last promise created during method\n // 4. Restore `Ember.Test.lastPromise` to original value\n function isolate(fn, val) {\n var value, lastPromise;\n\n // Reset lastPromise for nested helpers\n Test.lastPromise = null;\n\n value = fn(val);\n\n lastPromise = Test.lastPromise;\n\n // If the method returned a promise\n // return that promise. If not,\n // return the last async helper's promise\n if ((value && (value instanceof Test.Promise)) || !lastPromise) {\n return value;\n } else {\n run(function() {\n lastPromise = Test.resolve(lastPromise).then(function() {\n return value;\n });\n });\n return lastPromise;\n }\n }\n\n __exports__[\"default\"] = Test;\n });\n})();\n//@ sourceURL=ember-testing");minispade.register('ember-views', "(function() {minispade.require(\"ember-runtime\");\ndefine(\"ember-views\",\n [\"ember-runtime\",\"ember-views/system/jquery\",\"ember-views/system/utils\",\"ember-views/system/render_buffer\",\"ember-views/system/ext\",\"ember-views/views/states\",\"ember-views/views/view\",\"ember-views/views/container_view\",\"ember-views/views/collection_view\",\"ember-views/views/component\",\"ember-views/system/event_dispatcher\",\"ember-views/mixins/view_target_action_support\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {\n \"use strict\";\n /**\n Ember Views\n\n @module ember\n @submodule ember-views\n @requires ember-runtime\n @main ember-views\n */\n\n // BEGIN IMPORTS\n var Ember = __dependency1__[\"default\"];\n var jQuery = __dependency2__[\"default\"];\n var setInnerHTML = __dependency3__.setInnerHTML;\n var isSimpleClick = __dependency3__.isSimpleClick;\n var RenderBuffer = __dependency4__[\"default\"];\n // for the side effect of extending Ember.run.queues\n var cloneStates = __dependency6__.cloneStates;\n var states = __dependency6__.states;\n\n var CoreView = __dependency7__.CoreView;\n var View = __dependency7__.View;\n var ViewCollection = __dependency7__.ViewCollection;\n var ContainerView = __dependency8__[\"default\"];\n var CollectionView = __dependency9__[\"default\"];\n var Component = __dependency10__[\"default\"];\n\n var EventDispatcher = __dependency11__[\"default\"];\n var ViewTargetActionSupport = __dependency12__[\"default\"];\n // END IMPORTS\n\n /**\n Alias for jQuery\n\n @method $\n @for Ember\n */\n\n // BEGIN EXPORTS\n Ember.$ = jQuery;\n\n Ember.ViewTargetActionSupport = ViewTargetActionSupport;\n Ember.RenderBuffer = RenderBuffer;\n\n var ViewUtils = Ember.ViewUtils = {};\n ViewUtils.setInnerHTML = setInnerHTML;\n ViewUtils.isSimpleClick = isSimpleClick;\n\n Ember.CoreView = CoreView;\n Ember.View = View;\n Ember.View.states = states;\n Ember.View.cloneStates = cloneStates;\n\n Ember._ViewCollection = ViewCollection;\n Ember.ContainerView = ContainerView;\n Ember.CollectionView = CollectionView;\n Ember.Component = Component;\n Ember.EventDispatcher = EventDispatcher;\n // END EXPORTS\n\n __exports__[\"default\"] = Ember;\n });\ndefine(\"ember-views/mixins/component_template_deprecation\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/mixin\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.deprecate\n var get = __dependency2__.get;\n var Mixin = __dependency3__.Mixin;\n\n /**\n The ComponentTemplateDeprecation mixin is used to provide a useful\n deprecation warning when using either `template` or `templateName` with\n a component. The `template` and `templateName` properties specified at\n extend time are moved to `layout` and `layoutName` respectively.\n\n `Ember.ComponentTemplateDeprecation` is used internally by Ember in\n `Ember.Component`.\n\n @class ComponentTemplateDeprecation\n @namespace Ember\n */\n var ComponentTemplateDeprecation = Mixin.create({\n /**\n @private\n\n Moves `templateName` to `layoutName` and `template` to `layout` at extend\n time if a layout is not also specified.\n\n Note that this currently modifies the mixin themselves, which is technically\n dubious but is practically of little consequence. This may change in the\n future.\n\n @method willMergeMixin\n @since 1.4.0\n */\n willMergeMixin: function(props) {\n // must call _super here to ensure that the ActionHandler\n // mixin is setup properly (moves actions -> _actions)\n //\n // Calling super is only OK here since we KNOW that\n // there is another Mixin loaded first.\n this._super.apply(this, arguments);\n\n var deprecatedProperty, replacementProperty,\n layoutSpecified = (props.layoutName || props.layout || get(this, 'layoutName'));\n\n if (props.templateName && !layoutSpecified) {\n deprecatedProperty = 'templateName';\n replacementProperty = 'layoutName';\n\n props.layoutName = props.templateName;\n delete props['templateName'];\n }\n\n if (props.template && !layoutSpecified) {\n deprecatedProperty = 'template';\n replacementProperty = 'layout';\n\n props.layout = props.template;\n delete props['template'];\n }\n\n if (deprecatedProperty) {\n Ember.deprecate('Do not specify ' + deprecatedProperty + ' on a Component, use ' + replacementProperty + ' instead.', false);\n }\n }\n });\n\n __exports__[\"default\"] = ComponentTemplateDeprecation;\n });\ndefine(\"ember-views/mixins/view_target_action_support\",\n [\"ember-metal/mixin\",\"ember-runtime/mixins/target_action_support\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Mixin = __dependency1__.Mixin;\n var TargetActionSupport = __dependency2__[\"default\"];\n\n // ES6TODO: computed should have its own export path so you can do import {defaultTo} from computed\n var computed = __dependency3__.computed;\n var alias = computed.alias;\n\n /**\n `Ember.ViewTargetActionSupport` is a mixin that can be included in a\n view class to add a `triggerAction` method with semantics similar to\n the Handlebars `{{action}}` helper. It provides intelligent defaults\n for the action's target: the view's controller; and the context that is\n sent with the action: the view's context.\n\n Note: In normal Ember usage, the `{{action}}` helper is usually the best\n choice. This mixin is most often useful when you are doing more complex\n event handling in custom View subclasses.\n\n For example:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n action: 'save',\n click: function() {\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `action` can be provided as properties of an optional object argument\n to `triggerAction` as well.\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n click: function() {\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n @class ViewTargetActionSupport\n @namespace Ember\n @extends Ember.TargetActionSupport\n */\n var ViewTargetActionSupport = Mixin.create(TargetActionSupport, {\n /**\n @property target\n */\n target: alias('controller'),\n /**\n @property actionContext\n */\n actionContext: alias('context')\n });\n\n __exports__[\"default\"] = ViewTargetActionSupport;\n });\ndefine(\"ember-views/system/event_dispatcher\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/is_none\",\"ember-metal/run_loop\",\"ember-metal/utils\",\"ember-runtime/system/string\",\"ember-runtime/system/object\",\"ember-views/system/jquery\",\"ember-views/views/view\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-views\n */\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var isNone = __dependency4__.isNone;\n var run = __dependency5__[\"default\"];\n var typeOf = __dependency6__.typeOf;\n var fmt = __dependency7__.fmt;\n var EmberObject = __dependency8__[\"default\"];\n var jQuery = __dependency9__[\"default\"];\n var View = __dependency10__.View;\n\n var ActionHelper;\n\n //ES6TODO:\n // find a better way to do Ember.View.views without global state\n\n /**\n `Ember.EventDispatcher` handles delegating browser events to their\n corresponding `Ember.Views.` For example, when you click on a view,\n `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets\n called.\n\n @class EventDispatcher\n @namespace Ember\n @private\n @extends Ember.Object\n */\n var EventDispatcher = EmberObject.extend({\n\n /**\n The set of events names (and associated handler function names) to be setup\n and dispatched by the `EventDispatcher`. Custom events can added to this list at setup\n time, generally via the `Ember.Application.customEvents` hash. Only override this\n default set to prevent the EventDispatcher from listening on some events all together.\n\n This set will be modified by `setup` to also include any events added at that time.\n\n @property events\n @type Object\n */\n events: {\n touchstart : 'touchStart',\n touchmove : 'touchMove',\n touchend : 'touchEnd',\n touchcancel : 'touchCancel',\n keydown : 'keyDown',\n keyup : 'keyUp',\n keypress : 'keyPress',\n mousedown : 'mouseDown',\n mouseup : 'mouseUp',\n contextmenu : 'contextMenu',\n click : 'click',\n dblclick : 'doubleClick',\n mousemove : 'mouseMove',\n focusin : 'focusIn',\n focusout : 'focusOut',\n mouseenter : 'mouseEnter',\n mouseleave : 'mouseLeave',\n submit : 'submit',\n input : 'input',\n change : 'change',\n dragstart : 'dragStart',\n drag : 'drag',\n dragenter : 'dragEnter',\n dragleave : 'dragLeave',\n dragover : 'dragOver',\n drop : 'drop',\n dragend : 'dragEnd'\n },\n\n /**\n The root DOM element to which event listeners should be attached. Event\n listeners will be attached to the document unless this is overridden.\n\n Can be specified as a DOMElement or a selector string.\n\n The default body is a string since this may be evaluated before document.body\n exists in the DOM.\n\n @private\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n Sets up event listeners for standard browser events.\n\n This will be called after the browser sends a `DOMContentReady` event. By\n default, it will set up all of the listeners on the document body. If you\n would like to register the listeners on a different element, set the event\n dispatcher's `root` property.\n\n @private\n @method setup\n @param addedEvents {Hash}\n */\n setup: function(addedEvents, rootElement) {\n var event, events = get(this, 'events');\n\n jQuery.extend(events, addedEvents || {});\n\n\n if (!isNone(rootElement)) {\n set(this, 'rootElement', rootElement);\n }\n\n rootElement = jQuery(get(this, 'rootElement'));\n\n Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));\n Ember.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length);\n Ember.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length);\n\n rootElement.addClass('ember-application');\n\n Ember.assert('Unable to add \"ember-application\" class to rootElement. Make sure you set rootElement to the body or an element in the body.', rootElement.is('.ember-application'));\n\n for (event in events) {\n if (events.hasOwnProperty(event)) {\n this.setupHandler(rootElement, event, events[event]);\n }\n }\n },\n\n /**\n Registers an event listener on the document. If the given event is\n triggered, the provided event handler will be triggered on the target view.\n\n If the target view does not implement the event handler, or if the handler\n returns `false`, the parent view will be called. The event will continue to\n bubble to each successive parent view until it reaches the top.\n\n For example, to have the `mouseDown` method called on the target view when\n a `mousedown` event is received from the browser, do the following:\n\n ```javascript\n setupHandler('mousedown', 'mouseDown');\n ```\n\n @private\n @method setupHandler\n @param {Element} rootElement\n @param {String} event the browser-originated event to listen to\n @param {String} eventName the name of the method to call on the view\n */\n setupHandler: function(rootElement, event, eventName) {\n var self = this;\n\n rootElement.on(event + '.ember', '.ember-view', function(evt, triggeringManager) {\n var view = View.views[this.id],\n result = true, manager = null;\n\n manager = self._findNearestEventManager(view, eventName);\n\n if (manager && manager !== triggeringManager) {\n result = self._dispatchEvent(manager, evt, eventName, view);\n } else if (view) {\n result = self._bubbleEvent(view, evt, eventName);\n } else {\n evt.stopPropagation();\n }\n\n return result;\n });\n\n rootElement.on(event + '.ember', '[data-ember-action]', function(evt) {\n //ES6TODO: Needed for ActionHelper (generally not available in ember-views test suite)\n if (!ActionHelper) { ActionHelper = requireModule(\"ember-routing/helpers/action\")[\"ActionHelper\"]; };\n\n var actionId = jQuery(evt.currentTarget).attr('data-ember-action'),\n action = ActionHelper.registeredActions[actionId];\n\n // We have to check for action here since in some cases, jQuery will trigger\n // an event on `removeChild` (i.e. focusout) after we've already torn down the\n // action handlers for the view.\n if (action && action.eventName === eventName) {\n return action.handler(evt);\n }\n });\n },\n\n _findNearestEventManager: function(view, eventName) {\n var manager = null;\n\n while (view) {\n manager = get(view, 'eventManager');\n if (manager && manager[eventName]) { break; }\n\n view = get(view, 'parentView');\n }\n\n return manager;\n },\n\n _dispatchEvent: function(object, evt, eventName, view) {\n var result = true;\n\n var handler = object[eventName];\n if (typeOf(handler) === 'function') {\n result = run(object, handler, evt, view);\n // Do not preventDefault in eventManagers.\n evt.stopPropagation();\n }\n else {\n result = this._bubbleEvent(view, evt, eventName);\n }\n\n return result;\n },\n\n _bubbleEvent: function(view, evt, eventName) {\n return run(view, view.handleEvent, eventName, evt);\n },\n\n destroy: function() {\n var rootElement = get(this, 'rootElement');\n jQuery(rootElement).off('.ember', '**').removeClass('ember-application');\n return this._super();\n }\n });\n\n __exports__[\"default\"] = EventDispatcher;\n });\ndefine(\"ember-views/system/ext\",\n [\"ember-metal/run_loop\"],\n function(__dependency1__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-views\n */\n\n var run = __dependency1__[\"default\"];\n\n // Add a new named queue for rendering views that happens\n // after bindings have synced, and a queue for scheduling actions\n // that that should occur after view rendering.\n var queues = run.queues;\n run._addQueue('render', 'actions');\n run._addQueue('afterRender', 'render');\n });\ndefine(\"ember-views/system/jquery\",\n [\"ember-metal/core\",\"ember-runtime/system/string\",\"ember-metal/enumerable_utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var w = __dependency2__.w;\n\n // ES6TODO: the functions on EnumerableUtils need their own exports\n var EnumerableUtils = __dependency3__[\"default\"];\n var forEach = EnumerableUtils.forEach;\n\n /**\n Ember Views\n\n @module ember\n @submodule ember-views\n @requires ember-runtime\n @main ember-views\n */\n\n var jQuery = (Ember.imports && Ember.imports.jQuery) || (this && this.jQuery);\n if (!jQuery && typeof require === 'function') {\n jQuery = require('jquery');\n }\n\n Ember.assert(\"Ember Views require jQuery between 1.7 and 2.1\", jQuery && (jQuery().jquery.match(/^((1\\.(7|8|9|10|11))|(2\\.(0|1)))(\\.\\d+)?(pre|rc\\d?)?/) || Ember.ENV.FORCE_JQUERY));\n\n /**\n @module ember\n @submodule ember-views\n */\n if (jQuery) {\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents\n var dragEvents = w('dragstart drag dragenter dragleave dragover drop dragend');\n\n // Copies the `dataTransfer` property from a browser event object onto the\n // jQuery event object for the specified events\n forEach(dragEvents, function(eventName) {\n jQuery.event.fixHooks[eventName] = { props: ['dataTransfer'] };\n });\n }\n\n __exports__[\"default\"] = jQuery;\n });\ndefine(\"ember-views/system/render_buffer\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/system/utils\",\"ember-views/system/jquery\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n /**\n @module ember\n @submodule ember-views\n */\n\n var Ember = __dependency1__[\"default\"];\n // jQuery\n\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var setInnerHTML = __dependency4__.setInnerHTML;\n var jQuery = __dependency5__[\"default\"];\n\n function ClassSet() {\n this.seen = {};\n this.list = [];\n };\n\n\n ClassSet.prototype = {\n add: function(string) {\n if (string in this.seen) { return; }\n this.seen[string] = true;\n\n this.list.push(string);\n },\n\n toDOM: function() {\n return this.list.join(\" \");\n }\n };\n\n var BAD_TAG_NAME_TEST_REGEXP = /[^a-zA-Z0-9\\-]/;\n var BAD_TAG_NAME_REPLACE_REGEXP = /[^a-zA-Z0-9\\-]/g;\n\n function stripTagName(tagName) {\n if (!tagName) {\n return tagName;\n }\n\n if (!BAD_TAG_NAME_TEST_REGEXP.test(tagName)) {\n return tagName;\n }\n\n return tagName.replace(BAD_TAG_NAME_REPLACE_REGEXP, '');\n }\n\n var BAD_CHARS_REGEXP = /&(?!\\w+;)|[<>\"'`]/g;\n var POSSIBLE_CHARS_REGEXP = /[&<>\"'`]/;\n\n function escapeAttribute(value) {\n // Stolen shamelessly from Handlebars\n\n var escape = {\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n \"`\": \"`\"\n };\n\n var escapeChar = function(chr) {\n return escape[chr] || \"&\";\n };\n\n var string = value.toString();\n\n if(!POSSIBLE_CHARS_REGEXP.test(string)) { return string; }\n return string.replace(BAD_CHARS_REGEXP, escapeChar);\n }\n\n // IE 6/7 have bugs around setting names on inputs during creation.\n // From http://msdn.microsoft.com/en-us/library/ie/ms536389(v=vs.85).aspx:\n // \"To include the NAME attribute at run time on objects created with the createElement method, use the eTag.\"\n var canSetNameOnInputs = (function() {\n var div = document.createElement('div'),\n el = document.createElement('input');\n\n el.setAttribute('name', 'foo');\n div.appendChild(el);\n\n return !!div.innerHTML.match('foo');\n })();\n\n /**\n `Ember.RenderBuffer` gathers information regarding the view and generates the\n final representation. `Ember.RenderBuffer` will generate HTML which can be pushed\n to the DOM.\n\n ```javascript\n var buffer = Ember.RenderBuffer('div');\n ```\n\n @class RenderBuffer\n @namespace Ember\n @constructor\n @param {String} tagName tag name (such as 'div' or 'p') used for the buffer\n */\n var RenderBuffer = function(tagName) {\n return new _RenderBuffer(tagName);\n };\n\n var _RenderBuffer = function(tagName) {\n this.tagNames = [tagName || null];\n this.buffer = \"\";\n };\n\n _RenderBuffer.prototype = {\n\n // The root view's element\n _element: null,\n\n _hasElement: true,\n\n /**\n An internal set used to de-dupe class names when `addClass()` is\n used. After each call to `addClass()`, the `classes` property\n will be updated.\n\n @private\n @property elementClasses\n @type Array\n @default null\n */\n elementClasses: null,\n\n /**\n Array of class names which will be applied in the class attribute.\n\n You can use `setClasses()` to set this property directly. If you\n use `addClass()`, it will be maintained for you.\n\n @property classes\n @type Array\n @default null\n */\n classes: null,\n\n /**\n The id in of the element, to be applied in the id attribute.\n\n You should not set this property yourself, rather, you should use\n the `id()` method of `Ember.RenderBuffer`.\n\n @property elementId\n @type String\n @default null\n */\n elementId: null,\n\n /**\n A hash keyed on the name of the attribute and whose value will be\n applied to that attribute. For example, if you wanted to apply a\n `data-view=\"Foo.bar\"` property to an element, you would set the\n elementAttributes hash to `{'data-view':'Foo.bar'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `attr()` method of `Ember.RenderBuffer`.\n\n @property elementAttributes\n @type Hash\n @default {}\n */\n elementAttributes: null,\n\n /**\n A hash keyed on the name of the properties and whose value will be\n applied to that property. For example, if you wanted to apply a\n `checked=true` property to an element, you would set the\n elementProperties hash to `{'checked':true}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `prop()` method of `Ember.RenderBuffer`.\n\n @property elementProperties\n @type Hash\n @default {}\n */\n elementProperties: null,\n\n /**\n The tagname of the element an instance of `Ember.RenderBuffer` represents.\n\n Usually, this gets set as the first parameter to `Ember.RenderBuffer`. For\n example, if you wanted to create a `p` tag, then you would call\n\n ```javascript\n Ember.RenderBuffer('p')\n ```\n\n @property elementTag\n @type String\n @default null\n */\n elementTag: null,\n\n /**\n A hash keyed on the name of the style attribute and whose value will\n be applied to that attribute. For example, if you wanted to apply a\n `background-color:black;` style to an element, you would set the\n elementStyle hash to `{'background-color':'black'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `style()` method of `Ember.RenderBuffer`.\n\n @property elementStyle\n @type Hash\n @default {}\n */\n elementStyle: null,\n\n /**\n Nested `RenderBuffers` will set this to their parent `RenderBuffer`\n instance.\n\n @property parentBuffer\n @type Ember._RenderBuffer\n */\n parentBuffer: null,\n\n /**\n Adds a string of HTML to the `RenderBuffer`.\n\n @method push\n @param {String} string HTML to push into the buffer\n @chainable\n */\n push: function(string) {\n this.buffer += string;\n return this;\n },\n\n /**\n Adds a class to the buffer, which will be rendered to the class attribute.\n\n @method addClass\n @param {String} className Class name to add to the buffer\n @chainable\n */\n addClass: function(className) {\n // lazily create elementClasses\n this.elementClasses = (this.elementClasses || new ClassSet());\n this.elementClasses.add(className);\n this.classes = this.elementClasses.list;\n\n return this;\n },\n\n setClasses: function(classNames) {\n this.elementClasses = null;\n var len = classNames.length, i;\n for (i = 0; i < len; i++) {\n this.addClass(classNames[i]);\n }\n },\n\n /**\n Sets the elementID to be used for the element.\n\n @method id\n @param {String} id\n @chainable\n */\n id: function(id) {\n this.elementId = id;\n return this;\n },\n\n // duck type attribute functionality like jQuery so a render buffer\n // can be used like a jQuery object in attribute binding scenarios.\n\n /**\n Adds an attribute which will be rendered to the element.\n\n @method attr\n @param {String} name The name of the attribute\n @param {String} value The value to add to the attribute\n @chainable\n @return {Ember.RenderBuffer|String} this or the current attribute value\n */\n attr: function(name, value) {\n var attributes = this.elementAttributes = (this.elementAttributes || {});\n\n if (arguments.length === 1) {\n return attributes[name];\n } else {\n attributes[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an attribute from the list of attributes to render.\n\n @method removeAttr\n @param {String} name The name of the attribute\n @chainable\n */\n removeAttr: function(name) {\n var attributes = this.elementAttributes;\n if (attributes) { delete attributes[name]; }\n\n return this;\n },\n\n /**\n Adds a property which will be rendered to the element.\n\n @method prop\n @param {String} name The name of the property\n @param {String} value The value to add to the property\n @chainable\n @return {Ember.RenderBuffer|String} this or the current property value\n */\n prop: function(name, value) {\n var properties = this.elementProperties = (this.elementProperties || {});\n\n if (arguments.length === 1) {\n return properties[name];\n } else {\n properties[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an property from the list of properties to render.\n\n @method removeProp\n @param {String} name The name of the property\n @chainable\n */\n removeProp: function(name) {\n var properties = this.elementProperties;\n if (properties) { delete properties[name]; }\n\n return this;\n },\n\n /**\n Adds a style to the style attribute which will be rendered to the element.\n\n @method style\n @param {String} name Name of the style\n @param {String} value\n @chainable\n */\n style: function(name, value) {\n this.elementStyle = (this.elementStyle || {});\n\n this.elementStyle[name] = value;\n return this;\n },\n\n begin: function(tagName) {\n this.tagNames.push(tagName || null);\n return this;\n },\n\n pushOpeningTag: function() {\n var tagName = this.currentTagName();\n if (!tagName) { return; }\n\n if (this._hasElement && !this._element && this.buffer.length === 0) {\n this._element = this.generateElement();\n return;\n }\n\n var buffer = this.buffer,\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n attr, prop;\n\n buffer += '<' + stripTagName(tagName);\n\n if (id) {\n buffer += ' id=\"' + escapeAttribute(id) + '\"';\n this.elementId = null;\n }\n if (classes) {\n buffer += ' class=\"' + escapeAttribute(classes.join(' ')) + '\"';\n this.classes = null;\n this.elementClasses = null;\n }\n\n if (style) {\n buffer += ' style=\"';\n\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n buffer += prop + ':' + escapeAttribute(style[prop]) + ';';\n }\n }\n\n buffer += '\"';\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n buffer += ' ' + attr + '=\"' + escapeAttribute(attrs[attr]) + '\"';\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n var value = props[prop];\n if (value || typeof(value) === 'number') {\n if (value === true) {\n buffer += ' ' + prop + '=\"' + prop + '\"';\n } else {\n buffer += ' ' + prop + '=\"' + escapeAttribute(props[prop]) + '\"';\n }\n }\n }\n }\n\n this.elementProperties = null;\n }\n\n buffer += '>';\n this.buffer = buffer;\n },\n\n pushClosingTag: function() {\n var tagName = this.tagNames.pop();\n if (tagName) { this.buffer += '</' + stripTagName(tagName) + '>'; }\n },\n\n currentTagName: function() {\n return this.tagNames[this.tagNames.length-1];\n },\n\n generateElement: function() {\n var tagName = this.tagNames.pop(), // pop since we don't need to close\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n styleBuffer = '', attr, prop, tagString;\n\n if (attrs && attrs.name && !canSetNameOnInputs) {\n // IE allows passing a tag to createElement. See note on `canSetNameOnInputs` above as well.\n tagString = '<'+stripTagName(tagName)+' name=\"'+escapeAttribute(attrs.name)+'\">';\n } else {\n tagString = tagName;\n }\n\n var element = document.createElement(tagString),\n $element = jQuery(element);\n\n if (id) {\n $element.attr('id', id);\n this.elementId = null;\n }\n if (classes) {\n $element.attr('class', classes.join(' '));\n this.classes = null;\n this.elementClasses = null;\n }\n\n if (style) {\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n styleBuffer += (prop + ':' + style[prop] + ';');\n }\n }\n\n $element.attr('style', styleBuffer);\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n $element.attr(attr, attrs[attr]);\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n $element.prop(prop, props[prop]);\n }\n }\n\n this.elementProperties = null;\n }\n\n return element;\n },\n\n /**\n @method element\n @return {DOMElement} The element corresponding to the generated HTML\n of this buffer\n */\n element: function() {\n var html = this.innerString();\n\n if (html) {\n this._element = setInnerHTML(this._element, html);\n }\n\n return this._element;\n },\n\n /**\n Generates the HTML content for this buffer.\n\n @method string\n @return {String} The generated HTML\n */\n string: function() {\n if (this._hasElement && this._element) {\n // Firefox versions < 11 do not have support for element.outerHTML.\n var thisElement = this.element(), outerHTML = thisElement.outerHTML;\n if (typeof outerHTML === 'undefined') {\n return jQuery('<div/>').append(thisElement).html();\n }\n return outerHTML;\n } else {\n return this.innerString();\n }\n },\n\n innerString: function() {\n return this.buffer;\n }\n };\n\n __exports__[\"default\"] = RenderBuffer;\n });\ndefine(\"ember-views/system/utils\",\n [\"ember-metal/core\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n\n /**\n @module ember\n @submodule ember-views\n */\n\n /* BEGIN METAMORPH HELPERS */\n\n // Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n // is a \"zero-scope\" element. This problem can be worked around by making\n // the first node an invisible text node. We, like Modernizr, use ­\n\n var needsShy = typeof document !== 'undefined' && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n })();\n\n // IE 8 (and likely earlier) likes to move whitespace preceeding\n // a script tag to appear after it. This means that we can\n // accidentally remove whitespace when updating a morph.\n var movesWhitespace = typeof document !== 'undefined' && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n })();\n\n // Use this to find children by ID instead of using jQuery\n var findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n };\n\n var setInnerHTMLWithoutFix = function(element, html) {\n if (needsShy) {\n html = '­' + html;\n }\n\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n\n if (needsShy) {\n var shyElement = element.firstChild;\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n };\n\n /* END METAMORPH HELPERS */\n\n\n var innerHTMLTags = {};\n var canSetInnerHTML = function(tagName) {\n if (innerHTMLTags[tagName] !== undefined) {\n return innerHTMLTags[tagName];\n }\n\n var canSet = true;\n\n // IE 8 and earlier don't allow us to do innerHTML on select\n if (tagName.toLowerCase() === 'select') {\n var el = document.createElement('select');\n setInnerHTMLWithoutFix(el, '<option value=\"test\">Test</option>');\n canSet = el.options.length === 1;\n }\n\n innerHTMLTags[tagName] = canSet;\n\n return canSet;\n };\n\n var setInnerHTML = function(element, html) {\n var tagName = element.tagName;\n\n if (canSetInnerHTML(tagName)) {\n setInnerHTMLWithoutFix(element, html);\n } else {\n // Firefox versions < 11 do not have support for element.outerHTML.\n var outerHTML = element.outerHTML || new XMLSerializer().serializeToString(element);\n Ember.assert(\"Can't set innerHTML on \"+element.tagName+\" in this browser\", outerHTML);\n\n var startTag = outerHTML.match(new RegExp(\"<\"+tagName+\"([^>]*)>\", 'i'))[0],\n endTag = '</'+tagName+'>';\n\n var wrapper = document.createElement('div');\n setInnerHTMLWithoutFix(wrapper, startTag + html + endTag);\n element = wrapper.firstChild;\n while (element.tagName !== tagName) {\n element = element.nextSibling;\n }\n }\n\n return element;\n };\n\n function isSimpleClick(event) {\n var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,\n secondaryClick = event.which > 1; // IE9 may return undefined\n\n return !modifier && !secondaryClick;\n }\n\n __exports__.setInnerHTML = setInnerHTML;\n __exports__.isSimpleClick = isSimpleClick;\n });\ndefine(\"ember-views/views/collection_view\",\n [\"ember-metal/core\",\"ember-metal/platform\",\"ember-metal/binding\",\"ember-metal/merge\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-runtime/system/string\",\"ember-views/views/container_view\",\"ember-views/views/view\",\"ember-metal/mixin\",\"ember-runtime/mixins/array\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var create = __dependency2__.create;\n var isGlobalPath = __dependency3__.isGlobalPath;\n var merge = __dependency4__[\"default\"];\n var get = __dependency5__.get;\n var set = __dependency6__.set;\n var fmt = __dependency7__.fmt;\n var ContainerView = __dependency8__[\"default\"];\n var CoreView = __dependency9__.CoreView;\n var View = __dependency9__.View;\n var observer = __dependency10__.observer;\n var beforeObserver = __dependency10__.beforeObserver;\n var EmberArray = __dependency11__[\"default\"];\n\n /**\n `Ember.CollectionView` is an `Ember.View` descendent responsible for managing\n a collection (an array or array-like object) by maintaining a child view object\n and associated DOM representation for each item in the array and ensuring\n that child views and their associated rendered HTML are updated when items in\n the array are added, removed, or replaced.\n\n ## Setting content\n\n The managed collection of objects is referenced as the `Ember.CollectionView`\n instance's `content` property.\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n content: ['A', 'B','C']\n })\n ```\n\n The view for each item in the collection will have its `content` property set\n to the item.\n\n ## Specifying itemViewClass\n\n By default the view class for each item in the managed collection will be an\n instance of `Ember.View`. You can supply a different class by setting the\n `CollectionView`'s `itemViewClass` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n classNames: ['a-collection'],\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n someItemsView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view a-collection\">\n <div class=\"ember-view\">the letter: A</div>\n <div class=\"ember-view\">the letter: B</div>\n <div class=\"ember-view\">the letter: C</div>\n </div>\n ```\n\n ## Automatic matching of parent/child tagNames\n\n Setting the `tagName` property of a `CollectionView` to any of\n \"ul\", \"ol\", \"table\", \"thead\", \"tbody\", \"tfoot\", \"tr\", or \"select\" will result\n in the item views receiving an appropriately matched `tagName` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n anUnorderedListView = Ember.CollectionView.create({\n tagName: 'ul',\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n anUnorderedListView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <ul class=\"ember-view a-collection\">\n <li class=\"ember-view\">the letter: A</li>\n <li class=\"ember-view\">the letter: B</li>\n <li class=\"ember-view\">the letter: C</li>\n </ul>\n ```\n\n Additional `tagName` pairs can be provided by adding to\n `Ember.CollectionView.CONTAINER_MAP `\n\n ```javascript\n Ember.CollectionView.CONTAINER_MAP['article'] = 'section'\n ```\n\n ## Programmatic creation of child views\n\n For cases where additional customization beyond the use of a single\n `itemViewClass` or `tagName` matching is required CollectionView's\n `createChildView` method can be overidden:\n\n ```javascript\n CustomCollectionView = Ember.CollectionView.extend({\n createChildView: function(viewClass, attrs) {\n if (attrs.content.kind == 'album') {\n viewClass = App.AlbumView;\n } else {\n viewClass = App.SongView;\n }\n return this._super(viewClass, attrs);\n }\n });\n ```\n\n ## Empty View\n\n You can provide an `Ember.View` subclass to the `Ember.CollectionView`\n instance as its `emptyView` property. If the `content` property of a\n `CollectionView` is set to `null` or an empty array, an instance of this view\n will be the `CollectionView`s only child.\n\n ```javascript\n aListWithNothing = Ember.CollectionView.create({\n classNames: ['nothing']\n content: null,\n emptyView: Ember.View.extend({\n template: Ember.Handlebars.compile(\"The collection is empty\")\n })\n });\n\n aListWithNothing.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view nothing\">\n <div class=\"ember-view\">\n The collection is empty\n </div>\n </div>\n ```\n\n ## Adding and Removing items\n\n The `childViews` property of a `CollectionView` should not be directly\n manipulated. Instead, add, remove, replace items from its `content` property.\n This will trigger appropriate changes to its rendered HTML.\n\n\n @class CollectionView\n @namespace Ember\n @extends Ember.ContainerView\n @since Ember 0.9\n */\n var CollectionView = ContainerView.extend({\n\n /**\n A list of items to be displayed by the `Ember.CollectionView`.\n\n @property content\n @type Ember.Array\n @default null\n */\n content: null,\n\n /**\n This provides metadata about what kind of empty view class this\n collection would like if it is being instantiated from another\n system (like Handlebars)\n\n @private\n @property emptyViewClass\n */\n emptyViewClass: View,\n\n /**\n An optional view to display if content is set to an empty array.\n\n @property emptyView\n @type Ember.View\n @default null\n */\n emptyView: null,\n\n /**\n @property itemViewClass\n @type Ember.View\n @default Ember.View\n */\n itemViewClass: View,\n\n /**\n Setup a CollectionView\n\n @method init\n */\n init: function() {\n var ret = this._super();\n this._contentDidChange();\n return ret;\n },\n\n /**\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @private\n @method _contentWillChange\n */\n _contentWillChange: beforeObserver('content', function() {\n var content = this.get('content');\n\n if (content) { content.removeArrayObserver(this); }\n var len = content ? get(content, 'length') : 0;\n this.arrayWillChange(content, 0, len);\n }),\n\n /**\n Check to make sure that the content has changed, and if so,\n update the children directly. This is always scheduled\n asynchronously, to allow the element to be created before\n bindings have synchronized and vice versa.\n\n @private\n @method _contentDidChange\n */\n _contentDidChange: observer('content', function() {\n var content = get(this, 'content');\n\n if (content) {\n this._assertArrayLike(content);\n content.addArrayObserver(this);\n }\n\n var len = content ? get(content, 'length') : 0;\n this.arrayDidChange(content, 0, null, len);\n }),\n\n /**\n Ensure that the content implements Ember.Array\n\n @private\n @method _assertArrayLike\n */\n _assertArrayLike: function(content) {\n Ember.assert(fmt(\"an Ember.CollectionView's content must implement Ember.Array. You passed %@\", [content]), EmberArray.detect(content));\n },\n\n /**\n Removes the content and content observers.\n\n @method destroy\n */\n destroy: function() {\n if (!this._super()) { return; }\n\n var content = get(this, 'content');\n if (content) { content.removeArrayObserver(this); }\n\n if (this._createdEmptyView) {\n this._createdEmptyView.destroy();\n }\n\n return this;\n },\n\n /**\n Called when a mutation to the underlying content array will occur.\n\n This method will remove any views that are no longer in the underlying\n content array.\n\n Invokes whenever the content array itself will change.\n\n @method arrayWillChange\n @param {Array} content the managed collection of objects\n @param {Number} start the index at which the changes will occurr\n @param {Number} removed number of object to be removed from content\n */\n arrayWillChange: function(content, start, removedCount) {\n // If the contents were empty before and this template collection has an\n // empty view remove it now.\n var emptyView = get(this, 'emptyView');\n if (emptyView && emptyView instanceof View) {\n emptyView.removeFromParent();\n }\n\n // Loop through child views that correspond with the removed items.\n // Note that we loop from the end of the array to the beginning because\n // we are mutating it as we go.\n var childViews = this._childViews, childView, idx, len;\n\n len = this._childViews.length;\n\n var removingAll = removedCount === len;\n\n if (removingAll) {\n this.currentState.empty(this);\n this.invokeRecursively(function(view) {\n view.removedFromDOM = true;\n }, false);\n }\n\n for (idx = start + removedCount - 1; idx >= start; idx--) {\n childView = childViews[idx];\n childView.destroy();\n }\n },\n\n /**\n Called when a mutation to the underlying content array occurs.\n\n This method will replay that mutation against the views that compose the\n `Ember.CollectionView`, ensuring that the view reflects the model.\n\n This array observer is added in `contentDidChange`.\n\n @method arrayDidChange\n @param {Array} content the managed collection of objects\n @param {Number} start the index at which the changes occurred\n @param {Number} removed number of object removed from content\n @param {Number} added number of object added to content\n */\n arrayDidChange: function(content, start, removed, added) {\n var addedViews = [], view, item, idx, len, itemViewClass,\n emptyView;\n\n len = content ? get(content, 'length') : 0;\n\n if (len) {\n itemViewClass = get(this, 'itemViewClass');\n\n if ('string' === typeof itemViewClass && isGlobalPath(itemViewClass)) {\n itemViewClass = get(itemViewClass) || itemViewClass;\n }\n\n Ember.assert(fmt(\"itemViewClass must be a subclass of Ember.View, not %@\",\n [itemViewClass]),\n 'string' === typeof itemViewClass || View.detect(itemViewClass));\n\n for (idx = start; idx < start+added; idx++) {\n item = content.objectAt(idx);\n\n view = this.createChildView(itemViewClass, {\n content: item,\n contentIndex: idx\n });\n\n addedViews.push(view);\n }\n } else {\n emptyView = get(this, 'emptyView');\n\n if (!emptyView) { return; }\n\n if ('string' === typeof emptyView && isGlobalPath(emptyView)) {\n emptyView = get(emptyView) || emptyView;\n }\n\n emptyView = this.createChildView(emptyView);\n addedViews.push(emptyView);\n set(this, 'emptyView', emptyView);\n\n if (CoreView.detect(emptyView)) {\n this._createdEmptyView = emptyView;\n }\n }\n\n this.replace(start, 0, addedViews);\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n The tag name for the view will be set to the tagName of the viewClass\n passed in.\n\n @method createChildView\n @param {Class} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n var itemTagName = get(view, 'tagName');\n\n if (itemTagName === null || itemTagName === undefined) {\n itemTagName = CollectionView.CONTAINER_MAP[get(this, 'tagName')];\n set(view, 'tagName', itemTagName);\n }\n\n return view;\n }\n });\n\n /**\n A map of parent tags to their default child tags. You can add\n additional parent tags if you want collection views that use\n a particular parent tag to default to a child tag.\n\n @property CONTAINER_MAP\n @type Hash\n @static\n @final\n */\n CollectionView.CONTAINER_MAP = {\n ul: 'li',\n ol: 'li',\n table: 'tr',\n thead: 'tr',\n tbody: 'tr',\n tfoot: 'tr',\n tr: 'td',\n select: 'option'\n };\n\n __exports__[\"default\"] = CollectionView;\n });\ndefine(\"ember-views/views/component\",\n [\"ember-metal/core\",\"ember-views/mixins/component_template_deprecation\",\"ember-runtime/mixins/target_action_support\",\"ember-views/views/view\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/is_none\",\"ember-metal/computed\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.Handlebars\n\n var ComponentTemplateDeprecation = __dependency2__[\"default\"];\n var TargetActionSupport = __dependency3__[\"default\"];\n var View = __dependency4__.View;var get = __dependency5__.get;\n var set = __dependency6__.set;\n var isNone = __dependency7__.isNone;\n\n var computed = __dependency8__.computed;\n\n var a_slice = Array.prototype.slice;\n\n /**\n @module ember\n @submodule ember-views\n */\n\n /**\n An `Ember.Component` is a view that is completely\n isolated. Property access in its templates go\n to the view object and actions are targeted at\n the view object. There is no access to the\n surrounding context or outer controller; all\n contextual information must be passed in.\n\n The easiest way to create an `Ember.Component` is via\n a template. If you name a template\n `components/my-foo`, you will be able to use\n `{{my-foo}}` in other templates, which will make\n an instance of the isolated component.\n\n ```handlebars\n {{app-profile person=currentUser}}\n ```\n\n ```handlebars\n <!-- app-profile template -->\n <h1>{{person.title}}</h1>\n <img {{bind-attr src=person.avatar}}>\n <p class='signature'>{{person.signature}}</p>\n ```\n\n You can use `yield` inside a template to\n include the **contents** of any block attached to\n the component. The block will be executed in the\n context of the surrounding context or outer controller:\n\n ```handlebars\n {{#app-profile person=currentUser}}\n <p>Admin mode</p>\n {{! Executed in the controller's context. }}\n {{/app-profile}}\n ```\n\n ```handlebars\n <!-- app-profile template -->\n <h1>{{person.title}}</h1>\n {{! Executed in the components context. }}\n {{yield}} {{! block contents }}\n ```\n\n If you want to customize the component, in order to\n handle events or actions, you implement a subclass\n of `Ember.Component` named after the name of the\n component. Note that `Component` needs to be appended to the name of\n your subclass like `AppProfileComponent`.\n\n For example, you could implement the action\n `hello` for the `app-profile` component:\n\n ```javascript\n App.AppProfileComponent = Ember.Component.extend({\n actions: {\n hello: function(name) {\n console.log(\"Hello\", name);\n }\n }\n });\n ```\n\n And then use it in the component's template:\n\n ```handlebars\n <!-- app-profile template -->\n\n <h1>{{person.title}}</h1>\n {{yield}} <!-- block contents -->\n\n <button {{action 'hello' person.name}}>\n Say Hello to {{person.name}}\n </button>\n ```\n\n Components must have a `-` in their name to avoid\n conflicts with built-in controls that wrap HTML\n elements. This is consistent with the same\n requirement in web components.\n\n @class Component\n @namespace Ember\n @extends Ember.View\n */\n var Component = View.extend(TargetActionSupport, ComponentTemplateDeprecation, {\n instrumentName: 'component',\n instrumentDisplay: computed(function() {\n if (this._debugContainerKey) {\n return '{{' + this._debugContainerKey.split(':')[1] + '}}';\n }\n }),\n\n init: function() {\n this._super();\n set(this, 'context', this);\n set(this, 'controller', this);\n },\n\n defaultLayout: function(context, options){\n Ember.Handlebars.helpers['yield'].call(context, options);\n },\n\n /**\n A components template property is set by passing a block\n during its invocation. It is executed within the parent context.\n\n Example:\n\n ```handlebars\n {{#my-component}}\n // something that is run in the context\n // of the parent context\n {{/my-component}}\n ```\n\n Specifying a template directly to a component is deprecated without\n also specifying the layout property.\n\n @deprecated\n @property template\n */\n template: computed(function(key, value) {\n if (value !== undefined) { return value; }\n\n var templateName = get(this, 'templateName'),\n template = this.templateForName(templateName, 'template');\n\n Ember.assert(\"You specified the templateName \" + templateName + \" for \" + this + \", but it did not exist.\", !templateName || template);\n\n return template || get(this, 'defaultTemplate');\n }).property('templateName'),\n\n /**\n Specifying a components `templateName` is deprecated without also\n providing the `layout` or `layoutName` properties.\n\n @deprecated\n @property templateName\n */\n templateName: null,\n\n // during render, isolate keywords\n cloneKeywords: function() {\n return {\n view: this,\n controller: this\n };\n },\n\n _yield: function(context, options) {\n var view = options.data.view,\n parentView = this._parentView,\n template = get(this, 'template');\n\n if (template) {\n Ember.assert(\"A Component must have a parent view in order to yield.\", parentView);\n\n view.appendChild(View, {\n isVirtual: true,\n tagName: '',\n _contextView: parentView,\n template: template,\n context: get(parentView, 'context'),\n controller: get(parentView, 'controller'),\n templateData: { keywords: parentView.cloneKeywords() }\n });\n }\n },\n\n /**\n If the component is currently inserted into the DOM of a parent view, this\n property will point to the controller of the parent view.\n\n @property targetObject\n @type Ember.Controller\n @default null\n */\n targetObject: computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n Triggers a named action on the controller context where the component is used if\n this controller has registered for notifications of the action.\n\n For example a component for playing or pausing music may translate click events\n into action notifications of \"play\" or \"stop\" depending on some internal state\n of the component:\n\n\n ```javascript\n App.PlayButtonComponent = Ember.Component.extend({\n click: function(){\n if (this.get('isPlaying')) {\n this.sendAction('play');\n } else {\n this.sendAction('stop');\n }\n }\n });\n ```\n\n When used inside a template these component actions are configured to\n trigger actions in the outer application context:\n\n ```handlebars\n {{! application.hbs }}\n {{play-button play=\"musicStarted\" stop=\"musicStopped\"}}\n ```\n\n When the component receives a browser `click` event it translate this\n interaction into application-specific semantics (\"play\" or \"stop\") and\n triggers the specified action name on the controller for the template\n where the component is used:\n\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n musicStarted: function(){\n // called when the play button is clicked\n // and the music started playing\n },\n musicStopped: function(){\n // called when the play button is clicked\n // and the music stopped playing\n }\n }\n });\n ```\n\n If no action name is passed to `sendAction` a default name of \"action\"\n is assumed.\n\n ```javascript\n App.NextButtonComponent = Ember.Component.extend({\n click: function(){\n this.sendAction();\n }\n });\n ```\n\n ```handlebars\n {{! application.hbs }}\n {{next-button action=\"playNextSongInAlbum\"}}\n ```\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n playNextSongInAlbum: function(){\n ...\n }\n }\n });\n ```\n\n @method sendAction\n @param [action] {String} the action to trigger\n @param [context] {*} a context to send with the action\n */\n sendAction: function(action) {\n var actionName,\n contexts = a_slice.call(arguments, 1);\n\n // Send the default action\n if (action === undefined) {\n actionName = get(this, 'action');\n Ember.assert(\"The default action was triggered on the component \" + this.toString() +\n \", but the action name (\" + actionName + \") was not a string.\",\n isNone(actionName) || typeof actionName === 'string');\n } else {\n actionName = get(this, action);\n Ember.assert(\"The \" + action + \" action was triggered on the component \" +\n this.toString() + \", but the action name (\" + actionName +\n \") was not a string.\",\n isNone(actionName) || typeof actionName === 'string');\n }\n\n // If no action name for that action could be found, just abort.\n if (actionName === undefined) { return; }\n\n this.triggerAction({\n action: actionName,\n actionContext: contexts\n });\n }\n });\n\n __exports__[\"default\"] = Component;\n });\ndefine(\"ember-views/views/container_view\",\n [\"ember-metal/core\",\"ember-metal/merge\",\"ember-runtime/mixins/mutable_array\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-views/views/view\",\"ember-views/views/states\",\"ember-metal/error\",\"ember-metal/enumerable_utils\",\"ember-metal/computed\",\"ember-metal/run_loop\",\"ember-metal/properties\",\"ember-views/system/render_buffer\",\"ember-metal/mixin\",\"ember-runtime/system/native_array\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert, Ember.K\n\n var merge = __dependency2__[\"default\"];\n var MutableArray = __dependency3__[\"default\"];\n var get = __dependency4__.get;\n var set = __dependency5__.set;\n\n var View = __dependency6__.View;\n var ViewCollection = __dependency6__.ViewCollection;\n var cloneStates = __dependency7__.cloneStates;\n var EmberViewStates = __dependency7__.states;\n\n var EmberError = __dependency8__[\"default\"];\n\n // ES6TODO: functions on EnumerableUtils should get their own export\n var EnumerableUtils = __dependency9__[\"default\"];\n var forEach = EnumerableUtils.forEach;\n\n var computed = __dependency10__.computed;\n var run = __dependency11__[\"default\"];\n var defineProperty = __dependency12__.defineProperty;\n var RenderBuffer = __dependency13__[\"default\"];\n var observer = __dependency14__.observer;\n var beforeObserver = __dependency14__.beforeObserver;\n var A = __dependency15__.A;\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var states = cloneStates(EmberViewStates);\n\n /**\n A `ContainerView` is an `Ember.View` subclass that implements `Ember.MutableArray`\n allowing programmatic management of its child views.\n\n ## Setting Initial Child Views\n\n The initial array of child views can be set in one of two ways. You can\n provide a `childViews` property at creation time that contains instance of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: [Ember.View.create(), Ember.View.create()]\n });\n ```\n\n You can also provide a list of property names whose values are instances of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', 'bView', 'cView'],\n aView: Ember.View.create(),\n bView: Ember.View.create(),\n cView: Ember.View.create()\n });\n ```\n\n The two strategies can be combined:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', Ember.View.create()],\n aView: Ember.View.create()\n });\n ```\n\n Each child view's rendering will be inserted into the container's rendered\n HTML in the same order as its position in the `childViews` property.\n\n ## Adding and Removing Child Views\n\n The container view implements `Ember.MutableArray` allowing programmatic management of its child views.\n\n To remove a view, pass that view into a `removeObject` call on the container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Removing a view\n\n ```javascript\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.removeObject(aContainer.get('bView'));\n aContainer.toArray(); // [aContainer.aView]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n </div>\n ```\n\n Similarly, adding a child view is accomplished by adding `Ember.View` instances to the\n container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Adding a view\n\n ```javascript\n AnotherViewClass = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Another view\")\n });\n\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.pushObject(AnotherViewClass.create());\n aContainer.toArray(); // [aContainer.aView, aContainer.bView, <AnotherViewClass instance>]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n <div class=\"ember-view\">Another view</div>\n </div>\n ```\n\n ## Templates and Layout\n\n A `template`, `templateName`, `defaultTemplate`, `layout`, `layoutName` or\n `defaultLayout` property on a container view will not result in the template\n or layout being rendered. The HTML contents of a `Ember.ContainerView`'s DOM\n representation will only be the rendered HTML of its child views.\n\n @class ContainerView\n @namespace Ember\n @extends Ember.View\n */\n var ContainerView = View.extend(MutableArray, {\n states: states,\n\n init: function() {\n this._super();\n\n var childViews = get(this, 'childViews');\n\n // redefine view's childViews property that was obliterated\n defineProperty(this, 'childViews', View.childViewsProperty);\n\n var _childViews = this._childViews;\n\n forEach(childViews, function(viewName, idx) {\n var view;\n\n if ('string' === typeof viewName) {\n view = get(this, viewName);\n view = this.createChildView(view);\n set(this, viewName, view);\n } else {\n view = this.createChildView(viewName);\n }\n\n _childViews[idx] = view;\n }, this);\n\n var currentView = get(this, 'currentView');\n if (currentView) {\n if (!_childViews.length) { _childViews = this._childViews = this._childViews.slice(); }\n _childViews.push(this.createChildView(currentView));\n }\n },\n\n replace: function(idx, removedCount, addedViews) {\n var addedCount = addedViews ? get(addedViews, 'length') : 0;\n var self = this;\n Ember.assert(\"You can't add a child to a container - the child is already a child of another view\", A(addedViews).every(function(item) { return !get(item, '_parentView') || get(item, '_parentView') === self; }));\n\n this.arrayContentWillChange(idx, removedCount, addedCount);\n this.childViewsWillChange(this._childViews, idx, removedCount);\n\n if (addedCount === 0) {\n this._childViews.splice(idx, removedCount) ;\n } else {\n var args = [idx, removedCount].concat(addedViews);\n if (addedViews.length && !this._childViews.length) { this._childViews = this._childViews.slice(); }\n this._childViews.splice.apply(this._childViews, args);\n }\n\n this.arrayContentDidChange(idx, removedCount, addedCount);\n this.childViewsDidChange(this._childViews, idx, removedCount, addedCount);\n\n return this;\n },\n\n objectAt: function(idx) {\n return this._childViews[idx];\n },\n\n length: computed(function () {\n return this._childViews.length;\n }).volatile(),\n\n /**\n Instructs each child view to render to the passed render buffer.\n\n @private\n @method render\n @param {Ember.RenderBuffer} buffer the buffer to render to\n */\n render: function(buffer) {\n this.forEachChildView(function(view) {\n view.renderToBuffer(buffer);\n });\n },\n\n instrumentName: 'container',\n\n /**\n When a child view is removed, destroy its element so that\n it is removed from the DOM.\n\n The array observer that triggers this action is set up in the\n `renderToBuffer` method.\n\n @private\n @method childViewsWillChange\n @param {Ember.Array} views the child views array before mutation\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n **/\n childViewsWillChange: function(views, start, removed) {\n this.propertyWillChange('childViews');\n\n if (removed > 0) {\n var changedViews = views.slice(start, start+removed);\n // transition to preRender before clearing parentView\n this.currentState.childViewsWillChange(this, views, start, removed);\n this.initializeViews(changedViews, null, null);\n }\n },\n\n removeChild: function(child) {\n this.removeObject(child);\n return this;\n },\n\n /**\n When a child view is added, make sure the DOM gets updated appropriately.\n\n If the view has already rendered an element, we tell the child view to\n create an element and insert it into the DOM. If the enclosing container\n view has already written to a buffer, but not yet converted that buffer\n into an element, we insert the string representation of the child into the\n appropriate place in the buffer.\n\n @private\n @method childViewsDidChange\n @param {Ember.Array} views the array of child views after the mutation has occurred\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n @param {Number} added the number of child views added\n */\n childViewsDidChange: function(views, start, removed, added) {\n if (added > 0) {\n var changedViews = views.slice(start, start+added);\n this.initializeViews(changedViews, this, get(this, 'templateData'));\n this.currentState.childViewsDidChange(this, views, start, added);\n }\n this.propertyDidChange('childViews');\n },\n\n initializeViews: function(views, parentView, templateData) {\n forEach(views, function(view) {\n set(view, '_parentView', parentView);\n\n if (!view.container && parentView) {\n set(view, 'container', parentView.container);\n }\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', templateData);\n }\n });\n },\n\n currentView: null,\n\n _currentViewWillChange: beforeObserver('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n currentView.destroy();\n }\n }),\n\n _currentViewDidChange: observer('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n Ember.assert(\"You tried to set a current view that already has a parent. Make sure you don't have multiple outlets in the same view.\", !get(currentView, '_parentView'));\n this.pushObject(currentView);\n }\n }),\n\n _ensureChildrenAreInDOM: function () {\n this.currentState.ensureChildrenAreInDOM(this);\n }\n });\n\n merge(states._default, {\n childViewsWillChange: Ember.K,\n childViewsDidChange: Ember.K,\n ensureChildrenAreInDOM: Ember.K\n });\n\n merge(states.inBuffer, {\n childViewsDidChange: function(parentView, views, start, added) {\n throw new EmberError('You cannot modify child views while in the inBuffer state');\n }\n });\n\n merge(states.hasElement, {\n childViewsWillChange: function(view, views, start, removed) {\n for (var i=start; i<start+removed; i++) {\n views[i].remove();\n }\n },\n\n childViewsDidChange: function(view, views, start, added) {\n run.scheduleOnce('render', view, '_ensureChildrenAreInDOM');\n },\n\n ensureChildrenAreInDOM: function(view) {\n var childViews = view._childViews, i, len, childView, previous, buffer, viewCollection = new ViewCollection();\n\n for (i = 0, len = childViews.length; i < len; i++) {\n childView = childViews[i];\n\n if (!buffer) { buffer = RenderBuffer(); buffer._hasElement = false; }\n\n if (childView.renderToBufferIfNeeded(buffer)) {\n viewCollection.push(childView);\n } else if (viewCollection.length) {\n insertViewCollection(view, viewCollection, previous, buffer);\n buffer = null;\n previous = childView;\n viewCollection.clear();\n } else {\n previous = childView;\n }\n }\n\n if (viewCollection.length) {\n insertViewCollection(view, viewCollection, previous, buffer);\n }\n }\n });\n\n function insertViewCollection(view, viewCollection, previous, buffer) {\n viewCollection.triggerRecursively('willInsertElement');\n\n if (previous) {\n previous.domManager.after(previous, buffer.string());\n } else {\n view.domManager.prepend(view, buffer.string());\n }\n\n viewCollection.forEach(function(v) {\n v.transitionTo('inDOM');\n v.propertyDidChange('element');\n v.triggerRecursively('didInsertElement');\n });\n }\n\n\n __exports__[\"default\"] = ContainerView;\n });\ndefine(\"ember-views/views/states\",\n [\"ember-metal/platform\",\"ember-metal/merge\",\"ember-views/views/states/default\",\"ember-views/views/states/pre_render\",\"ember-views/views/states/in_buffer\",\"ember-views/views/states/has_element\",\"ember-views/views/states/in_dom\",\"ember-views/views/states/destroying\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var create = __dependency1__.create;\n var merge = __dependency2__[\"default\"];\n var _default = __dependency3__[\"default\"];\n var preRender = __dependency4__[\"default\"];\n var inBuffer = __dependency5__[\"default\"];\n var hasElement = __dependency6__[\"default\"];\n var inDOM = __dependency7__[\"default\"];\n var destroying = __dependency8__[\"default\"];\n\n function cloneStates(from) {\n var into = {};\n\n into._default = {};\n into.preRender = create(into._default);\n into.destroying = create(into._default);\n into.inBuffer = create(into._default);\n into.hasElement = create(into._default);\n into.inDOM = create(into.hasElement);\n\n for (var stateName in from) {\n if (!from.hasOwnProperty(stateName)) { continue; }\n merge(into[stateName], from[stateName]);\n }\n\n return into;\n };\n\n var states = {\n _default: _default,\n preRender: preRender,\n inDOM: inDOM,\n inBuffer: inBuffer,\n hasElement: hasElement,\n destroying: destroying\n };\n\n __exports__.cloneStates = cloneStates;\n __exports__.states = states;\n });\ndefine(\"ember-views/views/states/default\",\n [\"ember-metal/core\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/run_loop\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.K\n var get = __dependency2__.get;\n var set = __dependency3__.set;\n var run = __dependency4__[\"default\"];\n var EmberError = __dependency5__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n var _default = {\n // appendChild is only legal while rendering the buffer.\n appendChild: function() {\n throw new EmberError(\"You can't use appendChild outside of the rendering process\");\n },\n\n $: function() {\n return undefined;\n },\n\n getElement: function() {\n return null;\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function() {\n return true; // continue event propagation\n },\n\n destroyElement: function(view) {\n set(view, 'element', null);\n if (view._scheduledInsert) {\n run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n renderToBufferIfNeeded: function () {\n return false;\n },\n\n rerender: Ember.K,\n invokeObserver: Ember.K\n };\n\n __exports__[\"default\"] = _default;\n });\ndefine(\"ember-views/views/states/destroying\",\n [\"ember-metal/merge\",\"ember-metal/platform\",\"ember-runtime/system/string\",\"ember-views/views/states/default\",\"ember-metal/error\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var merge = __dependency1__[\"default\"];\n var create = __dependency2__.create;\n var fmt = __dependency3__.fmt;\n var _default = __dependency4__[\"default\"];\n var EmberError = __dependency5__[\"default\"];\n /**\n @module ember\n @submodule ember-views\n */\n\n var destroyingError = \"You can't call %@ on a view being destroyed\";\n\n var destroying = create(_default);\n\n merge(destroying, {\n appendChild: function() {\n throw new EmberError(fmt(destroyingError, ['appendChild']));\n },\n rerender: function() {\n throw new EmberError(fmt(destroyingError, ['rerender']));\n },\n destroyElement: function() {\n throw new EmberError(fmt(destroyingError, ['destroyElement']));\n },\n empty: function() {\n throw new EmberError(fmt(destroyingError, ['empty']));\n },\n\n setElement: function() {\n throw new EmberError(fmt(destroyingError, [\"set('element', ...)\"]));\n },\n\n renderToBufferIfNeeded: function() {\n return false;\n },\n\n // Since element insertion is scheduled, don't do anything if\n // the view has been destroyed between scheduling and execution\n insertElement: Ember.K\n });\n\n __exports__[\"default\"] = destroying;\n });\ndefine(\"ember-views/views/states/has_element\",\n [\"ember-views/views/states/default\",\"ember-metal/run_loop\",\"ember-metal/merge\",\"ember-metal/platform\",\"ember-views/system/jquery\",\"ember-metal/error\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {\n \"use strict\";\n var _default = __dependency1__[\"default\"];\n var run = __dependency2__[\"default\"];\n var merge = __dependency3__[\"default\"];\n var create = __dependency4__.create;\n var jQuery = __dependency5__[\"default\"];\n var EmberError = __dependency6__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var get = __dependency7__.get;\n var set = __dependency8__.set;\n\n var hasElement = create(_default);\n\n merge(hasElement, {\n $: function(view, sel) {\n var elem = get(view, 'element');\n return sel ? jQuery(sel, elem) : jQuery(elem);\n },\n\n getElement: function(view) {\n var parent = get(view, 'parentView');\n if (parent) { parent = get(parent, 'element'); }\n if (parent) { return view.findElementInParentElement(parent); }\n return jQuery(\"#\" + get(view, 'elementId'))[0];\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n throw new EmberError(\"You cannot set an element to a non-null value when the element is already in the DOM.\");\n }\n\n return value;\n },\n\n // once the view has been inserted into the DOM, rerendering is\n // deferred to allow bindings to synchronize.\n rerender: function(view) {\n view.triggerRecursively('willClearRender');\n\n view.clearRenderedChildren();\n\n view.domManager.replace(view);\n return view;\n },\n\n // once the view is already in the DOM, destroying it removes it\n // from the DOM, nukes its element, and puts it back into the\n // preRender state if inDOM.\n\n destroyElement: function(view) {\n view._notifyWillDestroyElement();\n view.domManager.remove(view);\n set(view, 'element', null);\n if (view._scheduledInsert) {\n run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n empty: function(view) {\n var _childViews = view._childViews, len, idx;\n if (_childViews) {\n len = _childViews.length;\n for (idx = 0; idx < len; idx++) {\n _childViews[idx]._notifyWillDestroyElement();\n }\n }\n view.domManager.empty(view);\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function(view, eventName, evt) {\n if (view.has(eventName)) {\n // Handler should be able to re-dispatch events, so we don't\n // preventDefault or stopPropagation.\n return view.trigger(eventName, evt);\n } else {\n return true; // continue event propagation\n }\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n });\n\n __exports__[\"default\"] = hasElement;\n });\ndefine(\"ember-views/views/states/in_buffer\",\n [\"ember-views/views/states/default\",\"ember-metal/error\",\"ember-metal/core\",\"ember-metal/platform\",\"ember-metal/merge\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var _default = __dependency1__[\"default\"];\n var EmberError = __dependency2__[\"default\"];\n\n var Ember = __dependency3__[\"default\"];\n // Ember.assert\n var create = __dependency4__.create;\n var merge = __dependency5__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var inBuffer = create(_default);\n\n merge(inBuffer, {\n $: function(view, sel) {\n // if we don't have an element yet, someone calling this.$() is\n // trying to update an element that isn't in the DOM. Instead,\n // rerender the view to allow the render method to reflect the\n // changes.\n view.rerender();\n return Ember.$();\n },\n\n // when a view is rendered in a buffer, rerendering it simply\n // replaces the existing buffer with a new one\n rerender: function(view) {\n throw new EmberError(\"Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.\");\n },\n\n // when a view is rendered in a buffer, appending a child\n // view will render that view and append the resulting\n // buffer into its buffer.\n appendChild: function(view, childView, options) {\n var buffer = view.buffer, _childViews = view._childViews;\n\n childView = view.createChildView(childView, options);\n if (!_childViews.length) { _childViews = view._childViews = _childViews.slice(); }\n _childViews.push(childView);\n\n childView.renderToBuffer(buffer);\n\n view.propertyDidChange('childViews');\n\n return childView;\n },\n\n // when a view is rendered in a buffer, destroying the\n // element will simply destroy the buffer and put the\n // state back into the preRender state.\n destroyElement: function(view) {\n view.clearBuffer();\n var viewCollection = view._notifyWillDestroyElement();\n viewCollection.transitionTo('preRender', false);\n\n return view;\n },\n\n empty: function() {\n Ember.assert(\"Emptying a view in the inBuffer state is not allowed and \" +\n \"should not happen under normal circumstances. Most likely \" +\n \"there is a bug in your application. This may be due to \" +\n \"excessive property change notifications.\");\n },\n\n renderToBufferIfNeeded: function (view, buffer) {\n return false;\n },\n\n // It should be impossible for a rendered view to be scheduled for\n // insertion.\n insertElement: function() {\n throw new EmberError(\"You can't insert an element that has already been rendered\");\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n view.clearBuffer();\n view.transitionTo('hasElement');\n }\n\n return value;\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n });\n\n __exports__[\"default\"] = inBuffer;\n });\ndefine(\"ember-views/views/states/in_dom\",\n [\"ember-metal/core\",\"ember-metal/platform\",\"ember-metal/merge\",\"ember-metal/error\",\"ember-views/views/states/has_element\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n // Ember.assert\n var create = __dependency2__.create;\n var merge = __dependency3__[\"default\"];\n var EmberError = __dependency4__[\"default\"];\n\n var hasElement = __dependency5__[\"default\"];\n /**\n @module ember\n @submodule ember-views\n */\n\n var inDOM = create(hasElement);\n\n var View;\n\n merge(inDOM, {\n enter: function(view) {\n if (!View) { View = requireModule('ember-views/views/view')[\"View\"]; } // ES6TODO: this sucks. Have to avoid cycles...\n\n // Register the view for event handling. This hash is used by\n // Ember.EventDispatcher to dispatch incoming events.\n if (!view.isVirtual) {\n Ember.assert(\"Attempted to register a view with an id already in use: \"+view.elementId, !View.views[view.elementId]);\n View.views[view.elementId] = view;\n }\n\n view.addBeforeObserver('elementId', function() {\n throw new EmberError(\"Changing a view's elementId after creation is not allowed\");\n });\n },\n\n exit: function(view) {\n if (!View) { View = requireModule('ember-views/views/view')[\"View\"]; } // ES6TODO: this sucks. Have to avoid cycles...\n\n if (!this.isVirtual) delete View.views[view.elementId];\n },\n\n insertElement: function(view, fn) {\n throw new EmberError(\"You can't insert an element into the DOM that has already been inserted\");\n }\n });\n\n __exports__[\"default\"] = inDOM;\n });\ndefine(\"ember-views/views/states/pre_render\",\n [\"ember-views/views/states/default\",\"ember-metal/platform\",\"ember-metal/merge\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var _default = __dependency1__[\"default\"];\n var create = __dependency2__.create;\n var merge = __dependency3__[\"default\"];\n\n /**\n @module ember\n @submodule ember-views\n */\n var preRender = create(_default);\n\n merge(preRender, {\n // a view leaves the preRender state once its element has been\n // created (createElement).\n insertElement: function(view, fn) {\n view.createElement();\n var viewCollection = view.viewHierarchyCollection();\n\n viewCollection.trigger('willInsertElement');\n\n fn.call(view);\n\n // We transition to `inDOM` if the element exists in the DOM\n var element = view.get('element');\n if (document.body.contains(element)) {\n viewCollection.transitionTo('inDOM', false);\n viewCollection.trigger('didInsertElement');\n }\n },\n\n renderToBufferIfNeeded: function(view, buffer) {\n view.renderToBuffer(buffer);\n return true;\n },\n\n empty: Ember.K,\n\n setElement: function(view, value) {\n if (value !== null) {\n view.transitionTo('hasElement');\n }\n return value;\n }\n });\n\n __exports__[\"default\"] = preRender;\n });\ndefine(\"ember-views/views/view\",\n [\"ember-metal/core\",\"ember-metal/error\",\"ember-runtime/system/object\",\"ember-runtime/mixins/evented\",\"ember-runtime/mixins/action_handler\",\"ember-views/system/render_buffer\",\"ember-metal/property_get\",\"ember-metal/property_set\",\"ember-metal/set_properties\",\"ember-metal/run_loop\",\"ember-metal/observer\",\"ember-metal/properties\",\"ember-metal/utils\",\"ember-metal/computed\",\"ember-metal/mixin\",\"ember-metal/is_none\",\"container/container\",\"ember-runtime/system/native_array\",\"ember-metal/instrumentation\",\"ember-runtime/system/string\",\"ember-metal/enumerable_utils\",\"ember-runtime/copy\",\"ember-metal/binding\",\"ember-metal/property_events\",\"ember-views/views/states\",\"ember-views/system/jquery\",\"ember-views/system/ext\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __dependency27__, __exports__) {\n \"use strict\";\n // Ember.assert, Ember.deprecate, Ember.warn, Ember.TEMPLATES,\n // Ember.K, jQuery, Ember.lookup,\n // Ember.ContainerView circular dependency\n // Ember.ENV\n var Ember = __dependency1__[\"default\"];\n\n var EmberError = __dependency2__[\"default\"];\n var EmberObject = __dependency3__[\"default\"];\n var Evented = __dependency4__[\"default\"];\n var ActionHandler = __dependency5__[\"default\"];\n var RenderBuffer = __dependency6__[\"default\"];\n var get = __dependency7__.get;\n var set = __dependency8__.set;\n var setProperties = __dependency9__[\"default\"];\n var run = __dependency10__[\"default\"];\n var addObserver = __dependency11__.addObserver;\n var removeObserver = __dependency11__.removeObserver;\n\n var defineProperty = __dependency12__.defineProperty;\n var guidFor = __dependency13__.guidFor;\n var meta = __dependency13__.meta;\n var computed = __dependency14__.computed;\n var observer = __dependency15__.observer;\n\n var typeOf = __dependency13__.typeOf;\n var isArray = __dependency13__.isArray;\n var isNone = __dependency16__.isNone;\n var Mixin = __dependency15__.Mixin;\n var Container = __dependency17__[\"default\"];\n var A = __dependency18__.A;\n\n var instrument = __dependency19__.instrument;\n\n var dasherize = __dependency20__.dasherize;\n\n // ES6TODO: functions on EnumerableUtils should get their own export\n var EnumerableUtils = __dependency21__[\"default\"];\n var a_forEach = EnumerableUtils.forEach,\n a_addObject = EnumerableUtils.addObject,\n a_removeObject = EnumerableUtils.removeObject;\n\n var beforeObserver = __dependency15__.beforeObserver;\n var copy = __dependency22__[\"default\"];\n var isGlobalPath = __dependency23__.isGlobalPath;\n\n var propertyWillChange = __dependency24__.propertyWillChange;\n var propertyDidChange = __dependency24__.propertyDidChange;\n\n var cloneStates = __dependency25__.cloneStates;\n var states = __dependency25__.states;\n var jQuery = __dependency26__[\"default\"];\n // for the side effect of extending Ember.run.queues\n\n /**\n @module ember\n @submodule ember-views\n */\n\n var ContainerView;\n\n function nullViewsBuffer(view) {\n view.buffer = null;\n\n }\n\n function clearCachedElement(view) {\n meta(view).cache.element = undefined;\n }\n\n var childViewsProperty = computed(function() {\n var childViews = this._childViews, ret = A(), view = this;\n\n a_forEach(childViews, function(view) {\n var currentChildViews;\n if (view.isVirtual) {\n if (currentChildViews = get(view, 'childViews')) {\n ret.pushObjects(currentChildViews);\n }\n } else {\n ret.push(view);\n }\n });\n\n ret.replace = function (idx, removedCount, addedViews) {\n if (!ContainerView) { ContainerView = requireModule('ember-views/views/container_view')['default']; } // ES6TODO: stupid circular dep\n\n if (view instanceof ContainerView) {\n Ember.deprecate(\"Manipulating an Ember.ContainerView through its childViews property is deprecated. Please use the ContainerView instance itself as an Ember.MutableArray.\");\n return view.replace(idx, removedCount, addedViews);\n }\n throw new EmberError(\"childViews is immutable\");\n };\n\n return ret;\n });\n\n Ember.warn(\"The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.\", Ember.ENV.VIEW_PRESERVES_CONTEXT !== false);\n\n /**\n Global hash of shared templates. This will automatically be populated\n by the build tools so that you can store your Handlebars templates in\n separate files that get loaded into JavaScript at buildtime.\n\n @property TEMPLATES\n @for Ember\n @type Hash\n */\n Ember.TEMPLATES = {};\n\n /**\n `Ember.CoreView` is an abstract class that exists to give view-like behavior\n to both Ember's main view class `Ember.View` and other classes like\n `Ember._SimpleMetamorphView` that don't need the fully functionaltiy of\n `Ember.View`.\n\n Unless you have specific needs for `CoreView`, you will use `Ember.View`\n in your applications.\n\n @class CoreView\n @namespace Ember\n @extends Ember.Object\n @uses Ember.Evented\n @uses Ember.ActionHandler\n */\n\n var CoreView = EmberObject.extend(Evented, ActionHandler, {\n isView: true,\n\n states: cloneStates(states),\n\n init: function() {\n this._super();\n this.transitionTo('preRender');\n this._isVisible = get(this, 'isVisible');\n },\n\n /**\n If the view is currently inserted into the DOM of a parent view, this\n property will point to the parent of the view.\n\n @property parentView\n @type Ember.View\n @default null\n */\n parentView: computed('_parentView', function() {\n var parent = this._parentView;\n\n if (parent && parent.isVirtual) {\n return get(parent, 'parentView');\n } else {\n return parent;\n }\n }),\n\n state: null,\n\n _parentView: null,\n\n // return the current view, not including virtual views\n concreteView: computed('parentView', function() {\n if (!this.isVirtual) { return this; }\n else { return get(this, 'parentView.concreteView'); }\n }),\n\n instrumentName: 'core_view',\n\n instrumentDetails: function(hash) {\n hash.object = this.toString();\n hash.containerKey = this._debugContainerKey;\n hash.view = this;\n },\n\n /**\n Invoked by the view system when this view needs to produce an HTML\n representation. This method will create a new render buffer, if needed,\n then apply any default attributes, such as class names and visibility.\n Finally, the `render()` method is invoked, which is responsible for\n doing the bulk of the rendering.\n\n You should not need to override this method; instead, implement the\n `template` property, or if you need more control, override the `render`\n method.\n\n @method renderToBuffer\n @param {Ember.RenderBuffer} buffer the render buffer. If no buffer is\n passed, a default buffer, using the current view's `tagName`, will\n be used.\n @private\n */\n renderToBuffer: function(parentBuffer, bufferOperation) {\n var name = 'render.' + this.instrumentName,\n details = {};\n\n this.instrumentDetails(details);\n\n return instrument(name, details, function instrumentRenderToBuffer() {\n return this._renderToBuffer(parentBuffer, bufferOperation);\n }, this);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n // If this is the top-most view, start a new buffer. Otherwise,\n // create a new buffer relative to the original using the\n // provided buffer operation (for example, `insertAfter` will\n // insert a new buffer after the \"parent buffer\").\n var tagName = this.tagName;\n\n if (tagName === null || tagName === undefined) {\n tagName = 'div';\n }\n\n var buffer = this.buffer = parentBuffer && parentBuffer.begin(tagName) || RenderBuffer(tagName);\n this.transitionTo('inBuffer', false);\n\n this.beforeRender(buffer);\n this.render(buffer);\n this.afterRender(buffer);\n\n return buffer;\n },\n\n /**\n Override the default event firing from `Ember.Evented` to\n also call methods with the given name.\n\n @method trigger\n @param name {String}\n @private\n */\n trigger: function(name) {\n this._super.apply(this, arguments);\n var method = this[name];\n if (method) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n return method.apply(this, args);\n }\n },\n\n deprecatedSendHandles: function(actionName) {\n return !!this[actionName];\n },\n\n deprecatedSend: function(actionName) {\n var args = [].slice.call(arguments, 1);\n Ember.assert('' + this + \" has the action \" + actionName + \" but it is not a function\", typeof this[actionName] === 'function');\n Ember.deprecate('Action handlers implemented directly on views are deprecated in favor of action handlers on an `actions` object ( action: `' + actionName + '` on ' + this + ')', false);\n this[actionName].apply(this, args);\n return;\n },\n\n has: function(name) {\n return typeOf(this[name]) === 'function' || this._super(name);\n },\n\n destroy: function() {\n var parent = this._parentView;\n\n if (!this._super()) { return; }\n\n // destroy the element -- this will avoid each child view destroying\n // the element over and over again...\n if (!this.removedFromDOM) { this.destroyElement(); }\n\n // remove from parent if found. Don't call removeFromParent,\n // as removeFromParent will try to remove the element from\n // the DOM again.\n if (parent) { parent.removeChild(this); }\n\n this.transitionTo('destroying', false);\n\n return this;\n },\n\n clearRenderedChildren: Ember.K,\n triggerRecursively: Ember.K,\n invokeRecursively: Ember.K,\n transitionTo: Ember.K,\n destroyElement: Ember.K\n });\n\n var ViewCollection = function(initialViews) {\n var views = this.views = initialViews || [];\n this.length = views.length;\n };\n\n ViewCollection.prototype = {\n length: 0,\n\n trigger: function(eventName) {\n var views = this.views, view;\n for (var i = 0, l = views.length; i < l; i++) {\n view = views[i];\n if (view.trigger) { view.trigger(eventName); }\n }\n },\n\n triggerRecursively: function(eventName) {\n var views = this.views;\n for (var i = 0, l = views.length; i < l; i++) {\n views[i].triggerRecursively(eventName);\n }\n },\n\n invokeRecursively: function(fn) {\n var views = this.views, view;\n\n for (var i = 0, l = views.length; i < l; i++) {\n view = views[i];\n fn(view);\n }\n },\n\n transitionTo: function(state, children) {\n var views = this.views;\n for (var i = 0, l = views.length; i < l; i++) {\n views[i].transitionTo(state, children);\n }\n },\n\n push: function() {\n this.length += arguments.length;\n var views = this.views;\n return views.push.apply(views, arguments);\n },\n\n objectAt: function(idx) {\n return this.views[idx];\n },\n\n forEach: function(callback) {\n var views = this.views;\n return a_forEach(views, callback);\n },\n\n clear: function() {\n this.length = 0;\n this.views.length = 0;\n }\n };\n\n var EMPTY_ARRAY = [];\n\n /**\n `Ember.View` is the class in Ember responsible for encapsulating templates of\n HTML content, combining templates with data to render as sections of a page's\n DOM, and registering and responding to user-initiated events.\n\n ## HTML Tag\n\n The default HTML tag name used for a view's DOM representation is `div`. This\n can be customized by setting the `tagName` property. The following view\n class:\n\n ```javascript\n ParagraphView = Ember.View.extend({\n tagName: 'em'\n });\n ```\n\n Would result in instances with the following HTML:\n\n ```html\n <em id=\"ember1\" class=\"ember-view\"></em>\n ```\n\n ## HTML `class` Attribute\n\n The HTML `class` attribute of a view's tag can be set by providing a\n `classNames` property that is set to an array of strings:\n\n ```javascript\n MyView = Ember.View.extend({\n classNames: ['my-class', 'my-other-class']\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view my-class my-other-class\"></div>\n ```\n\n `class` attribute values can also be set by providing a `classNameBindings`\n property set to an array of properties names for the view. The return value\n of these properties will be added as part of the value for the view's `class`\n attribute. These properties can be computed properties:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['propertyA', 'propertyB'],\n propertyA: 'from-a',\n propertyB: function() {\n if (someLogic) { return 'from-b'; }\n }.property()\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view from-a from-b\"></div>\n ```\n\n If the value of a class name binding returns a boolean the property name\n itself will be used as the class name if the property is true. The class name\n will not be added if the value is `false` or `undefined`.\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['hovered'],\n hovered: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view hovered\"></div>\n ```\n\n When using boolean class name bindings you can supply a string value other\n than the property name for use as the `class` HTML attribute by appending the\n preferred value after a \":\" character when defining the binding:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['awesome:so-very-cool'],\n awesome: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view so-very-cool\"></div>\n ```\n\n Boolean value class name bindings whose property names are in a\n camelCase-style format will be converted to a dasherized format:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['isUrgent'],\n isUrgent: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view is-urgent\"></div>\n ```\n\n Class name bindings can also refer to object values that are found by\n traversing a path relative to the view itself:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['messages.empty']\n messages: Ember.Object.create({\n empty: true\n })\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view empty\"></div>\n ```\n\n If you want to add a class name for a property which evaluates to true and\n and a different class name if it evaluates to false, you can pass a binding\n like this:\n\n ```javascript\n // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false\n Ember.View.extend({\n classNameBindings: ['isEnabled:enabled:disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view enabled\"></div>\n ```\n\n When isEnabled is `false`, the resulting HTML reprensentation looks like\n this:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n This syntax offers the convenience to add a class if a property is `false`:\n\n ```javascript\n // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\n Ember.View.extend({\n classNameBindings: ['isEnabled::disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\"></div>\n ```\n\n When the `isEnabled` property on the view is set to `false`, it will result\n in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n Updates to the the value of a class name binding will result in automatic\n update of the HTML `class` attribute in the view's rendered HTML\n representation. If the value becomes `false` or `undefined` the class name\n will be removed.\n\n Both `classNames` and `classNameBindings` are concatenated properties. See\n [Ember.Object](/api/classes/Ember.Object.html) documentation for more\n information about concatenated properties.\n\n ## HTML Attributes\n\n The HTML attribute section of a view's tag can be set by providing an\n `attributeBindings` property set to an array of property names on the view.\n The return value of these properties will be used as the value of the view's\n HTML associated attribute:\n\n ```javascript\n AnchorView = Ember.View.extend({\n tagName: 'a',\n attributeBindings: ['href'],\n href: 'http://google.com'\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n ```\n \n One property can be mapped on to another by placing a \":\" between \n the source property and the destination property:\n \n ```javascript\n AnchorView = Ember.View.extend({\n tagName: 'a',\n attributeBindings: ['url:href'],\n url: 'http://google.com'\n });\n ```\n \n Will result in view instances with an HTML representation of:\n\n ```html\n <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n ```\n \n If the return value of an `attributeBindings` monitored property is a boolean\n the property will follow HTML's pattern of repeating the attribute's name as\n its value:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <input id=\"ember1\" class=\"ember-view\" disabled=\"disabled\" />\n ```\n\n `attributeBindings` can refer to computed properties:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: function() {\n if (someLogic) {\n return true;\n } else {\n return false;\n }\n }.property()\n });\n ```\n\n Updates to the the property of an attribute binding will result in automatic\n update of the HTML attribute in the view's rendered HTML representation.\n\n `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html)\n documentation for more information about concatenated properties.\n\n ## Templates\n\n The HTML contents of a view's rendered representation are determined by its\n template. Templates can be any function that accepts an optional context\n parameter and returns a string of HTML that will be inserted within the\n view's tag. Most typically in Ember this function will be a compiled\n `Ember.Handlebars` template.\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('I am the template')\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I am the template</div>\n ```\n\n Within an Ember application is more common to define a Handlebars templates as\n part of a page:\n\n ```html\n <script type='text/x-handlebars' data-template-name='some-template'>\n Hello\n </script>\n ```\n\n And associate it by name using a view's `templateName` property:\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'some-template'\n });\n ```\n\n If you have nested resources, your Handlebars template will look like this:\n\n ```html\n <script type='text/x-handlebars' data-template-name='posts/new'>\n <h1>New Post</h1>\n </script>\n ```\n\n And `templateName` property:\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'posts/new'\n });\n ```\n\n Using a value for `templateName` that does not have a Handlebars template\n with a matching `data-template-name` attribute will throw an error.\n\n For views classes that may have a template later defined (e.g. as the block\n portion of a `{{view}}` Handlebars helper call in another template or in\n a subclass), you can provide a `defaultTemplate` property set to compiled\n template function. If a template is not later provided for the view instance\n the `defaultTemplate` value will be used:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default'),\n template: null,\n templateName: null\n });\n ```\n\n Will result in instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the default</div>\n ```\n\n If a `template` or `templateName` is provided it will take precedence over\n `defaultTemplate`:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default')\n });\n\n aView = AView.create({\n template: Ember.Handlebars.compile('I was the template, not default')\n });\n ```\n\n Will result in the following HTML representation when rendered:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the template, not default</div>\n ```\n\n ## View Context\n\n The default context of the compiled template is the view's controller:\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('Hello {{excitedGreeting}}')\n });\n\n aController = Ember.Object.create({\n firstName: 'Barry',\n excitedGreeting: function() {\n return this.get(\"content.firstName\") + \"!!!\"\n }.property()\n });\n\n aView = AView.create({\n controller: aController,\n });\n ```\n\n Will result in an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">Hello Barry!!!</div>\n ```\n\n A context can also be explicitly supplied through the view's `context`\n property. If the view has neither `context` nor `controller` properties, the\n `parentView`'s context will be used.\n\n ## Layouts\n\n Views can have a secondary template that wraps their main template. Like\n primary templates, layouts can be any function that accepts an optional\n context parameter and returns a string of HTML that will be inserted inside\n view's tag. Views whose HTML element is self closing (e.g. `<input />`)\n cannot have a layout and this property will be ignored.\n\n Most typically in Ember a layout will be a compiled `Ember.Handlebars`\n template.\n\n A view's layout can be set directly with the `layout` property or reference\n an existing Handlebars template by name with the `layoutName` property.\n\n A template used as a layout must contain a single use of the Handlebars\n `{{yield}}` helper. The HTML contents of a view's rendered `template` will be\n inserted at this location:\n\n ```javascript\n AViewWithLayout = Ember.View.extend({\n layout: Ember.Handlebars.compile(\"<div class='my-decorative-class'>{{yield}}</div>\")\n template: Ember.Handlebars.compile(\"I got wrapped\"),\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div class=\"my-decorative-class\">\n I got wrapped\n </div>\n </div>\n ```\n\n See [Ember.Handlebars.helpers.yield](/api/classes/Ember.Handlebars.helpers.html#method_yield)\n for more information.\n\n ## Responding to Browser Events\n\n Views can respond to user-initiated events in one of three ways: method\n implementation, through an event manager, and through `{{action}}` helper use\n in their template or layout.\n\n ### Method Implementation\n\n Views can respond to user-initiated events by implementing a method that\n matches the event name. A `jQuery.Event` object will be passed as the\n argument to this method.\n\n ```javascript\n AView = Ember.View.extend({\n click: function(event) {\n // will be called when when an instance's\n // rendered element is clicked\n }\n });\n ```\n\n ### Event Managers\n\n Views can define an object as their `eventManager` property. This object can\n then implement methods that match the desired event names. Matching events\n that occur on the view's rendered HTML or the rendered HTML of any of its DOM\n descendants will trigger this method. A `jQuery.Event` object will be passed\n as the first argument to the method and an `Ember.View` object as the\n second. The `Ember.View` will be the view whose rendered HTML was interacted\n with. This may be the view with the `eventManager` property or one of its\n descendent views.\n\n ```javascript\n AView = Ember.View.extend({\n eventManager: Ember.Object.create({\n doubleClick: function(event, view) {\n // will be called when when an instance's\n // rendered element or any rendering\n // of this views's descendent\n // elements is clicked\n }\n })\n });\n ```\n\n An event defined for an event manager takes precedence over events of the\n same name handled through methods on the view.\n\n ```javascript\n AView = Ember.View.extend({\n mouseEnter: function(event) {\n // will never trigger.\n },\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // takes precedence over AView#mouseEnter\n }\n })\n });\n ```\n\n Similarly a view's event manager will take precedence for events of any views\n rendered as a descendent. A method name that matches an event name will not\n be called if the view instance was rendered inside the HTML representation of\n a view that has an `eventManager` property defined that handles events of the\n name. Events not handled by the event manager will still trigger method calls\n on the descendent.\n\n ```javascript\n OuterView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"outer {{#view InnerView}}inner{{/view}} outer\"),\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // view might be instance of either\n // OuterView or InnerView depending on\n // where on the page the user interaction occured\n }\n })\n });\n\n InnerView = Ember.View.extend({\n click: function(event) {\n // will be called if rendered inside\n // an OuterView because OuterView's\n // eventManager doesn't handle click events\n },\n mouseEnter: function(event) {\n // will never be called if rendered inside\n // an OuterView.\n }\n });\n ```\n\n ### Handlebars `{{action}}` Helper\n\n See [Handlebars.helpers.action](/api/classes/Ember.Handlebars.helpers.html#method_action).\n\n ### Event Names\n\n All of the event handling approaches described above respond to the same set\n of events. The names of the built-in events are listed below. (The hash of\n built-in events exists in `Ember.EventDispatcher`.) Additional, custom events\n can be registered by using `Ember.Application.customEvents`.\n\n Touch events:\n\n * `touchStart`\n * `touchMove`\n * `touchEnd`\n * `touchCancel`\n\n Keyboard events\n\n * `keyDown`\n * `keyUp`\n * `keyPress`\n\n Mouse events\n\n * `mouseDown`\n * `mouseUp`\n * `contextMenu`\n * `click`\n * `doubleClick`\n * `mouseMove`\n * `focusIn`\n * `focusOut`\n * `mouseEnter`\n * `mouseLeave`\n\n Form events:\n\n * `submit`\n * `change`\n * `focusIn`\n * `focusOut`\n * `input`\n\n HTML5 drag and drop events:\n\n * `dragStart`\n * `drag`\n * `dragEnter`\n * `dragLeave`\n * `dragOver`\n * `dragEnd`\n * `drop`\n\n ## Handlebars `{{view}}` Helper\n\n Other `Ember.View` instances can be included as part of a view's template by\n using the `{{view}}` Handlebars helper. See [Ember.Handlebars.helpers.view](/api/classes/Ember.Handlebars.helpers.html#method_view)\n for additional information.\n\n @class View\n @namespace Ember\n @extends Ember.CoreView\n */\n var View = CoreView.extend({\n\n concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'],\n\n /**\n @property isView\n @type Boolean\n @default true\n @static\n */\n isView: true,\n\n // ..........................................................\n // TEMPLATE SUPPORT\n //\n\n /**\n The name of the template to lookup if no template is provided.\n\n By default `Ember.View` will lookup a template with this name in\n `Ember.TEMPLATES` (a shared global object).\n\n @property templateName\n @type String\n @default null\n */\n templateName: null,\n\n /**\n The name of the layout to lookup if no layout is provided.\n\n By default `Ember.View` will lookup a template with this name in\n `Ember.TEMPLATES` (a shared global object).\n\n @property layoutName\n @type String\n @default null\n */\n layoutName: null,\n\n /**\n Used to identify this view during debugging\n\n @property instrumentDisplay\n @type String\n */\n instrumentDisplay: computed(function() {\n if (this.helperName) {\n return '{{' + this.helperName + '}}';\n }\n }),\n\n /**\n The template used to render the view. This should be a function that\n accepts an optional context parameter and returns a string of HTML that\n will be inserted into the DOM relative to its parent view.\n\n In general, you should set the `templateName` property instead of setting\n the template yourself.\n\n @property template\n @type Function\n */\n template: computed('templateName', function(key, value) {\n if (value !== undefined) { return value; }\n\n var templateName = get(this, 'templateName'),\n template = this.templateForName(templateName, 'template');\n\n Ember.assert(\"You specified the templateName \" + templateName + \" for \" + this + \", but it did not exist.\", !templateName || template);\n\n return template || get(this, 'defaultTemplate');\n }),\n\n /**\n The controller managing this view. If this property is set, it will be\n made available for use by the template.\n\n @property controller\n @type Object\n */\n controller: computed('_parentView', function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }),\n\n /**\n A view may contain a layout. A layout is a regular template but\n supersedes the `template` property during rendering. It is the\n responsibility of the layout template to retrieve the `template`\n property from the view (or alternatively, call `Handlebars.helpers.yield`,\n `{{yield}}`) to render it in the correct location.\n\n This is useful for a view that has a shared wrapper, but which delegates\n the rendering of the contents of the wrapper to the `template` property\n on a subclass.\n\n @property layout\n @type Function\n */\n layout: computed(function(key) {\n var layoutName = get(this, 'layoutName'),\n layout = this.templateForName(layoutName, 'layout');\n\n Ember.assert(\"You specified the layoutName \" + layoutName + \" for \" + this + \", but it did not exist.\", !layoutName || layout);\n\n return layout || get(this, 'defaultLayout');\n }).property('layoutName'),\n\n _yield: function(context, options) {\n var template = get(this, 'template');\n if (template) { template(context, options); }\n },\n\n templateForName: function(name, type) {\n if (!name) { return; }\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n // the defaultContainer is deprecated\n var container = this.container || (Container && Container.defaultContainer);\n return container && container.lookup('template:' + name);\n },\n\n /**\n The object from which templates should access properties.\n\n This object will be passed to the template function each time the render\n method is called, but it is up to the individual function to decide what\n to do with it.\n\n By default, this will be the view's controller.\n\n @property context\n @type Object\n */\n context: computed(function(key, value) {\n if (arguments.length === 2) {\n set(this, '_context', value);\n return value;\n } else {\n return get(this, '_context');\n }\n }).volatile(),\n\n /**\n Private copy of the view's template context. This can be set directly\n by Handlebars without triggering the observer that causes the view\n to be re-rendered.\n\n The context of a view is looked up as follows:\n\n 1. Supplied context (usually by Handlebars)\n 2. Specified controller\n 3. `parentView`'s context (for a child of a ContainerView)\n\n The code in Handlebars that overrides the `_context` property first\n checks to see whether the view has a specified controller. This is\n something of a hack and should be revisited.\n\n @property _context\n @private\n */\n _context: computed(function(key) {\n var parentView, controller;\n\n if (controller = get(this, 'controller')) {\n return controller;\n }\n\n parentView = this._parentView;\n if (parentView) {\n return get(parentView, '_context');\n }\n\n return null;\n }),\n\n /**\n If a value that affects template rendering changes, the view should be\n re-rendered to reflect the new value.\n\n @method _contextDidChange\n @private\n */\n _contextDidChange: observer('context', function() {\n this.rerender();\n }),\n\n /**\n If `false`, the view will appear hidden in DOM.\n\n @property isVisible\n @type Boolean\n @default null\n */\n isVisible: true,\n\n /**\n Array of child views. You should never edit this array directly.\n Instead, use `appendChild` and `removeFromParent`.\n\n @property childViews\n @type Array\n @default []\n @private\n */\n childViews: childViewsProperty,\n\n _childViews: EMPTY_ARRAY,\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews will change.\n _childViewsWillChange: beforeObserver('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { propertyWillChange(parentView, 'childViews'); }\n }\n }),\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews did change.\n _childViewsDidChange: observer('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { propertyDidChange(parentView, 'childViews'); }\n }\n }),\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class.\n\n @method nearestInstanceOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n @deprecated\n */\n nearestInstanceOf: function(klass) {\n Ember.deprecate(\"nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.\");\n var view = get(this, 'parentView');\n\n while (view) {\n if (view instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class or mixin.\n\n @method nearestOfType\n @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself),\n or an instance of Ember.Mixin.\n @return Ember.View\n */\n nearestOfType: function(klass) {\n var view = get(this, 'parentView'),\n isOfType = klass instanceof Mixin ?\n function(view) { return klass.detect(view); } :\n function(view) { return klass.detect(view.constructor); };\n\n while (view) {\n if (isOfType(view)) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that has a given property.\n\n @method nearestWithProperty\n @param {String} property A property name\n @return Ember.View\n */\n nearestWithProperty: function(property) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (property in view) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor whose parent is an instance of\n `klass`.\n\n @method nearestChildOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n */\n nearestChildOf: function(klass) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (get(view, 'parentView') instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n When the parent view changes, recursively invalidate `controller`\n\n @method _parentViewDidChange\n @private\n */\n _parentViewDidChange: observer('_parentView', function() {\n if (this.isDestroying) { return; }\n\n this.trigger('parentViewDidChange');\n\n if (get(this, 'parentView.controller') && !get(this, 'controller')) {\n this.notifyPropertyChange('controller');\n }\n }),\n\n _controllerDidChange: observer('controller', function() {\n if (this.isDestroying) { return; }\n\n this.rerender();\n\n this.forEachChildView(function(view) {\n view.propertyDidChange('controller');\n });\n }),\n\n cloneKeywords: function() {\n var templateData = get(this, 'templateData');\n\n var keywords = templateData ? copy(templateData.keywords) : {};\n set(keywords, 'view', get(this, 'concreteView'));\n set(keywords, '_view', this);\n set(keywords, 'controller', get(this, 'controller'));\n\n return keywords;\n },\n\n /**\n Called on your view when it should push strings of HTML into a\n `Ember.RenderBuffer`. Most users will want to override the `template`\n or `templateName` properties instead of this method.\n\n By default, `Ember.View` will look for a function in the `template`\n property and invoke it with the value of `context`. The value of\n `context` will be the view's controller unless you override it.\n\n @method render\n @param {Ember.RenderBuffer} buffer The render buffer\n */\n render: function(buffer) {\n // If this view has a layout, it is the responsibility of the\n // the layout to render the view's template. Otherwise, render the template\n // directly.\n var template = get(this, 'layout') || get(this, 'template');\n\n if (template) {\n var context = get(this, 'context');\n var keywords = this.cloneKeywords();\n var output;\n\n var data = {\n view: this,\n buffer: buffer,\n isRenderData: true,\n keywords: keywords,\n insideGroup: get(this, 'templateData.insideGroup')\n };\n\n // Invoke the template with the provided template context, which\n // is the view's controller by default. A hash of data is also passed that provides\n // the template with access to the view and render buffer.\n\n Ember.assert('template must be a function. Did you mean to call Ember.Handlebars.compile(\"...\") or specify templateName instead?', typeof template === 'function');\n // The template should write directly to the render buffer instead\n // of returning a string.\n output = template(context, { data: data });\n\n // If the template returned a string instead of writing to the buffer,\n // push the string onto the buffer.\n if (output !== undefined) { buffer.push(output); }\n }\n },\n\n /**\n Renders the view again. This will work regardless of whether the\n view is already in the DOM or not. If the view is in the DOM, the\n rendering process will be deferred to give bindings a chance\n to synchronize.\n\n If children were added during the rendering process using `appendChild`,\n `rerender` will remove them, because they will be added again\n if needed by the next `render`.\n\n In general, if the display of your view changes, you should modify\n the DOM element directly instead of manually calling `rerender`, which can\n be slow.\n\n @method rerender\n */\n rerender: function() {\n return this.currentState.rerender(this);\n },\n\n clearRenderedChildren: function() {\n var lengthBefore = this.lengthBeforeRender,\n lengthAfter = this.lengthAfterRender;\n\n // If there were child views created during the last call to render(),\n // remove them under the assumption that they will be re-created when\n // we re-render.\n\n // VIEW-TODO: Unit test this path.\n var childViews = this._childViews;\n for (var i=lengthAfter-1; i>=lengthBefore; i--) {\n if (childViews[i]) { childViews[i].destroy(); }\n }\n },\n\n /**\n Iterates over the view's `classNameBindings` array, inserts the value\n of the specified property into the `classNames` array, then creates an\n observer to update the view's element if the bound property ever changes\n in the future.\n\n @method _applyClassNameBindings\n @private\n */\n _applyClassNameBindings: function(classBindings) {\n var classNames = this.classNames,\n elem, newClass, dasherizedClass;\n\n // Loop through all of the configured bindings. These will be either\n // property names ('isUrgent') or property paths relative to the view\n // ('content.isUrgent')\n a_forEach(classBindings, function(binding) {\n\n Ember.assert(\"classNameBindings must not have spaces in them. Multiple class name bindings can be provided as elements of an array, e.g. ['foo', ':bar']\", binding.indexOf(' ') === -1);\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n // Extract just the property name from bindings like 'foo:bar'\n var parsedPath = View._parsePropertyPath(binding);\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n var observer = function() {\n // Get the current value of the property\n newClass = this._classStringForProperty(binding);\n elem = this.$();\n\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n // Also remove from classNames so that if the view gets rerendered,\n // the class doesn't get added back to the DOM.\n classNames.removeObject(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n };\n\n // Get the class name for the property at its current value\n dasherizedClass = this._classStringForProperty(binding);\n\n if (dasherizedClass) {\n // Ensure that it gets into the classNames array\n // so it is displayed when we render.\n a_addObject(classNames, dasherizedClass);\n\n // Save a reference to the class name so we can remove it\n // if the observer fires. Remember that this variable has\n // been closed over by the observer.\n oldClass = dasherizedClass;\n }\n\n this.registerObserver(this, parsedPath.path, observer);\n // Remove className so when the view is rerendered,\n // the className is added based on binding reevaluation\n this.one('willClearRender', function() {\n if (oldClass) {\n classNames.removeObject(oldClass);\n oldClass = null;\n }\n });\n\n }, this);\n },\n\n _unspecifiedAttributeBindings: null,\n\n /**\n Iterates through the view's attribute bindings, sets up observers for each,\n then applies the current value of the attributes to the passed render buffer.\n\n @method _applyAttributeBindings\n @param {Ember.RenderBuffer} buffer\n @private\n */\n _applyAttributeBindings: function(buffer, attributeBindings) {\n var attributeValue,\n unspecifiedAttributeBindings = this._unspecifiedAttributeBindings = this._unspecifiedAttributeBindings || {};\n\n a_forEach(attributeBindings, function(binding) {\n var split = binding.split(':'),\n property = split[0],\n attributeName = split[1] || property;\n\n if (property in this) {\n this._setupAttributeBindingObservation(property, attributeName);\n\n // Determine the current value and add it to the render buffer\n // if necessary.\n attributeValue = get(this, property);\n View.applyAttributeBindings(buffer, attributeName, attributeValue);\n } else {\n unspecifiedAttributeBindings[property] = attributeName;\n }\n }, this);\n\n // Lazily setup setUnknownProperty after attributeBindings are initially applied\n this.setUnknownProperty = this._setUnknownProperty;\n },\n\n _setupAttributeBindingObservation: function(property, attributeName) {\n var attributeValue, elem;\n\n // Create an observer to add/remove/change the attribute if the\n // JavaScript property changes.\n var observer = function() {\n elem = this.$();\n\n attributeValue = get(this, property);\n\n View.applyAttributeBindings(elem, attributeName, attributeValue);\n };\n\n this.registerObserver(this, property, observer);\n },\n\n /**\n We're using setUnknownProperty as a hook to setup attributeBinding observers for\n properties that aren't defined on a view at initialization time.\n\n Note: setUnknownProperty will only be called once for each property.\n\n @method setUnknownProperty\n @param key\n @param value\n @private\n */\n setUnknownProperty: null, // Gets defined after initialization by _applyAttributeBindings\n\n _setUnknownProperty: function(key, value) {\n var attributeName = this._unspecifiedAttributeBindings && this._unspecifiedAttributeBindings[key];\n if (attributeName) {\n this._setupAttributeBindingObservation(key, attributeName);\n }\n\n defineProperty(this, key);\n return set(this, key, value);\n },\n\n /**\n Given a property name, returns a dasherized version of that\n property name if the property evaluates to a non-falsy value.\n\n For example, if the view has property `isUrgent` that evaluates to true,\n passing `isUrgent` to this method will return `\"is-urgent\"`.\n\n @method _classStringForProperty\n @param property\n @private\n */\n _classStringForProperty: function(property) {\n var parsedPath = View._parsePropertyPath(property);\n var path = parsedPath.path;\n\n var val = get(this, path);\n if (val === undefined && isGlobalPath(path)) {\n val = get(Ember.lookup, path);\n }\n\n return View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n },\n\n // ..........................................................\n // ELEMENT SUPPORT\n //\n\n /**\n Returns the current DOM element for the view.\n\n @property element\n @type DOMElement\n */\n element: computed('_parentView', function(key, value) {\n if (value !== undefined) {\n return this.currentState.setElement(this, value);\n } else {\n return this.currentState.getElement(this);\n }\n }),\n\n /**\n Returns a jQuery object for this view's element. If you pass in a selector\n string, this method will return a jQuery object, using the current element\n as its buffer.\n\n For example, calling `view.$('li')` will return a jQuery object containing\n all of the `li` elements inside the DOM element of this view.\n\n @method $\n @param {String} [selector] a jQuery-compatible selector string\n @return {jQuery} the jQuery object for the DOM node\n */\n $: function(sel) {\n return this.currentState.$(this, sel);\n },\n\n mutateChildViews: function(callback) {\n var childViews = this._childViews,\n idx = childViews.length,\n view;\n\n while(--idx >= 0) {\n view = childViews[idx];\n callback(this, view, idx);\n }\n\n return this;\n },\n\n forEachChildView: function(callback) {\n var childViews = this._childViews;\n\n if (!childViews) { return this; }\n\n var len = childViews.length,\n view, idx;\n\n for (idx = 0; idx < len; idx++) {\n view = childViews[idx];\n callback(view);\n }\n\n return this;\n },\n\n /**\n Appends the view's element to the specified parent element.\n\n If the view does not have an HTML representation yet, `createElement()`\n will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing.\n\n This is not typically a function that you will need to call directly when\n building your application. You might consider using `Ember.ContainerView`\n instead. If you do need to use `appendTo`, be sure that the target element\n you are providing is associated with an `Ember.Application` and does not\n have an ancestor element that is associated with an Ember view.\n\n @method appendTo\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} receiver\n */\n appendTo: function(target) {\n // Schedule the DOM element to be created and appended to the given\n // element after bindings have synchronized.\n this._insertElementLater(function() {\n Ember.assert(\"You tried to append to (\" + target + \") but that isn't in the DOM\", jQuery(target).length > 0);\n Ember.assert(\"You cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.\", !jQuery(target).is('.ember-view') && !jQuery(target).parents().is('.ember-view'));\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n Replaces the content of the specified parent element with this view's\n element. If the view does not have an HTML representation yet,\n `createElement()` will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing\n\n @method replaceIn\n @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object\n @return {Ember.View} received\n */\n replaceIn: function(target) {\n Ember.assert(\"You tried to replace in (\" + target + \") but that isn't in the DOM\", jQuery(target).length > 0);\n Ember.assert(\"You cannot replace an existing Ember.View. Consider using Ember.ContainerView instead.\", !jQuery(target).is('.ember-view') && !jQuery(target).parents().is('.ember-view'));\n\n this._insertElementLater(function() {\n jQuery(target).empty();\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n Schedules a DOM operation to occur during the next render phase. This\n ensures that all bindings have finished synchronizing before the view is\n rendered.\n\n To use, pass a function that performs a DOM operation.\n\n Before your function is called, this view and all child views will receive\n the `willInsertElement` event. After your function is invoked, this view\n and all of its child views will receive the `didInsertElement` event.\n\n ```javascript\n view._insertElementLater(function() {\n this.createElement();\n this.$().appendTo('body');\n });\n ```\n\n @method _insertElementLater\n @param {Function} fn the function that inserts the element into the DOM\n @private\n */\n _insertElementLater: function(fn) {\n this._scheduledInsert = run.scheduleOnce('render', this, '_insertElement', fn);\n },\n\n _insertElement: function (fn) {\n this._scheduledInsert = null;\n this.currentState.insertElement(this, fn);\n },\n\n /**\n Appends the view's element to the document body. If the view does\n not have an HTML representation yet, `createElement()` will be called\n automatically.\n\n If your application uses the `rootElement` property, you must append\n the view within that element. Rendering views outside of the `rootElement`\n is not supported.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the document body until all bindings have\n finished synchronizing.\n\n @method append\n @return {Ember.View} receiver\n */\n append: function() {\n return this.appendTo(document.body);\n },\n\n /**\n Removes the view's element from the element to which it is attached.\n\n @method remove\n @return {Ember.View} receiver\n */\n remove: function() {\n // What we should really do here is wait until the end of the run loop\n // to determine if the element has been re-appended to a different\n // element.\n // In the interim, we will just re-render if that happens. It is more\n // important than elements get garbage collected.\n if (!this.removedFromDOM) { this.destroyElement(); }\n this.invokeRecursively(function(view) {\n if (view.clearRenderedChildren) { view.clearRenderedChildren(); }\n });\n },\n\n elementId: null,\n\n /**\n Attempts to discover the element in the parent element. The default\n implementation looks for an element with an ID of `elementId` (or the\n view's guid if `elementId` is null). You can override this method to\n provide your own form of lookup. For example, if you want to discover your\n element using a CSS class name instead of an ID.\n\n @method findElementInParentElement\n @param {DOMElement} parentElement The parent's DOM element\n @return {DOMElement} The discovered element\n */\n findElementInParentElement: function(parentElem) {\n var id = \"#\" + this.elementId;\n return jQuery(id)[0] || jQuery(id, parentElem)[0];\n },\n\n /**\n Creates a DOM representation of the view and all of its\n child views by recursively calling the `render()` method.\n\n After the element has been created, `didInsertElement` will\n be called on this view and all of its child views.\n\n @method createElement\n @return {Ember.View} receiver\n */\n createElement: function() {\n if (get(this, 'element')) { return this; }\n\n var buffer = this.renderToBuffer();\n set(this, 'element', buffer.element());\n\n return this;\n },\n\n /**\n Called when a view is going to insert an element into the DOM.\n\n @event willInsertElement\n */\n willInsertElement: Ember.K,\n\n /**\n Called when the element of the view has been inserted into the DOM\n or after the view was re-rendered. Override this function to do any\n set up that requires an element in the document body.\n\n @event didInsertElement\n */\n didInsertElement: Ember.K,\n\n /**\n Called when the view is about to rerender, but before anything has\n been torn down. This is a good opportunity to tear down any manual\n observers you have installed based on the DOM state\n\n @event willClearRender\n */\n willClearRender: Ember.K,\n\n /**\n Run this callback on the current view (unless includeSelf is false) and recursively on child views.\n\n @method invokeRecursively\n @param fn {Function}\n @param includeSelf {Boolean} Includes itself if true.\n @private\n */\n invokeRecursively: function(fn, includeSelf) {\n var childViews = (includeSelf === false) ? this._childViews : [this];\n var currentViews, view, currentChildViews;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n currentChildViews = view._childViews ? view._childViews.slice(0) : null;\n fn(view);\n if (currentChildViews) {\n childViews.push.apply(childViews, currentChildViews);\n }\n }\n }\n },\n\n triggerRecursively: function(eventName) {\n var childViews = [this], currentViews, view, currentChildViews;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n currentChildViews = view._childViews ? view._childViews.slice(0) : null;\n if (view.trigger) { view.trigger(eventName); }\n if (currentChildViews) {\n childViews.push.apply(childViews, currentChildViews);\n }\n\n }\n }\n },\n\n viewHierarchyCollection: function() {\n var currentView, viewCollection = new ViewCollection([this]);\n\n for (var i = 0; i < viewCollection.length; i++) {\n currentView = viewCollection.objectAt(i);\n if (currentView._childViews) {\n viewCollection.push.apply(viewCollection, currentView._childViews);\n }\n }\n\n return viewCollection;\n },\n\n /**\n Destroys any existing element along with the element for any child views\n as well. If the view does not currently have a element, then this method\n will do nothing.\n\n If you implement `willDestroyElement()` on your view, then this method will\n be invoked on your view before your element is destroyed to give you a\n chance to clean up any event handlers, etc.\n\n If you write a `willDestroyElement()` handler, you can assume that your\n `didInsertElement()` handler was called earlier for the same element.\n\n You should not call or override this method yourself, but you may\n want to implement the above callbacks.\n\n @method destroyElement\n @return {Ember.View} receiver\n */\n destroyElement: function() {\n return this.currentState.destroyElement(this);\n },\n\n /**\n Called when the element of the view is going to be destroyed. Override\n this function to do any teardown that requires an element, like removing\n event listeners.\n\n @event willDestroyElement\n */\n willDestroyElement: Ember.K,\n\n /**\n Triggers the `willDestroyElement` event (which invokes the\n `willDestroyElement()` method if it exists) on this view and all child\n views.\n\n Before triggering `willDestroyElement`, it first triggers the\n `willClearRender` event recursively.\n\n @method _notifyWillDestroyElement\n @private\n */\n _notifyWillDestroyElement: function() {\n var viewCollection = this.viewHierarchyCollection();\n viewCollection.trigger('willClearRender');\n viewCollection.trigger('willDestroyElement');\n return viewCollection;\n },\n\n /**\n If this view's element changes, we need to invalidate the caches of our\n child views so that we do not retain references to DOM elements that are\n no longer needed.\n\n @method _elementDidChange\n @private\n */\n _elementDidChange: observer('element', function() {\n this.forEachChildView(clearCachedElement);\n }),\n\n /**\n Called when the parentView property has changed.\n\n @event parentViewDidChange\n */\n parentViewDidChange: Ember.K,\n\n instrumentName: 'view',\n\n instrumentDetails: function(hash) {\n hash.template = get(this, 'templateName');\n this._super(hash);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n this.lengthBeforeRender = this._childViews.length;\n var buffer = this._super(parentBuffer, bufferOperation);\n this.lengthAfterRender = this._childViews.length;\n\n return buffer;\n },\n\n renderToBufferIfNeeded: function (buffer) {\n return this.currentState.renderToBufferIfNeeded(this, buffer);\n },\n\n beforeRender: function(buffer) {\n this.applyAttributesToBuffer(buffer);\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n },\n\n applyAttributesToBuffer: function(buffer) {\n // Creates observers for all registered class name and attribute bindings,\n // then adds them to the element.\n var classNameBindings = get(this, 'classNameBindings');\n if (classNameBindings.length) {\n this._applyClassNameBindings(classNameBindings);\n }\n\n // Pass the render buffer so the method can apply attributes directly.\n // This isn't needed for class name bindings because they use the\n // existing classNames infrastructure.\n var attributeBindings = get(this, 'attributeBindings');\n if (attributeBindings.length) {\n this._applyAttributeBindings(buffer, attributeBindings);\n }\n\n buffer.setClasses(this.classNames);\n buffer.id(this.elementId);\n\n var role = get(this, 'ariaRole');\n if (role) {\n buffer.attr('role', role);\n }\n\n if (get(this, 'isVisible') === false) {\n buffer.style('display', 'none');\n }\n },\n\n // ..........................................................\n // STANDARD RENDER PROPERTIES\n //\n\n /**\n Tag name for the view's outer element. The tag name is only used when an\n element is first created. If you change the `tagName` for an element, you\n must destroy and recreate the view element.\n\n By default, the render buffer will use a `<div>` tag for views.\n\n @property tagName\n @type String\n @default null\n */\n\n // We leave this null by default so we can tell the difference between\n // the default case and a user-specified tag.\n tagName: null,\n\n /**\n The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.\n\n The full list of valid WAI-ARIA roles is available at:\n [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization)\n\n @property ariaRole\n @type String\n @default null\n */\n ariaRole: null,\n\n /**\n Standard CSS class names to apply to the view's outer element. This\n property automatically inherits any class names defined by the view's\n superclasses as well.\n\n @property classNames\n @type Array\n @default ['ember-view']\n */\n classNames: ['ember-view'],\n\n /**\n A list of properties of the view to apply as class names. If the property\n is a string value, the value of that string will be applied as a class\n name.\n\n ```javascript\n // Applies the 'high' class to the view element\n Ember.View.extend({\n classNameBindings: ['priority']\n priority: 'high'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as a dasherized class name.\n\n ```javascript\n // Applies the 'is-urgent' class to the view element\n Ember.View.extend({\n classNameBindings: ['isUrgent']\n isUrgent: true\n });\n ```\n\n If you would prefer to use a custom value instead of the dasherized\n property name, you can pass a binding like this:\n\n ```javascript\n // Applies the 'urgent' class to the view element\n Ember.View.extend({\n classNameBindings: ['isUrgent:urgent']\n isUrgent: true\n });\n ```\n\n This list of properties is inherited from the view's superclasses as well.\n\n @property classNameBindings\n @type Array\n @default []\n */\n classNameBindings: EMPTY_ARRAY,\n\n /**\n A list of properties of the view to apply as attributes. If the property is\n a string value, the value of that string will be applied as the attribute.\n\n ```javascript\n // Applies the type attribute to the element\n // with the value \"button\", like <div type=\"button\">\n Ember.View.extend({\n attributeBindings: ['type'],\n type: 'button'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as an attribute.\n\n ```javascript\n // Renders something like <div enabled=\"enabled\">\n Ember.View.extend({\n attributeBindings: ['enabled'],\n enabled: true\n });\n ```\n\n @property attributeBindings\n */\n attributeBindings: EMPTY_ARRAY,\n\n // .......................................................\n // CORE DISPLAY METHODS\n //\n\n /**\n Setup a view, but do not finish waking it up.\n\n * configure `childViews`\n * register the view with the global views hash, which is used for event\n dispatch\n\n @method init\n @private\n */\n init: function() {\n this.elementId = this.elementId || guidFor(this);\n\n this._super();\n\n // setup child views. be sure to clone the child views array first\n this._childViews = this._childViews.slice();\n\n Ember.assert(\"Only arrays are allowed for 'classNameBindings'\", typeOf(this.classNameBindings) === 'array');\n this.classNameBindings = A(this.classNameBindings.slice());\n\n Ember.assert(\"Only arrays are allowed for 'classNames'\", typeOf(this.classNames) === 'array');\n this.classNames = A(this.classNames.slice());\n },\n\n appendChild: function(view, options) {\n return this.currentState.appendChild(this, view, options);\n },\n\n /**\n Removes the child view from the parent view.\n\n @method removeChild\n @param {Ember.View} view\n @return {Ember.View} receiver\n */\n removeChild: function(view) {\n // If we're destroying, the entire subtree will be\n // freed, and the DOM will be handled separately,\n // so no need to mess with childViews.\n if (this.isDestroying) { return; }\n\n // update parent node\n set(view, '_parentView', null);\n\n // remove view from childViews array.\n var childViews = this._childViews;\n\n a_removeObject(childViews, view);\n\n this.propertyDidChange('childViews'); // HUH?! what happened to will change?\n\n return this;\n },\n\n /**\n Removes all children from the `parentView`.\n\n @method removeAllChildren\n @return {Ember.View} receiver\n */\n removeAllChildren: function() {\n return this.mutateChildViews(function(parentView, view) {\n parentView.removeChild(view);\n });\n },\n\n destroyAllChildren: function() {\n return this.mutateChildViews(function(parentView, view) {\n view.destroy();\n });\n },\n\n /**\n Removes the view from its `parentView`, if one is found. Otherwise\n does nothing.\n\n @method removeFromParent\n @return {Ember.View} receiver\n */\n removeFromParent: function() {\n var parent = this._parentView;\n\n // Remove DOM element from parent\n this.remove();\n\n if (parent) { parent.removeChild(this); }\n return this;\n },\n\n /**\n You must call `destroy` on a view to destroy the view (and all of its\n child views). This will remove the view from any parent node, then make\n sure that the DOM element managed by the view can be released by the\n memory manager.\n\n @method destroy\n */\n destroy: function() {\n var childViews = this._childViews,\n // get parentView before calling super because it'll be destroyed\n nonVirtualParentView = get(this, 'parentView'),\n viewName = this.viewName,\n childLen, i;\n\n if (!this._super()) { return; }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].removedFromDOM = true;\n }\n\n // remove from non-virtual parent view if viewName was specified\n if (viewName && nonVirtualParentView) {\n nonVirtualParentView.set(viewName, null);\n }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].destroy();\n }\n\n return this;\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n @method createChildView\n @param {Class|String} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n if (!view) {\n throw new TypeError(\"createChildViews first argument must exist\");\n }\n\n if (view.isView && view._parentView === this && view.container === this.container) {\n return view;\n }\n\n attrs = attrs || {};\n attrs._parentView = this;\n\n if (CoreView.detect(view)) {\n attrs.templateData = attrs.templateData || get(this, 'templateData');\n\n attrs.container = this.container;\n view = view.create(attrs);\n\n // don't set the property on a virtual view, as they are invisible to\n // consumers of the view API\n if (view.viewName) {\n set(get(this, 'concreteView'), view.viewName, view);\n }\n } else if ('string' === typeof view) {\n var fullName = 'view:' + view;\n var ViewKlass = this.container.lookupFactory(fullName);\n\n Ember.assert(\"Could not find view: '\" + fullName + \"'\", !!ViewKlass);\n\n attrs.templateData = get(this, 'templateData');\n view = ViewKlass.create(attrs);\n } else {\n Ember.assert('You must pass instance or subclass of View', view.isView);\n attrs.container = this.container;\n\n if (!get(view, 'templateData')) {\n attrs.templateData = get(this, 'templateData');\n }\n\n setProperties(view, attrs);\n\n }\n\n return view;\n },\n\n becameVisible: Ember.K,\n becameHidden: Ember.K,\n\n /**\n When the view's `isVisible` property changes, toggle the visibility\n element of the actual DOM element.\n\n @method _isVisibleDidChange\n @private\n */\n _isVisibleDidChange: observer('isVisible', function() {\n if (this._isVisible === get(this, 'isVisible')) { return ; }\n run.scheduleOnce('render', this, this._toggleVisibility);\n }),\n\n _toggleVisibility: function() {\n var $el = this.$();\n if (!$el) { return; }\n\n var isVisible = get(this, 'isVisible');\n\n if (this._isVisible === isVisible) { return ; }\n\n $el.toggle(isVisible);\n\n this._isVisible = isVisible;\n\n if (this._isAncestorHidden()) { return; }\n\n if (isVisible) {\n this._notifyBecameVisible();\n } else {\n this._notifyBecameHidden();\n }\n },\n\n _notifyBecameVisible: function() {\n this.trigger('becameVisible');\n\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameVisible();\n }\n });\n },\n\n _notifyBecameHidden: function() {\n this.trigger('becameHidden');\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameHidden();\n }\n });\n },\n\n _isAncestorHidden: function() {\n var parent = get(this, 'parentView');\n\n while (parent) {\n if (get(parent, 'isVisible') === false) { return true; }\n\n parent = get(parent, 'parentView');\n }\n\n return false;\n },\n\n clearBuffer: function() {\n this.invokeRecursively(nullViewsBuffer);\n },\n\n transitionTo: function(state, children) {\n var priorState = this.currentState,\n currentState = this.currentState = this.states[state];\n this.state = state;\n\n if (priorState && priorState.exit) { priorState.exit(this); }\n if (currentState.enter) { currentState.enter(this); }\n if (state === 'inDOM') { meta(this).cache.element = undefined; }\n\n if (children !== false) {\n this.forEachChildView(function(view) {\n view.transitionTo(state);\n });\n }\n },\n\n // .......................................................\n // EVENT HANDLING\n //\n\n /**\n Handle events from `Ember.EventDispatcher`\n\n @method handleEvent\n @param eventName {String}\n @param evt {Event}\n @private\n */\n handleEvent: function(eventName, evt) {\n return this.currentState.handleEvent(this, eventName, evt);\n },\n\n registerObserver: function(root, path, target, observer) {\n if (!observer && 'function' === typeof target) {\n observer = target;\n target = null;\n }\n\n if (!root || typeof root !== 'object') {\n return;\n }\n\n var view = this,\n stateCheckedObserver = function() {\n view.currentState.invokeObserver(this, observer);\n },\n scheduledObserver = function() {\n run.scheduleOnce('render', this, stateCheckedObserver);\n };\n\n addObserver(root, path, target, scheduledObserver);\n\n this.one('willClearRender', function() {\n removeObserver(root, path, target, scheduledObserver);\n });\n }\n\n });\n\n /*\n Describe how the specified actions should behave in the various\n states that a view can exist in. Possible states:\n\n * preRender: when a view is first instantiated, and after its\n element was destroyed, it is in the preRender state\n * inBuffer: once a view has been rendered, but before it has\n been inserted into the DOM, it is in the inBuffer state\n * hasElement: the DOM representation of the view is created,\n and is ready to be inserted\n * inDOM: once a view has been inserted into the DOM it is in\n the inDOM state. A view spends the vast majority of its\n existence in this state.\n * destroyed: once a view has been destroyed (using the destroy\n method), it is in this state. No further actions can be invoked\n on a destroyed view.\n */\n\n // in the destroyed state, everything is illegal\n\n // before rendering has begun, all legal manipulations are noops.\n\n // inside the buffer, legal manipulations are done on the buffer\n\n // once the view has been inserted into the DOM, legal manipulations\n // are done on the DOM element.\n\n function notifyMutationListeners() {\n run.once(View, 'notifyMutationListeners');\n }\n\n var DOMManager = {\n prepend: function(view, html) {\n view.$().prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.$().after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.$().html(html);\n notifyMutationListeners();\n },\n\n replace: function(view) {\n var element = get(view, 'element');\n\n set(view, 'element', null);\n\n view._insertElementLater(function() {\n jQuery(element).replaceWith(get(view, 'element'));\n notifyMutationListeners();\n });\n },\n\n remove: function(view) {\n view.$().remove();\n notifyMutationListeners();\n },\n\n empty: function(view) {\n view.$().empty();\n notifyMutationListeners();\n }\n };\n\n View.reopen({\n domManager: DOMManager\n });\n\n View.reopenClass({\n\n /**\n Parse a path and return an object which holds the parsed properties.\n\n For example a path like \"content.isEnabled:enabled:disabled\" will return the\n following object:\n\n ```javascript\n {\n path: \"content.isEnabled\",\n className: \"enabled\",\n falsyClassName: \"disabled\",\n classNames: \":enabled:disabled\"\n }\n ```\n\n @method _parsePropertyPath\n @static\n @private\n */\n _parsePropertyPath: function(path) {\n var split = path.split(':'),\n propertyPath = split[0],\n classNames = \"\",\n className,\n falsyClassName;\n\n // check if the property is defined as prop:class or prop:trueClass:falseClass\n if (split.length > 1) {\n className = split[1];\n if (split.length === 3) { falsyClassName = split[2]; }\n\n classNames = ':' + className;\n if (falsyClassName) { classNames += \":\" + falsyClassName; }\n }\n\n return {\n path: propertyPath,\n classNames: classNames,\n className: (className === '') ? undefined : className,\n falsyClassName: falsyClassName\n };\n },\n\n /**\n Get the class name for a given value, based on the path, optional\n `className` and optional `falsyClassName`.\n\n - if a `className` or `falsyClassName` has been specified:\n - if the value is truthy and `className` has been specified,\n `className` is returned\n - if the value is falsy and `falsyClassName` has been specified,\n `falsyClassName` is returned\n - otherwise `null` is returned\n - if the value is `true`, the dasherized last part of the supplied path\n is returned\n - if the value is not `false`, `undefined` or `null`, the `value`\n is returned\n - if none of the above rules apply, `null` is returned\n\n @method _classStringForValue\n @param path\n @param val\n @param className\n @param falsyClassName\n @static\n @private\n */\n _classStringForValue: function(path, val, className, falsyClassName) {\n if(isArray(val)) {\n val = get(val, 'length') !== 0; \n }\n \n // When using the colon syntax, evaluate the truthiness or falsiness\n // of the value to determine which className to return\n if (className || falsyClassName) {\n if (className && !!val) {\n return className;\n\n } else if (falsyClassName && !val) {\n return falsyClassName;\n\n } else {\n return null;\n }\n\n // If value is a Boolean and true, return the dasherized property\n // name.\n } else if (val === true) {\n // Normalize property path to be suitable for use\n // as a class name. For exaple, content.foo.barBaz\n // becomes bar-baz.\n var parts = path.split('.');\n return dasherize(parts[parts.length-1]);\n\n // If the value is not false, undefined, or null, return the current\n // value of the property.\n } else if (val !== false && val != null) {\n return val;\n\n // Nothing to display. Return null so that the old class is removed\n // but no new class is added.\n } else {\n return null;\n }\n }\n });\n\n var mutation = EmberObject.extend(Evented).create();\n\n View.addMutationListener = function(callback) {\n mutation.on('change', callback);\n };\n\n View.removeMutationListener = function(callback) {\n mutation.off('change', callback);\n };\n\n View.notifyMutationListeners = function() {\n mutation.trigger('change');\n };\n\n /**\n Global views hash\n\n @property views\n @static\n @type Hash\n */\n View.views = {};\n\n // If someone overrides the child views computed property when\n // defining their class, we want to be able to process the user's\n // supplied childViews and then restore the original computed property\n // at view initialization time. This happens in Ember.ContainerView's init\n // method.\n View.childViewsProperty = childViewsProperty;\n\n View.applyAttributeBindings = function(elem, name, value) {\n var type = typeOf(value);\n\n // if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js\n if (name !== 'value' && (type === 'string' || (type === 'number' && !isNaN(value)))) {\n if (value !== elem.attr(name)) {\n elem.attr(name, value);\n }\n } else if (name === 'value' || type === 'boolean') {\n if (isNone(value) || value === false) {\n // `null`, `undefined` or `false` should remove attribute\n elem.removeAttr(name);\n elem.prop(name, '');\n } else if (value !== elem.prop(name)) {\n // value should always be properties\n elem.prop(name, value);\n }\n } else if (!value) {\n elem.removeAttr(name);\n }\n };\n\n __exports__.CoreView = CoreView;\n __exports__.View = View;\n __exports__.ViewCollection = ViewCollection;\n });\n})();\n//@ sourceURL=ember-views");minispade.register('ember', "(function() {// ensure that minispade loads the following modules first\nminispade.require('ember-metal');\nminispade.require('ember-runtime');\nminispade.require('ember-handlebars-compiler');\nminispade.require('ember-handlebars');\nminispade.require('ember-views');\nminispade.require('ember-routing');\nminispade.require('ember-application');\nminispade.require('ember-extension-support');\n\n\n// ensure that the global exports have occurred for above\n// required packages\nrequireModule('ember-metal');\nrequireModule('ember-runtime');\nrequireModule('ember-handlebars');\nrequireModule('ember-views');\nrequireModule('ember-routing');\nrequireModule('ember-application');\nrequireModule('ember-extension-support');\n\n// do this to ensure that Ember.Test is defined properly on the global\n// if it is present.\nif (Ember.__loader.registry['ember-testing']) {\n requireModule('ember-testing');\n}\n\n/**\nEmber\n\n@module ember\n*/\n\nfunction throwWithMessage(msg) {\n return function() {\n throw new Ember.Error(msg);\n };\n}\n\nfunction generateRemovedClass(className) {\n var msg = \" has been moved into a plugin: https://github.com/emberjs/ember-states\";\n\n return {\n extend: throwWithMessage(className + msg),\n create: throwWithMessage(className + msg)\n };\n}\n\nEmber.StateManager = generateRemovedClass(\"Ember.StateManager\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n\n @class StateManager\n @namespace Ember\n*/\n\nEmber.State = generateRemovedClass(\"Ember.State\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n\n @class State\n @namespace Ember\n*/\n\n})();\n//@ sourceURL=ember");minispade.register('loader', "(function() {var define, requireModule, require, requirejs, Ember;\n\n(function() {\n Ember = this.Ember = this.Ember || {};\n if (typeof Ember === 'undefined') { Ember = {} };\n\n if (typeof Ember.__loader === 'undefined') {\n var registry = {}, seen = {};\n\n define = function(name, deps, callback) {\n registry[name] = { deps: deps, callback: callback };\n };\n\n requirejs = require = requireModule = function(name) {\n if (seen.hasOwnProperty(name)) { return seen[name]; }\n seen[name] = {};\n\n if (!registry[name]) {\n throw new Error(\"Could not find module \" + name);\n }\n\n var mod = registry[name],\n deps = mod.deps,\n callback = mod.callback,\n reified = [],\n exports;\n\n for (var i=0, l=deps.length; i<l; i++) {\n if (deps[i] === 'exports') {\n reified.push(exports = {});\n } else {\n reified.push(requireModule(resolve(deps[i])));\n }\n }\n\n var value = callback.apply(this, reified);\n return seen[name] = exports || value;\n\n function resolve(child) {\n if (child.charAt(0) !== '.') { return child; }\n var parts = child.split(\"/\");\n var parentBase = name.split(\"/\").slice(0, -1);\n\n for (var i=0, l=parts.length; i<l; i++) {\n var part = parts[i];\n\n if (part === '..') { parentBase.pop(); }\n else if (part === '.') { continue; }\n else { parentBase.push(part); }\n }\n\n return parentBase.join(\"/\");\n }\n };\n requirejs._eak_seen = registry;\n\n Ember.__loader = {define: define, require: require, registry: registry};\n } else {\n define = Ember.__loader.define;\n requirejs = require = requireModule = Ember.__loader.require;\n }\n})();\n\n})();\n//@ sourceURL=loader");minispade.register('metamorph', "(function() {define(\"metamorph\",\n [],\n function() {\n \"use strict\";\n // ==========================================================================\n // Project: metamorph\n // Copyright: ©2014 Tilde, Inc. All rights reserved.\n // ==========================================================================\n\n var K = function() {},\n guid = 0,\n disableRange = (function(){\n if ('undefined' !== typeof MetamorphENV) {\n return MetamorphENV.DISABLE_RANGE_API;\n } else if ('undefined' !== ENV) {\n return ENV.DISABLE_RANGE_API;\n } else {\n return false;\n }\n })(),\n\n // Feature-detect the W3C range API, the extended check is for IE9 which only partially supports ranges\n supportsRange = (!disableRange) && typeof document !== 'undefined' && ('createRange' in document) && (typeof Range !== 'undefined') && Range.prototype.createContextualFragment,\n\n // Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n // is a \"zero-scope\" element. This problem can be worked around by making\n // the first node an invisible text node. We, like Modernizr, use ­\n needsShy = typeof document !== 'undefined' && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n })(),\n\n\n // IE 8 (and likely earlier) likes to move whitespace preceeding\n // a script tag to appear after it. This means that we can\n // accidentally remove whitespace when updating a morph.\n movesWhitespace = document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n })();\n\n // Constructor that supports either Metamorph('foo') or new\n // Metamorph('foo');\n //\n // Takes a string of HTML as the argument.\n\n var Metamorph = function(html) {\n var self;\n\n if (this instanceof Metamorph) {\n self = this;\n } else {\n self = new K();\n }\n\n self.innerHTML = html;\n var myGuid = 'metamorph-'+(guid++);\n self.start = myGuid + '-start';\n self.end = myGuid + '-end';\n\n return self;\n };\n\n K.prototype = Metamorph.prototype;\n\n var rangeFor, htmlFunc, removeFunc, outerHTMLFunc, appendToFunc, afterFunc, prependFunc, startTagFunc, endTagFunc;\n\n outerHTMLFunc = function() {\n return this.startTag() + this.innerHTML + this.endTag();\n };\n\n startTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.start + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n endTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.end + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n // If we have the W3C range API, this process is relatively straight forward.\n if (supportsRange) {\n\n // Get a range for the current morph. Optionally include the starting and\n // ending placeholders.\n rangeFor = function(morph, outerToo) {\n var range = document.createRange();\n var before = document.getElementById(morph.start);\n var after = document.getElementById(morph.end);\n\n if (outerToo) {\n range.setStartBefore(before);\n range.setEndAfter(after);\n } else {\n range.setStartAfter(before);\n range.setEndBefore(after);\n }\n\n return range;\n };\n\n htmlFunc = function(html, outerToo) {\n // get a range for the current metamorph object\n var range = rangeFor(this, outerToo);\n\n // delete the contents of the range, which will be the\n // nodes between the starting and ending placeholder.\n range.deleteContents();\n\n // create a new document fragment for the HTML\n var fragment = range.createContextualFragment(html);\n\n // insert the fragment into the range\n range.insertNode(fragment);\n };\n\n /**\n * @public\n *\n * Remove this object (including starting and ending\n * placeholders).\n *\n * @method remove\n */\n removeFunc = function() {\n // get a range for the current metamorph object including\n // the starting and ending placeholders.\n var range = rangeFor(this, true);\n\n // delete the entire range.\n range.deleteContents();\n };\n\n appendToFunc = function(node) {\n var range = document.createRange();\n range.setStart(node);\n range.collapse(false);\n var frag = range.createContextualFragment(this.outerHTML());\n node.appendChild(frag);\n };\n\n afterFunc = function(html) {\n var range = document.createRange();\n var after = document.getElementById(this.end);\n\n range.setStartAfter(after);\n range.setEndAfter(after);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n prependFunc = function(html) {\n var range = document.createRange();\n var start = document.getElementById(this.start);\n\n range.setStartAfter(start);\n range.setEndAfter(start);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n } else {\n /*\n * This code is mostly taken from jQuery, with one exception. In jQuery's case, we\n * have some HTML and we need to figure out how to convert it into some nodes.\n *\n * In this case, jQuery needs to scan the HTML looking for an opening tag and use\n * that as the key for the wrap map. In our case, we know the parent node, and\n * can use its type as the key for the wrap map.\n **/\n var wrapMap = {\n select: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n fieldset: [ 1, \"<fieldset>\", \"</fieldset>\" ],\n table: [ 1, \"<table>\", \"</table>\" ],\n tbody: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n tr: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n colgroup: [ 2, \"<table><tbody></tbody><colgroup>\", \"</colgroup></table>\" ],\n map: [ 1, \"<map>\", \"</map>\" ],\n _default: [ 0, \"\", \"\" ]\n };\n\n var findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n };\n\n var setInnerHTML = function(element, html) {\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n };\n\n /*\n * Given a parent node and some HTML, generate a set of nodes. Return the first\n * node, which will allow us to traverse the rest using nextSibling.\n *\n * We need to do this because innerHTML in IE does not really parse the nodes.\n */\n var firstNodeFor = function(parentNode, html) {\n var arr = wrapMap[parentNode.tagName.toLowerCase()] || wrapMap._default;\n var depth = arr[0], start = arr[1], end = arr[2];\n\n if (needsShy) { html = '­'+html; }\n\n var element = document.createElement('div');\n\n setInnerHTML(element, start + html + end);\n\n for (var i=0; i<=depth; i++) {\n element = element.firstChild;\n }\n\n // Look for ­ to remove it.\n if (needsShy) {\n var shyElement = element;\n\n // Sometimes we get nameless elements with the shy inside\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n\n // At this point it's the actual unicode character.\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n\n return element;\n };\n\n /*\n * In some cases, Internet Explorer can create an anonymous node in\n * the hierarchy with no tagName. You can create this scenario via:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table>­<script></script><tr><td>hi</td></tr></table>\";\n * div.firstChild.firstChild.tagName //=> \"\"\n *\n * If our script markers are inside such a node, we need to find that\n * node and use *it* as the marker.\n */\n var realNode = function(start) {\n while (start.parentNode.tagName === \"\") {\n start = start.parentNode;\n }\n\n return start;\n };\n\n /*\n * When automatically adding a tbody, Internet Explorer inserts the\n * tbody immediately before the first <tr>. Other browsers create it\n * before the first node, no matter what.\n *\n * This means the the following code:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table><script id='first'></script><tr><td>hi</td></tr><script id='last'></script></table>\n *\n * Generates the following DOM in IE:\n *\n * + div\n * + table\n * - script id='first'\n * + tbody\n * + tr\n * + td\n * - \"hi\"\n * - script id='last'\n *\n * Which means that the two script tags, even though they were\n * inserted at the same point in the hierarchy in the original\n * HTML, now have different parents.\n *\n * This code reparents the first script tag by making it the tbody's\n * first child.\n *\n */\n var fixParentage = function(start, end) {\n if (start.parentNode !== end.parentNode) {\n end.parentNode.insertBefore(start, end.parentNode.firstChild);\n }\n };\n\n htmlFunc = function(html, outerToo) {\n // get the real starting node. see realNode for details.\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n var parentNode = end.parentNode;\n var node, nextSibling, last;\n\n // make sure that the start and end nodes share the same\n // parent. If not, fix it.\n fixParentage(start, end);\n\n // remove all of the nodes after the starting placeholder and\n // before the ending placeholder.\n node = start.nextSibling;\n while (node) {\n nextSibling = node.nextSibling;\n last = node === end;\n\n // if this is the last node, and we want to remove it as well,\n // set the `end` node to the next sibling. This is because\n // for the rest of the function, we insert the new nodes\n // before the end (note that insertBefore(node, null) is\n // the same as appendChild(node)).\n //\n // if we do not want to remove it, just break.\n if (last) {\n if (outerToo) { end = node.nextSibling; } else { break; }\n }\n\n node.parentNode.removeChild(node);\n\n // if this is the last node and we didn't break before\n // (because we wanted to remove the outer nodes), break\n // now.\n if (last) { break; }\n\n node = nextSibling;\n }\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(start.parentNode, html);\n\n if (outerToo) {\n start.parentNode.removeChild(start);\n }\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, end);\n node = nextSibling;\n }\n };\n\n // remove the nodes in the DOM representing this metamorph.\n //\n // this includes the starting and ending placeholders.\n removeFunc = function() {\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n\n this.html('');\n start.parentNode.removeChild(start);\n end.parentNode.removeChild(end);\n };\n\n appendToFunc = function(parentNode) {\n var node = firstNodeFor(parentNode, this.outerHTML());\n var nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.appendChild(node);\n node = nextSibling;\n }\n };\n\n afterFunc = function(html) {\n // get the real starting node. see realNode for details.\n var end = document.getElementById(this.end);\n var insertBefore = end.nextSibling;\n var parentNode = end.parentNode;\n var nextSibling;\n var node;\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n\n prependFunc = function(html) {\n var start = document.getElementById(this.start);\n var parentNode = start.parentNode;\n var nextSibling;\n var node;\n\n node = firstNodeFor(parentNode, html);\n var insertBefore = start.nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n }\n\n Metamorph.prototype.html = function(html) {\n this.checkRemoved();\n if (html === undefined) { return this.innerHTML; }\n\n htmlFunc.call(this, html);\n\n this.innerHTML = html;\n };\n\n Metamorph.prototype.replaceWith = function(html) {\n this.checkRemoved();\n htmlFunc.call(this, html, true);\n };\n\n Metamorph.prototype.remove = removeFunc;\n Metamorph.prototype.outerHTML = outerHTMLFunc;\n Metamorph.prototype.appendTo = appendToFunc;\n Metamorph.prototype.after = afterFunc;\n Metamorph.prototype.prepend = prependFunc;\n Metamorph.prototype.startTag = startTagFunc;\n Metamorph.prototype.endTag = endTagFunc;\n\n Metamorph.prototype.isRemoved = function() {\n var before = document.getElementById(this.start);\n var after = document.getElementById(this.end);\n\n return !before || !after;\n };\n\n Metamorph.prototype.checkRemoved = function() {\n if (this.isRemoved()) {\n throw new Error(\"Cannot perform operations on a Metamorph that is not in the DOM.\");\n }\n };\n\n return Metamorph;\n });\n\n})();\n//@ sourceURL=metamorph");minispade.register('rsvp', "(function() {/**\n @class RSVP\n @module RSVP\n */\ndefine(\"rsvp/all\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n This is a convenient alias for `RSVP.Promise.all`.\n\n @method all\n @for RSVP\n @param {Array} array Array of promises.\n @param {String} label An optional label. This is useful\n for tooling.\n @static\n */\n __exports__[\"default\"] = function all(array, label) {\n return Promise.all(array, label);\n };\n });\ndefine(\"rsvp/all_settled\",\n [\"./promise\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var isArray = __dependency2__.isArray;\n var isNonThenable = __dependency2__.isNonThenable;\n\n /**\n `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing\n a fail-fast method, it waits until all the promises have returned and\n shows you all the results. This is useful if you want to handle multiple\n promises' failure states together as a set.\n\n Returns a promise that is fulfilled when all the given promises have been\n settled. The return promise is fulfilled with an array of the states of\n the promises passed into the `promises` array argument.\n\n Each state object will either indicate fulfillment or rejection, and\n provide the corresponding value or reason. The states will take one of\n the following formats:\n\n ```javascript\n { state: 'fulfilled', value: value }\n or\n { state: 'rejected', reason: reason }\n ```\n\n Example:\n\n ```javascript\n var promise1 = RSVP.Promise.resolve(1);\n var promise2 = RSVP.Promise.reject(new Error('2'));\n var promise3 = RSVP.Promise.reject(new Error('3'));\n var promises = [ promise1, promise2, promise3 ];\n\n RSVP.allSettled(promises).then(function(array){\n // array == [\n // { state: 'fulfilled', value: 1 },\n // { state: 'rejected', reason: Error },\n // { state: 'rejected', reason: Error }\n // ]\n // Note that for the second item, reason.message will be \"2\", and for the\n // third item, reason.message will be \"3\".\n }, function(error) {\n // Not run. (This block would only be called if allSettled had failed,\n // for instance if passed an incorrect argument type.)\n });\n ```\n\n @method allSettled\n @for RSVP\n @param {Array} promises\n @param {String} label - optional string that describes the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled with an array of the settled\n states of the constituent promises.\n @static\n */\n\n __exports__[\"default\"] = function allSettled(entries, label) {\n return new Promise(function(resolve, reject) {\n if (!isArray(entries)) {\n throw new TypeError('You must pass an array to allSettled.');\n }\n\n var remaining = entries.length;\n var entry;\n\n if (remaining === 0) {\n resolve([]);\n return;\n }\n\n var results = new Array(remaining);\n\n function fulfilledResolver(index) {\n return function(value) {\n resolveAll(index, fulfilled(value));\n };\n }\n\n function rejectedResolver(index) {\n return function(reason) {\n resolveAll(index, rejected(reason));\n };\n }\n\n function resolveAll(index, value) {\n results[index] = value;\n if (--remaining === 0) {\n resolve(results);\n }\n }\n\n for (var index = 0; index < entries.length; index++) {\n entry = entries[index];\n\n if (isNonThenable(entry)) {\n resolveAll(index, fulfilled(entry));\n } else {\n Promise.cast(entry).then(fulfilledResolver(index), rejectedResolver(index));\n }\n }\n }, label);\n };\n\n function fulfilled(value) {\n return { state: 'fulfilled', value: value };\n }\n\n function rejected(reason) {\n return { state: 'rejected', reason: reason };\n }\n });\ndefine(\"rsvp/config\",\n [\"./events\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var EventTarget = __dependency1__[\"default\"];\n\n var config = {\n instrument: false\n };\n\n EventTarget.mixin(config);\n\n function configure(name, value) {\n if (name === 'onerror') {\n // handle for legacy users that expect the actual\n // error to be passed to their function added via\n // `RSVP.configure('onerror', someFunctionHere);`\n config.on('error', value);\n return;\n }\n\n if (arguments.length === 2) {\n config[name] = value;\n } else {\n return config[name];\n }\n }\n\n __exports__.config = config;\n __exports__.configure = configure;\n });\ndefine(\"rsvp/defer\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n `RSVP.defer` returns an object similar to jQuery's `$.Deferred`.\n `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s\n interface. New code should use the `RSVP.Promise` constructor instead.\n\n The object returned from `RSVP.defer` is a plain object with three properties:\n\n * promise - an `RSVP.Promise`.\n * reject - a function that causes the `promise` property on this object to\n become rejected\n * resolve - a function that causes the `promise` property on this object to\n become fulfilled.\n\n Example:\n\n ```javascript\n var deferred = RSVP.defer();\n\n deferred.resolve(\"Success!\");\n\n deferred.promise.then(function(value){\n // value here is \"Success!\"\n });\n ```\n\n @method defer\n @for RSVP\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Object}\n */\n\n __exports__[\"default\"] = function defer(label) {\n var deferred = { };\n\n deferred.promise = new Promise(function(resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n }, label);\n\n return deferred;\n };\n });\ndefine(\"rsvp/events\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var indexOf = function(callbacks, callback) {\n for (var i=0, l=callbacks.length; i<l; i++) {\n if (callbacks[i] === callback) { return i; }\n }\n\n return -1;\n };\n\n var callbacksFor = function(object) {\n var callbacks = object._promiseCallbacks;\n\n if (!callbacks) {\n callbacks = object._promiseCallbacks = {};\n }\n\n return callbacks;\n };\n\n /**\n @class RSVP.EventTarget\n */\n __exports__[\"default\"] = {\n\n /**\n `RSVP.EventTarget.mixin` extends an object with EventTarget methods. For\n Example:\n\n ```javascript\n var object = {};\n\n RSVP.EventTarget.mixin(object);\n\n object.on(\"finished\", function(event) {\n // handle event\n });\n\n object.trigger(\"finished\", { detail: value });\n ```\n\n `EventTarget.mixin` also works with prototypes:\n\n ```javascript\n var Person = function() {};\n RSVP.EventTarget.mixin(Person.prototype);\n\n var yehuda = new Person();\n var tom = new Person();\n\n yehuda.on(\"poke\", function(event) {\n console.log(\"Yehuda says OW\");\n });\n\n tom.on(\"poke\", function(event) {\n console.log(\"Tom says OW\");\n });\n\n yehuda.trigger(\"poke\");\n tom.trigger(\"poke\");\n ```\n\n @method mixin\n @param {Object} object object to extend with EventTarget methods\n @private\n */\n mixin: function(object) {\n object.on = this.on;\n object.off = this.off;\n object.trigger = this.trigger;\n object._promiseCallbacks = undefined;\n return object;\n },\n\n /**\n Registers a callback to be executed when `eventName` is triggered\n\n ```javascript\n object.on('event', function(eventInfo){\n // handle the event\n });\n\n object.trigger('event');\n ```\n\n @method on\n @param {String} eventName name of the event to listen for\n @param {Function} callback function to be called when the event is triggered.\n @private\n */\n on: function(eventName, callback) {\n var allCallbacks = callbacksFor(this), callbacks;\n\n callbacks = allCallbacks[eventName];\n\n if (!callbacks) {\n callbacks = allCallbacks[eventName] = [];\n }\n\n if (indexOf(callbacks, callback) === -1) {\n callbacks.push(callback);\n }\n },\n\n /**\n You can use `off` to stop firing a particular callback for an event:\n\n ```javascript\n function doStuff() { // do stuff! }\n object.on('stuff', doStuff);\n\n object.trigger('stuff'); // doStuff will be called\n\n // Unregister ONLY the doStuff callback\n object.off('stuff', doStuff);\n object.trigger('stuff'); // doStuff will NOT be called\n ```\n\n If you don't pass a `callback` argument to `off`, ALL callbacks for the\n event will not be executed when the event fires. For example:\n\n ```javascript\n var callback1 = function(){};\n var callback2 = function(){};\n\n object.on('stuff', callback1);\n object.on('stuff', callback2);\n\n object.trigger('stuff'); // callback1 and callback2 will be executed.\n\n object.off('stuff');\n object.trigger('stuff'); // callback1 and callback2 will not be executed!\n ```\n\n @method off\n @param {String} eventName event to stop listening to\n @param {Function} callback optional argument. If given, only the function\n given will be removed from the event's callback queue. If no `callback`\n argument is given, all callbacks will be removed from the event's callback\n queue.\n @private\n\n */\n off: function(eventName, callback) {\n var allCallbacks = callbacksFor(this), callbacks, index;\n\n if (!callback) {\n allCallbacks[eventName] = [];\n return;\n }\n\n callbacks = allCallbacks[eventName];\n\n index = indexOf(callbacks, callback);\n\n if (index !== -1) { callbacks.splice(index, 1); }\n },\n\n /**\n Use `trigger` to fire custom events. For example:\n\n ```javascript\n object.on('foo', function(){\n console.log('foo event happened!');\n });\n object.trigger('foo');\n // 'foo event happened!' logged to the console\n ```\n\n You can also pass a value as a second argument to `trigger` that will be\n passed as an argument to all event listeners for the event:\n\n ```javascript\n object.on('foo', function(value){\n console.log(value.name);\n });\n\n object.trigger('foo', { name: 'bar' });\n // 'bar' logged to the console\n ```\n\n @method trigger\n @param {String} eventName name of the event to be triggered\n @param {Any} options optional value to be passed to any event handlers for\n the given `eventName`\n @private\n */\n trigger: function(eventName, options) {\n var allCallbacks = callbacksFor(this),\n callbacks, callbackTuple, callback, binding;\n\n if (callbacks = allCallbacks[eventName]) {\n // Don't cache the callbacks.length since it may grow\n for (var i=0; i<callbacks.length; i++) {\n callback = callbacks[i];\n\n callback(options);\n }\n }\n }\n };\n });\ndefine(\"rsvp/filter\",\n [\"./all\",\"./map\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var all = __dependency1__[\"default\"];\n var map = __dependency2__[\"default\"];\n var isFunction = __dependency3__.isFunction;\n var isArray = __dependency3__.isArray;\n\n /**\n `RSVP.filter` is similar to JavaScript's native `filter` method, except that it\n waits for all promises to become fulfilled before running the `filterFn` on\n each item in given to `promises`. `RSVP.filter` returns a promise that will\n become fulfilled with the result of running `filterFn` on the values the\n promises become fulfilled with.\n\n For example:\n\n ```javascript\n\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.resolve(2);\n var promise3 = RSVP.resolve(3);\n\n var filterFn = function(item){\n return item > 1;\n };\n\n RSVP.filter(promises, filterFn).then(function(result){\n // result is [ 2, 3 ]\n });\n ```\n\n If any of the `promises` given to `RSVP.filter` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.reject(new Error(\"2\"));\n var promise3 = RSVP.reject(new Error(\"3\"));\n var promises = [ promise1, promise2, promise3 ];\n\n var filterFn = function(item){\n return item > 1;\n };\n\n RSVP.filter(promises, filterFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === \"2\"\n });\n ```\n\n `RSVP.filter` will also wait for any promises returned from `filterFn`.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:\n\n ```javascript\n\n var alice = { name: 'alice' };\n var bob = { name: 'bob' };\n var users = [ alice, bob ];\n\n var promises = users.map(function(user){\n return RSVP.resolve(user);\n });\n\n var filterFn = function(user){\n // Here, Alice has permissions to create a blog post, but Bob does not.\n return getPrivilegesForUser(user).then(function(privs){\n return privs.can_create_blog_post === true;\n });\n };\n RSVP.filter(promises, filterFn).then(function(users){\n // true, because the server told us only Alice can create a blog post.\n users.length === 1;\n // false, because Alice is the only user present in `users`\n users[0] === bob;\n });\n ```\n\n @method filter\n @for RSVP\n @param {Array} promises\n @param {Function} filterFn - function to be called on each resolved value to\n filter the final results.\n @param {String} label optional string describing the promise. Useful for\n tooling.\n @return {Promise}\n */\n function filter(promises, filterFn, label) {\n return all(promises, label).then(function(values){\n if (!isArray(promises)) {\n throw new TypeError('You must pass an array to filter.');\n }\n\n if (!isFunction(filterFn)){\n throw new TypeError(\"You must pass a function to filter's second argument.\");\n }\n\n return map(promises, filterFn, label).then(function(filterResults){\n var i,\n valuesLen = values.length,\n filtered = [];\n\n for (i = 0; i < valuesLen; i++){\n if(filterResults[i]) filtered.push(values[i]);\n }\n return filtered;\n });\n });\n }\n\n __exports__[\"default\"] = filter;\n });\ndefine(\"rsvp/hash\",\n [\"./promise\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var isNonThenable = __dependency2__.isNonThenable;\n var keysOf = __dependency2__.keysOf;\n\n /**\n `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array\n for its `promises` argument.\n\n Returns a promise that is fulfilled when all the given promises have been\n fulfilled, or rejected if any of them become rejected. The returned promise\n is fulfilled with a hash that has the same key names as the `promises` object\n argument. If any of the values in the object are not promises, they will\n simply be copied over to the fulfilled object.\n\n Example:\n\n ```javascript\n var promises = {\n myPromise: RSVP.resolve(1),\n yourPromise: RSVP.resolve(2),\n theirPromise: RSVP.resolve(3),\n notAPromise: 4\n };\n\n RSVP.hash(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: 1,\n // yourPromise: 2,\n // theirPromise: 3,\n // notAPromise: 4\n // }\n });\n ````\n\n If any of the `promises` given to `RSVP.hash` are rejected, the first promise\n that is rejected will be given as the reason to the rejection handler.\n\n Example:\n\n ```javascript\n var promises = {\n myPromise: RSVP.resolve(1),\n rejectedPromise: RSVP.reject(new Error(\"rejectedPromise\")),\n anotherRejectedPromise: RSVP.reject(new Error(\"anotherRejectedPromise\")),\n };\n\n RSVP.hash(promises).then(function(hash){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === \"rejectedPromise\"\n });\n ```\n\n An important note: `RSVP.hash` is intended for plain JavaScript objects that\n are just a set of keys and values. `RSVP.hash` will NOT preserve prototype\n chains.\n\n Example:\n\n ```javascript\n function MyConstructor(){\n this.example = RSVP.resolve(\"Example\");\n }\n\n MyConstructor.prototype = {\n protoProperty: RSVP.resolve(\"Proto Property\")\n };\n\n var myObject = new MyConstructor();\n\n RSVP.hash(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: \"Example\"\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n });\n ```\n\n @method hash\n @for RSVP\n @param {Object} promises\n @param {String} label optional string that describes the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all properties of `promises`\n have been fulfilled, or rejected if any of them become rejected.\n @static\n */\n __exports__[\"default\"] = function hash(object, label) {\n return new Promise(function(resolve, reject){\n var results = {};\n var keys = keysOf(object);\n var remaining = keys.length;\n var entry, property;\n\n if (remaining === 0) {\n resolve(results);\n return;\n }\n\n function fulfilledTo(property) {\n return function(value) {\n results[property] = value;\n if (--remaining === 0) {\n resolve(results);\n }\n };\n }\n\n function onRejection(reason) {\n remaining = 0;\n reject(reason);\n }\n\n for (var i = 0; i < keys.length; i++) {\n property = keys[i];\n entry = object[property];\n\n if (isNonThenable(entry)) {\n results[property] = entry;\n if (--remaining === 0) {\n resolve(results);\n }\n } else {\n Promise.cast(entry).then(fulfilledTo(property), onRejection);\n }\n }\n });\n };\n });\ndefine(\"rsvp/instrument\",\n [\"./config\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var config = __dependency1__.config;\n var now = __dependency2__.now;\n\n __exports__[\"default\"] = function instrument(eventName, promise, child) {\n // instrumentation should not disrupt normal usage.\n try {\n config.trigger(eventName, {\n guid: promise._guidKey + promise._id,\n eventName: eventName,\n detail: promise._detail,\n childGuid: child && promise._guidKey + child._id,\n label: promise._label,\n timeStamp: now(),\n stack: new Error(promise._label).stack\n });\n } catch(error) {\n setTimeout(function(){\n throw error;\n }, 0);\n }\n };\n });\ndefine(\"rsvp/map\",\n [\"./promise\",\"./all\",\"./utils\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var all = __dependency2__[\"default\"];\n var isArray = __dependency3__.isArray;\n var isFunction = __dependency3__.isFunction;\n\n /**\n `RSVP.map` is similar to JavaScript's native `map` method, except that it\n waits for all promises to become fulfilled before running the `mapFn` on\n each item in given to `promises`. `RSVP.map` returns a promise that will\n become fulfilled with the result of running `mapFn` on the values the promises\n become fulfilled with.\n\n For example:\n\n ```javascript\n\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.resolve(2);\n var promise3 = RSVP.resolve(3);\n var promises = [ promise1, promise2, promise3 ];\n\n var mapFn = function(item){\n return item + 1;\n };\n\n RSVP.map(promises, mapFn).then(function(result){\n // result is [ 2, 3, 4 ]\n });\n ```\n\n If any of the `promises` given to `RSVP.map` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.reject(new Error(\"2\"));\n var promise3 = RSVP.reject(new Error(\"3\"));\n var promises = [ promise1, promise2, promise3 ];\n\n var mapFn = function(item){\n return item + 1;\n };\n\n RSVP.map(promises, mapFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === \"2\"\n });\n ```\n\n `RSVP.map` will also wait if a promise is returned from `mapFn`. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first becuase they contain a url to those comments.\n\n ```javscript\n\n var mapFn = function(blogPost){\n // getComments does some ajax and returns an RSVP.Promise that is fulfilled\n // with some comments data\n return getComments(blogPost.comments_url);\n };\n\n // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled\n // with some blog post data\n RSVP.map(getBlogPosts(), mapFn).then(function(comments){\n // comments is the result of asking the server for the comments\n // of all blog posts returned from getBlogPosts()\n });\n ```\n\n @method map\n @for RSVP\n @param {Array} promises\n @param {Function} mapFn function to be called on each fulfilled promise.\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.\n @static\n */\n __exports__[\"default\"] = function map(promises, mapFn, label) {\n return all(promises, label).then(function(results){\n if (!isArray(promises)) {\n throw new TypeError('You must pass an array to map.');\n }\n\n if (!isFunction(mapFn)){\n throw new TypeError(\"You must pass a function to map's second argument.\");\n }\n\n\n var resultLen = results.length,\n mappedResults = [],\n i;\n\n for (i = 0; i < resultLen; i++){\n mappedResults.push(mapFn(results[i]));\n }\n\n return all(mappedResults, label);\n });\n };\n });\ndefine(\"rsvp/node\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n var slice = Array.prototype.slice;\n\n function makeNodeCallbackFor(resolve, reject) {\n return function (error, value) {\n if (error) {\n reject(error);\n } else if (arguments.length > 2) {\n resolve(slice.call(arguments, 1));\n } else {\n resolve(value);\n }\n };\n }\n\n /**\n `RSVP.denodeify` takes a \"node-style\" function and returns a function that\n will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the\n browser when you'd prefer to use promises over using callbacks. For example,\n `denodeify` transforms the following:\n\n ```javascript\n var fs = require('fs');\n\n fs.readFile('myfile.txt', function(err, data){\n if (err) return handleError(err);\n handleData(data);\n });\n ```\n\n into:\n\n ```javascript\n var fs = require('fs');\n\n var readFile = RSVP.denodeify(fs.readFile);\n\n readFile('myfile.txt').then(handleData, handleError);\n ```\n\n Using `denodeify` makes it easier to compose asynchronous operations instead\n of using callbacks. For example, instead of:\n\n ```javascript\n var fs = require('fs');\n var log = require('some-async-logger');\n\n fs.readFile('myfile.txt', function(err, data){\n if (err) return handleError(err);\n fs.writeFile('myfile2.txt', data, function(err){\n if (err) throw err;\n log('success', function(err) {\n if (err) throw err;\n });\n });\n });\n ```\n\n You can chain the operations together using `then` from the returned promise:\n\n ```javascript\n var fs = require('fs');\n var denodeify = RSVP.denodeify;\n var readFile = denodeify(fs.readFile);\n var writeFile = denodeify(fs.writeFile);\n var log = denodeify(require('some-async-logger'));\n\n readFile('myfile.txt').then(function(data){\n return writeFile('myfile2.txt', data);\n }).then(function(){\n return log('SUCCESS');\n }).then(function(){\n // success handler\n }, function(reason){\n // rejection handler\n });\n ```\n\n @method denodeify\n @for RSVP\n @param {Function} nodeFunc a \"node-style\" function that takes a callback as\n its last argument. The callback expects an error to be passed as its first\n argument (if an error occurred, otherwise null), and the value from the\n operation as its second argument (\"function(err, value){ }\").\n @param {Any} binding optional argument for binding the \"this\" value when\n calling the `nodeFunc` function.\n @return {Function} a function that wraps `nodeFunc` to return an\n `RSVP.Promise`\n @static\n */\n __exports__[\"default\"] = function denodeify(nodeFunc, binding) {\n return function() {\n var nodeArgs = slice.call(arguments), resolve, reject;\n var thisArg = this || binding;\n\n return new Promise(function(resolve, reject) {\n Promise.all(nodeArgs).then(function(nodeArgs) {\n try {\n nodeArgs.push(makeNodeCallbackFor(resolve, reject));\n nodeFunc.apply(thisArg, nodeArgs);\n } catch(e) {\n reject(e);\n }\n });\n });\n };\n };\n });\ndefine(\"rsvp/promise\",\n [\"./config\",\"./events\",\"./instrument\",\"./utils\",\"./promise/cast\",\"./promise/all\",\"./promise/race\",\"./promise/resolve\",\"./promise/reject\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {\n \"use strict\";\n var config = __dependency1__.config;\n var EventTarget = __dependency2__[\"default\"];\n var instrument = __dependency3__[\"default\"];\n var objectOrFunction = __dependency4__.objectOrFunction;\n var isFunction = __dependency4__.isFunction;\n var now = __dependency4__.now;\n var cast = __dependency5__[\"default\"];\n var all = __dependency6__[\"default\"];\n var race = __dependency7__[\"default\"];\n var Resolve = __dependency8__[\"default\"];\n var Reject = __dependency9__[\"default\"];\n\n var guidKey = 'rsvp_' + now() + '-';\n var counter = 0;\n\n function noop() {}\n\n __exports__[\"default\"] = Promise;\n\n\n /**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise’s eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable. Similarly, a\n rejection reason is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n var promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n var xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error(\"getJSON: `\" + url + \"` failed with status: [\" + this.status + \"]\");\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class RSVP.Promise\n @param {function}\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @constructor\n */\n function Promise(resolver, label) {\n if (!isFunction(resolver)) {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n }\n\n if (!(this instanceof Promise)) {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n }\n\n this._id = counter++;\n this._label = label;\n this._subscribers = [];\n\n if (config.instrument) {\n instrument('created', this);\n }\n\n if (noop !== resolver) {\n invokeResolver(resolver, this);\n }\n }\n\n function invokeResolver(resolver, promise) {\n function resolvePromise(value) {\n resolve(promise, value);\n }\n\n function rejectPromise(reason) {\n reject(promise, reason);\n }\n\n try {\n resolver(resolvePromise, rejectPromise);\n } catch(e) {\n rejectPromise(e);\n }\n }\n\n Promise.cast = cast;\n Promise.all = all;\n Promise.race = race;\n Promise.resolve = Resolve;\n Promise.reject = Reject;\n\n var PENDING = void 0;\n var SEALED = 0;\n var FULFILLED = 1;\n var REJECTED = 2;\n\n function subscribe(parent, child, onFulfillment, onRejection) {\n var subscribers = parent._subscribers;\n var length = subscribers.length;\n\n subscribers[length] = child;\n subscribers[length + FULFILLED] = onFulfillment;\n subscribers[length + REJECTED] = onRejection;\n }\n\n function publish(promise, settled) {\n var child, callback, subscribers = promise._subscribers, detail = promise._detail;\n\n if (config.instrument) {\n instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise);\n }\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n invokeCallback(settled, child, callback, detail);\n }\n\n promise._subscribers = null;\n }\n\n Promise.prototype = {\n constructor: Promise,\n\n _id: undefined,\n _guidKey: guidKey,\n _label: undefined,\n\n _state: undefined,\n _detail: undefined,\n _subscribers: undefined,\n\n _onerror: function (reason) {\n config.trigger('error', reason);\n },\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n\n Chaining\n --------\n\n The return value of `then` is itself a promise. This second, \"downstream\"\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return \"default name\";\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `\"default name\"`\n });\n\n findUser().then(function (user) {\n throw new Error(\"Found user, but still unhappy\");\n }, function (reason) {\n throw new Error(\"`findUser` rejected and we're unhappy\");\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be \"Found user, but still unhappy\".\n // If `findUser` rejected, `reason` will be \"`findUser` rejected and we're unhappy\".\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException(\"Upstream error\");\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n\n Assimilation\n ------------\n\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n\n If the assimliated promise rejects, then the downstream promise will also reject.\n\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n\n Simple Example\n --------------\n\n Synchronous Example\n\n ```javascript\n var result;\n\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n\n Errback Example\n\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n\n Promise Example;\n\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n\n Advanced Example\n --------------\n\n Synchronous Example\n\n ```javascript\n var author, books;\n\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n\n Errback Example\n\n ```js\n\n function foundBooks(books) {\n\n }\n\n function failure(reason) {\n\n }\n\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n\n Promise Example;\n\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n then: function(onFulfillment, onRejection, label) {\n var promise = this;\n this._onerror = null;\n\n var thenPromise = new this.constructor(noop, label);\n\n if (this._state) {\n var callbacks = arguments;\n config.async(function invokePromiseCallback() {\n invokeCallback(promise._state, thenPromise, callbacks[promise._state - 1], promise._detail);\n });\n } else {\n subscribe(this, thenPromise, onFulfillment, onRejection);\n }\n\n if (config.instrument) {\n instrument('chained', promise, thenPromise);\n }\n\n return thenPromise;\n },\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n\n ```js\n function findAuthor(){\n throw new Error(\"couldn't find that author\");\n }\n\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n\n @method catch\n @param {Function} onRejection\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function(onRejection, label) {\n return this.then(null, onRejection, label);\n },\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n\n Synchronous example:\n\n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n\n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n\n Asynchronous example:\n\n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n\n @method finally\n @param {Function} callback\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n 'finally': function(callback, label) {\n var constructor = this.constructor;\n\n return this.then(function(value) {\n return constructor.cast(callback()).then(function(){\n return value;\n });\n }, function(reason) {\n return constructor.cast(callback()).then(function(){\n throw reason;\n });\n }, label);\n }\n };\n\n function invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value, error, succeeded, failed;\n\n if (hasCallback) {\n try {\n value = callback(detail);\n succeeded = true;\n } catch(e) {\n failed = true;\n error = e;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (handleThenable(promise, value)) {\n return;\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (failed) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n resolve(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n }\n\n function handleThenable(promise, value) {\n var then = null,\n resolved;\n\n try {\n if (promise === value) {\n throw new TypeError(\"A promises callback cannot return that same promise.\");\n }\n\n if (objectOrFunction(value)) {\n then = value.then;\n\n if (isFunction(then)) {\n then.call(value, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n if (value !== val) {\n resolve(promise, val);\n } else {\n fulfill(promise, val);\n }\n }, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n reject(promise, val);\n }, 'derived from: ' + (promise._label || ' unknown promise'));\n\n return true;\n }\n }\n } catch (error) {\n if (resolved) { return true; }\n reject(promise, error);\n return true;\n }\n\n return false;\n }\n\n function resolve(promise, value) {\n if (promise === value) {\n fulfill(promise, value);\n } else if (!handleThenable(promise, value)) {\n fulfill(promise, value);\n }\n }\n\n function fulfill(promise, value) {\n if (promise._state !== PENDING) { return; }\n promise._state = SEALED;\n promise._detail = value;\n\n config.async(publishFulfillment, promise);\n }\n\n function reject(promise, reason) {\n if (promise._state !== PENDING) { return; }\n promise._state = SEALED;\n promise._detail = reason;\n\n config.async(publishRejection, promise);\n }\n\n function publishFulfillment(promise) {\n publish(promise, promise._state = FULFILLED);\n }\n\n function publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._detail);\n }\n\n publish(promise, promise._state = REJECTED);\n }\n });\ndefine(\"rsvp/promise/all\",\n [\"../utils\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var isArray = __dependency1__.isArray;\n var isNonThenable = __dependency1__.isNonThenable;\n\n /**\n `RSVP.Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.resolve(2);\n var promise3 = RSVP.resolve(3);\n var promises = [ promise1, promise2, promise3 ];\n\n RSVP.Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `RSVP.all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.reject(new Error(\"2\"));\n var promise3 = RSVP.reject(new Error(\"3\"));\n var promises = [ promise1, promise2, promise3 ];\n\n RSVP.Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @for Ember.RSVP.Promise\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n */\n __exports__[\"default\"] = function all(entries, label) {\n\n /*jshint validthis:true */\n var Constructor = this;\n\n return new Constructor(function(resolve, reject) {\n if (!isArray(entries)) {\n throw new TypeError('You must pass an array to all.');\n }\n\n var remaining = entries.length;\n var results = new Array(remaining);\n var entry, pending = true;\n\n if (remaining === 0) {\n resolve(results);\n return;\n }\n\n function fulfillmentAt(index) {\n return function(value) {\n results[index] = value;\n if (--remaining === 0) {\n resolve(results);\n }\n };\n }\n\n function onRejection(reason) {\n remaining = 0;\n reject(reason);\n }\n\n for (var index = 0; index < entries.length; index++) {\n entry = entries[index];\n if (isNonThenable(entry)) {\n results[index] = entry;\n if (--remaining === 0) {\n resolve(results);\n }\n } else {\n Constructor.cast(entry).then(fulfillmentAt(index), onRejection);\n }\n }\n }, label);\n };\n });\ndefine(\"rsvp/promise/cast\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n `RSVP.Promise.cast` coerces its argument to a promise, or returns the\n argument if it is already a promise which shares a constructor with the caster.\n\n Example:\n\n ```javascript\n var promise = RSVP.Promise.resolve(1);\n var casted = RSVP.Promise.cast(promise);\n\n console.log(promise === casted); // true\n ```\n\n In the case of a promise whose constructor does not match, it is assimilated.\n The resulting promise will fulfill or reject based on the outcome of the\n promise being casted.\n\n Example:\n\n ```javascript\n var thennable = $.getJSON('/api/foo');\n var casted = RSVP.Promise.cast(thennable);\n\n console.log(thennable === casted); // false\n console.log(casted instanceof RSVP.Promise) // true\n\n casted.then(function(data) {\n // data is the value getJSON fulfills with\n });\n ```\n\n In the case of a non-promise, a promise which will fulfill with that value is\n returned.\n\n Example:\n\n ```javascript\n var value = 1; // could be a number, boolean, string, undefined...\n var casted = RSVP.Promise.cast(value);\n\n console.log(value === casted); // false\n console.log(casted instanceof RSVP.Promise) // true\n\n casted.then(function(val) {\n val === value // => true\n });\n ```\n\n `RSVP.Promise.cast` is similar to `RSVP.Promise.resolve`, but `RSVP.Promise.cast` differs in the\n following ways:\n\n * `RSVP.Promise.cast` serves as a memory-efficient way of getting a promise, when you\n have something that could either be a promise or a value. RSVP.resolve\n will have the same effect but will create a new promise wrapper if the\n argument is a promise.\n * `RSVP.Promise.cast` is a way of casting incoming thenables or promise subclasses to\n promises of the exact class specified, so that the resulting object's `then` is\n ensured to have the behavior of the constructor you are calling cast on (i.e., RSVP.Promise).\n\n @method cast\n @param {Object} object to be casted\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise\n @static\n */\n\n __exports__[\"default\"] = function cast(object, label) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n return new Constructor(function(resolve) {\n resolve(object);\n }, label);\n };\n });\ndefine(\"rsvp/promise/race\",\n [\"../utils\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n /* global toString */\n\n var isArray = __dependency1__.isArray;\n var isFunction = __dependency1__.isFunction;\n var isNonThenable = __dependency1__.isNonThenable;\n\n /**\n `RSVP.Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n var promise1 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n resolve(\"promise 1\");\n }, 200);\n });\n\n var promise2 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n resolve(\"promise 2\");\n }, 100);\n });\n\n RSVP.Promise.race([promise1, promise2]).then(function(result){\n // result === \"promise 2\" because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `RSVP.Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n var promise1 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n resolve(\"promise 1\");\n }, 200);\n });\n\n var promise2 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error(\"promise 2\"));\n }, 100);\n });\n\n RSVP.Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === \"promise2\" because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n RSVP.Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @param {Array} promises array of promises to observe\n @param {String} label optional string for describing the promise returned.\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n @static\n */\n __exports__[\"default\"] = function race(entries, label) {\n /*jshint validthis:true */\n var Constructor = this, entry;\n\n return new Constructor(function(resolve, reject) {\n if (!isArray(entries)) {\n throw new TypeError('You must pass an array to race.');\n }\n\n var pending = true;\n\n function onFulfillment(value) { if (pending) { pending = false; resolve(value); } }\n function onRejection(reason) { if (pending) { pending = false; reject(reason); } }\n\n for (var i = 0; i < entries.length; i++) {\n entry = entries[i];\n if (isNonThenable(entry)) {\n pending = false;\n resolve(entry);\n return;\n } else {\n Constructor.cast(entry).then(onFulfillment, onRejection);\n }\n }\n }, label);\n };\n });\ndefine(\"rsvp/promise/reject\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n `RSVP.Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n var promise = new RSVP.Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n var promise = RSVP.Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @param {Any} reason value that the returned promise will be rejected with.\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n @static\n */\n __exports__[\"default\"] = function reject(reason, label) {\n /*jshint validthis:true */\n var Constructor = this;\n\n return new Constructor(function (resolve, reject) {\n reject(reason);\n }, label);\n };\n });\ndefine(\"rsvp/promise/resolve\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n `RSVP.Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n var promise = new RSVP.Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n var promise = RSVP.Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @param {Any} value value that the returned promise will be resolved with\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n @static\n */\n __exports__[\"default\"] = function resolve(value, label) {\n /*jshint validthis:true */\n var Constructor = this;\n\n return new Constructor(function(resolve, reject) {\n resolve(value);\n }, label);\n };\n });\ndefine(\"rsvp/race\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n This is a convenient alias for `RSVP.Promise.race`.\n\n @method race\n @param {Array} array Array of promises.\n @param {String} label An optional label. This is useful\n for tooling.\n @static\n */\n __exports__[\"default\"] = function race(array, label) {\n return Promise.race(array, label);\n };\n });\ndefine(\"rsvp/reject\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n This is a convenient alias for `RSVP.Promise.reject`.\n\n @method reject\n @for RSVP\n @param {Any} reason value that the returned promise will be rejected with.\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n @static\n */\n __exports__[\"default\"] = function reject(reason, label) {\n return Promise.reject(reason, label);\n };\n });\ndefine(\"rsvp/resolve\",\n [\"./promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n\n /**\n This is a convenient alias for `RSVP.Promise.resolve`.\n\n @method resolve\n @for RSVP\n @param {Any} value value that the returned promise will be resolved with\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n @static\n */\n __exports__[\"default\"] = function resolve(value, label) {\n return Promise.resolve(value, label);\n };\n });\ndefine(\"rsvp/rethrow\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n /**\n `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event\n loop in order to aid debugging.\n\n Promises A+ specifies that any exceptions that occur with a promise must be\n caught by the promises implementation and bubbled to the last handler. For\n this reason, it is recommended that you always specify a second rejection\n handler function to `then`. However, `RSVP.rethrow` will throw the exception\n outside of the promise, so it bubbles up to your console if in the browser,\n or domain/cause uncaught exception in Node. `rethrow` will also throw the\n error again so the error can be handled by the promise per the spec.\n\n ```javascript\n function throws(){\n throw new Error('Whoops!');\n }\n\n var promise = new RSVP.Promise(function(resolve, reject){\n throws();\n });\n\n promise.catch(RSVP.rethrow).then(function(){\n // Code here doesn't run because the promise became rejected due to an\n // error!\n }, function (err){\n // handle the error here\n });\n ```\n\n The 'Whoops' error will be thrown on the next turn of the event loop\n and you can watch for it in your console. You can also handle it using a\n rejection handler given to `.then` or `.catch` on the returned promise.\n\n @method rethrow\n @for RSVP\n @param {Error} reason reason the promise became rejected.\n @throws Error\n @static\n */\n __exports__[\"default\"] = function rethrow(reason) {\n setTimeout(function() {\n throw reason;\n });\n throw reason;\n };\n });\ndefine(\"rsvp/utils\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n function objectOrFunction(x) {\n return typeof x === \"function\" || (typeof x === \"object\" && x !== null);\n }\n\n __exports__.objectOrFunction = objectOrFunction;function isFunction(x) {\n return typeof x === \"function\";\n }\n\n __exports__.isFunction = isFunction;function isNonThenable(x) {\n return !objectOrFunction(x);\n }\n\n __exports__.isNonThenable = isNonThenable;function isArray(x) {\n return Object.prototype.toString.call(x) === \"[object Array]\";\n }\n\n __exports__.isArray = isArray;// Date.now is not available in browsers < IE9\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility\n var now = Date.now || function() { return new Date().getTime(); };\n __exports__.now = now;\n var keysOf = Object.keys || function(object) {\n var result = [];\n\n for (var prop in object) {\n result.push(prop);\n }\n\n return result;\n };\n __exports__.keysOf = keysOf;\n });\ndefine(\"rsvp\",\n [\"./rsvp/promise\",\"./rsvp/events\",\"./rsvp/node\",\"./rsvp/all\",\"./rsvp/all_settled\",\"./rsvp/race\",\"./rsvp/hash\",\"./rsvp/rethrow\",\"./rsvp/defer\",\"./rsvp/config\",\"./rsvp/map\",\"./rsvp/resolve\",\"./rsvp/reject\",\"./rsvp/filter\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__[\"default\"];\n var EventTarget = __dependency2__[\"default\"];\n var denodeify = __dependency3__[\"default\"];\n var all = __dependency4__[\"default\"];\n var allSettled = __dependency5__[\"default\"];\n var race = __dependency6__[\"default\"];\n var hash = __dependency7__[\"default\"];\n var rethrow = __dependency8__[\"default\"];\n var defer = __dependency9__[\"default\"];\n var config = __dependency10__.config;\n var configure = __dependency10__.configure;\n var map = __dependency11__[\"default\"];\n var resolve = __dependency12__[\"default\"];\n var reject = __dependency13__[\"default\"];\n var filter = __dependency14__[\"default\"];\n\n function async(callback, arg) {\n config.async(callback, arg);\n }\n\n function on() {\n config.on.apply(config, arguments);\n }\n\n function off() {\n config.off.apply(config, arguments);\n }\n\n // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__`\n if (typeof window !== 'undefined' && typeof window.__PROMISE_INSTRUMENTATION__ === 'object') {\n var callbacks = window.__PROMISE_INSTRUMENTATION__;\n configure('instrument', true);\n for (var eventName in callbacks) {\n if (callbacks.hasOwnProperty(eventName)) {\n on(eventName, callbacks[eventName]);\n }\n }\n }\n\n __exports__.Promise = Promise;\n __exports__.EventTarget = EventTarget;\n __exports__.all = all;\n __exports__.allSettled = allSettled;\n __exports__.race = race;\n __exports__.hash = hash;\n __exports__.rethrow = rethrow;\n __exports__.defer = defer;\n __exports__.denodeify = denodeify;\n __exports__.configure = configure;\n __exports__.on = on;\n __exports__.off = off;\n __exports__.resolve = resolve;\n __exports__.reject = reject;\n __exports__.async = async;\n __exports__.map = map;\n __exports__.filter = filter;\n });\n\n})();\n//@ sourceURL=rsvp");
\ No newline at end of file