dist/ember.prod.js in ember-source-1.13.13 vs dist/ember.prod.js in ember-source-2.0.0.beta.2

- old
+ new

@@ -3,11 +3,11 @@ * @copyright Copyright 2011-2015 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.13.13 + * @version 2.0.0-beta.2 */ (function() { var enifed, requireModule, eriuqer, requirejs, Ember; var mainContext = this; @@ -34,11 +34,11 @@ } else { value.deps = deps; value.callback = callback; } - registry[name] = value; + registry[name] = value; }; requirejs = eriuqer = requireModule = function(name) { return internalRequire(name, null); } @@ -113,52 +113,35 @@ requirejs = eriuqer = requireModule = Ember.__loader.require; } })(); enifed('backburner', ['exports', './backburner/utils', './backburner/platform', './backburner/binary-search', './backburner/deferred-action-queues'], function (exports, _backburnerUtils, _backburnerPlatform, _backburnerBinarySearch, _backburnerDeferredActionQueues) { - 'use strict'; + exports.default = Backburner; - exports["default"] = Backburner; - function Backburner(queueNames, options) { this.queueNames = queueNames; this.options = options || {}; if (!this.options.defaultQueue) { this.options.defaultQueue = queueNames[0]; } this.instanceStack = []; this._debouncees = []; this._throttlers = []; - this._eventCallbacks = { - end: [], - begin: [] - }; - - this._timerTimeoutId = undefined; this._timers = []; - - var _this = this; - this._boundRunExpiredTimers = function () { - _this._runExpiredTimers(); - }; } - // ms of delay before we conclude a timeout was lost - var TIMEOUT_STALLED_THRESHOLD = 1000; - Backburner.prototype = { begin: function () { var options = this.options; var onBegin = options && options.onBegin; var previousInstance = this.currentInstance; if (previousInstance) { this.instanceStack.push(previousInstance); } - this.currentInstance = new _backburnerDeferredActionQueues["default"](this.queueNames, options); - this._trigger('begin', this.currentInstance, previousInstance); + this.currentInstance = new _backburnerDeferredActionQueues.default(this.queueNames, options); if (onBegin) { onBegin(this.currentInstance, previousInstance); } }, @@ -181,73 +164,19 @@ if (this.instanceStack.length) { nextInstance = this.instanceStack.pop(); this.currentInstance = nextInstance; } - this._trigger('end', currentInstance, nextInstance); + if (onEnd) { onEnd(currentInstance, nextInstance); } } } }, - /** - Trigger an event. Supports up to two arguments. Designed around - triggering transition events from one run loop instance to the - next, which requires an argument for the first instance and then - an argument for the next instance. - @private - @method _trigger - @param {String} eventName - @param {any} arg1 - @param {any} arg2 - */ - _trigger: function (eventName, arg1, arg2) { - var callbacks = this._eventCallbacks[eventName]; - if (callbacks) { - for (var i = 0; i < callbacks.length; i++) { - callbacks[i](arg1, arg2); - } - } - }, - - on: function (eventName, callback) { - if (typeof callback !== 'function') { - throw new TypeError('Callback must be a function'); - } - var callbacks = this._eventCallbacks[eventName]; - if (callbacks) { - callbacks.push(callback); - } else { - throw new TypeError('Cannot on() event "' + eventName + '" because it does not exist'); - } - }, - - off: function (eventName, callback) { - if (eventName) { - var callbacks = this._eventCallbacks[eventName]; - var callbackFound = false; - if (!callbacks) return; - if (callback) { - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback) { - callbackFound = true; - callbacks.splice(i, 1); - i--; - } - } - } - if (!callbackFound) { - throw new TypeError('Cannot off() callback that does not exist'); - } - } else { - throw new TypeError('Cannot off() event "' + eventName + '" because it does not exist'); - } - }, - - run: function () /* target, method, args */{ + run: function () { var length = arguments.length; var method, target, args; if (length === 1) { method = arguments[0]; @@ -298,64 +227,43 @@ } } } }, - /* - Join the passed method with an existing queue and execute immediately, - if there isn't one use `Backburner#run`. - The join method is like the run method except that it will schedule into - an existing queue if one already exists. In either case, the join method will - immediately execute the passed in function and return its result. - @method join - @param {Object} target - @param {Function} method The method to be executed - @param {any} args The method arguments - @return method result - */ - join: function () /* target, method, args */{ - if (!this.currentInstance) { - return this.run.apply(this, arguments); - } + join: function () { + if (this.currentInstance) { + var length = arguments.length; + var method, target; - var length = arguments.length; - var method, target; + if (length === 1) { + method = arguments[0]; + target = null; + } else { + target = arguments[0]; + method = arguments[1]; + } - if (length === 1) { - method = arguments[0]; - target = null; - } else { - target = arguments[0]; - method = arguments[1]; - } + if (_backburnerUtils.isString(method)) { + method = target[method]; + } - if (_backburnerUtils.isString(method)) { - method = target[method]; - } - - if (length === 1) { - return method(); - } else if (length === 2) { - return method.call(target); - } else { - var args = new Array(length - 2); - for (var i = 0, l = length - 2; i < l; i++) { - args[i] = arguments[i + 2]; + if (length === 1) { + return method(); + } else if (length === 2) { + return method.call(target); + } else { + var args = new Array(length - 2); + for (var i = 0, l = length - 2; i < l; i++) { + args[i] = arguments[i + 2]; + } + return method.apply(target, args); } - return method.apply(target, args); + } else { + return this.run.apply(this, arguments); } }, - /* - Defer the passed function to run inside the specified queue. - @method defer - @param {String} queueName - @param {Object} target - @param {Function|String} method The method or method name to be executed - @param {any} args The method arguments - @return method result - */ defer: function (queueName /* , target, method, args */) { var length = arguments.length; var method, target, args; if (length === 2) { @@ -494,31 +402,16 @@ } else { method.apply(target, args); } } - return this._setTimeout(fn, executeAt); - }, - - _setTimeout: function (fn, executeAt) { - if (this._timers.length === 0) { - this._timers.push(executeAt, fn); - this._installTimerTimeout(); - return fn; - } - - this._reinstallStalledTimerTimeout(); - // find position to insert - var i = _backburnerBinarySearch["default"](executeAt, this._timers); + var i = _backburnerBinarySearch.default(executeAt, this._timers); this._timers.splice(i, 0, executeAt, fn); - // we should be the new earliest timer if i == 0 - if (i === 0) { - this._reinstallTimerTimeout(); - } + updateLaterTimer(this, executeAt, wait); return fn; }, throttle: function (target, method /* , args, wait, [immediate] */) { @@ -542,11 +435,11 @@ index = findThrottler(target, method, this._throttlers); if (index > -1) { return this._throttlers[index]; } // throttled - timer = _backburnerPlatform["default"].setTimeout(function () { + timer = _backburnerPlatform.default.setTimeout(function () { if (!immediate) { backburner.run.apply(backburner, args); } var index = findThrottler(target, method, backburner._throttlers); if (index > -1) { @@ -590,11 +483,11 @@ debouncee = this._debouncees[index]; this._debouncees.splice(index, 1); clearTimeout(debouncee[2]); } - timer = _backburnerPlatform["default"].setTimeout(function () { + timer = _backburnerPlatform.default.setTimeout(function () { if (!immediate) { backburner.run.apply(backburner, args); } var index = findDebouncee(target, method, backburner._debouncees); if (index > -1) { @@ -612,17 +505,24 @@ return debouncee; }, cancelTimers: function () { + var clearItems = function (item) { + clearTimeout(item[2]); + }; + _backburnerUtils.each(this._throttlers, clearItems); this._throttlers = []; _backburnerUtils.each(this._debouncees, clearItems); this._debouncees = []; - this._clearTimerTimeout(); + if (this._laterTimer) { + clearTimeout(this._laterTimer); + this._laterTimer = null; + } this._timers = []; if (this._autorun) { clearTimeout(this._autorun); this._autorun = null; @@ -643,11 +543,19 @@ // we're cancelling a setTimeout for (var i = 0, l = this._timers.length; i < l; i += 2) { if (this._timers[i + 1] === timer) { this._timers.splice(i, 2); // remove the two elements if (i === 0) { - this._reinstallTimerTimeout(); + if (this._laterTimer) { + // Active timer? Then clear timer and reset for future timer + clearTimeout(this._laterTimer); + this._laterTimer = null; + } + if (this._timers.length > 0) { + // Update to next available timer when available + updateLaterTimer(this, this._timers[0], this._timers[0] - _backburnerUtils.now()); + } } return true; } } } else if (Object.prototype.toString.call(timer) === '[object Array]') { @@ -677,71 +585,10 @@ return true; } } return false; - }, - - _runExpiredTimers: function () { - this._timerTimeoutId = undefined; - this.run(this, this._scheduleExpiredTimers); - }, - - _scheduleExpiredTimers: function () { - var n = _backburnerUtils.now(); - var timers = this._timers; - var i = 0; - var l = timers.length; - for (; i < l; i += 2) { - var executeAt = timers[i]; - var fn = timers[i + 1]; - if (executeAt <= n) { - this.schedule(this.options.defaultQueue, null, fn); - } else { - break; - } - } - timers.splice(0, i); - this._installTimerTimeout(); - }, - - _reinstallStalledTimerTimeout: function () { - if (!this._timerTimeoutId) { - return; - } - // if we have a timer we should always have a this._timerTimeoutId - var minExpiresAt = this._timers[0]; - var delay = _backburnerUtils.now() - minExpiresAt; - // threshold of a second before we assume that the currently - // installed timeout will not run, so we don't constantly reinstall - // timeouts that are delayed but good still - if (delay < TIMEOUT_STALLED_THRESHOLD) { - return; - } - }, - - _reinstallTimerTimeout: function () { - this._clearTimerTimeout(); - this._installTimerTimeout(); - }, - - _clearTimerTimeout: function () { - if (!this._timerTimeoutId) { - return; - } - clearTimeout(this._timerTimeoutId); - this._timerTimeoutId = undefined; - }, - - _installTimerTimeout: function () { - if (!this._timers.length) { - return; - } - var minExpiresAt = this._timers[0]; - var n = _backburnerUtils.now(); - var wait = Math.max(0, minExpiresAt - n); - this._timerTimeoutId = setTimeout(this._boundRunExpiredTimers, wait); } }; Backburner.prototype.schedule = Backburner.prototype.defer; Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce; @@ -759,16 +606,62 @@ return options.onError || options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]; } function createAutorun(backburner) { backburner.begin(); - backburner._autorun = _backburnerPlatform["default"].setTimeout(function () { + backburner._autorun = _backburnerPlatform.default.setTimeout(function () { backburner._autorun = null; backburner.end(); }); } + function updateLaterTimer(backburner, executeAt, wait) { + var n = _backburnerUtils.now(); + if (!backburner._laterTimer || executeAt < backburner._laterTimerExpiresAt || backburner._laterTimerExpiresAt < n) { + + if (backburner._laterTimer) { + // Clear when: + // - Already expired + // - New timer is earlier + clearTimeout(backburner._laterTimer); + + if (backburner._laterTimerExpiresAt < n) { + // If timer was never triggered + // Calculate the left-over wait-time + wait = Math.max(0, executeAt - n); + } + } + + backburner._laterTimer = _backburnerPlatform.default.setTimeout(function () { + backburner._laterTimer = null; + backburner._laterTimerExpiresAt = null; + executeTimers(backburner); + }, wait); + + backburner._laterTimerExpiresAt = n + wait; + } + } + + function executeTimers(backburner) { + var n = _backburnerUtils.now(); + var fns, i, l; + + backburner.run(function () { + i = _backburnerBinarySearch.default(n, backburner._timers); + + fns = backburner._timers.splice(0, i); + + for (i = 1, l = fns.length; i < l; i += 2) { + backburner.schedule(backburner.options.defaultQueue, null, fns[i]); + } + }); + + if (backburner._timers.length) { + updateLaterTimer(backburner, backburner._timers[0], backburner._timers[0] - n); + } + } + function findDebouncee(target, method, debouncees) { return findItem(target, method, debouncees); } function findThrottler(target, method, throttlers) { @@ -787,20 +680,15 @@ } } return index; } - - function clearItems(item) { - clearTimeout(item[2]); - } }); +/* target, method, args */ /* target, method, args */ enifed("backburner/binary-search", ["exports"], function (exports) { - "use strict"; + exports.default = binarySearch; - exports["default"] = binarySearch; - function binarySearch(time, timers) { var start = 0; var end = timers.length - 2; var middle, l; @@ -822,59 +710,50 @@ return time >= timers[start] ? start + 2 : start; } }); enifed('backburner/deferred-action-queues', ['exports', './utils', './queue'], function (exports, _utils, _queue) { - 'use strict'; + exports.default = DeferredActionQueues; - exports["default"] = DeferredActionQueues; - function DeferredActionQueues(queueNames, options) { var queues = this.queues = {}; this.queueNames = queueNames = queueNames || []; this.options = options; _utils.each(queueNames, function (queueName) { - queues[queueName] = new _queue["default"](queueName, options[queueName], options); + queues[queueName] = new _queue.default(queueName, options[queueName], options); }); } function noSuchQueue(name) { throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); } - function noSuchMethod(name) { - throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); - } - DeferredActionQueues.prototype = { schedule: function (name, target, method, args, onceFlag, stack) { var queues = this.queues; var queue = queues[name]; if (!queue) { noSuchQueue(name); } - if (!method) { - noSuchMethod(name); - } - if (onceFlag) { return queue.pushUnique(target, method, args, stack); } else { return queue.push(target, method, args, stack); } }, flush: function () { var queues = this.queues; var queueNames = this.queueNames; - var queueName, queue; + var queueName, queue, queueItems, priorQueueNameIndex; var queueNameIndex = 0; var numberOfQueues = queueNames.length; + var options = this.options; while (queueNameIndex < numberOfQueues) { queueName = queueNames[queueNameIndex]; queue = queues[queueName]; @@ -892,12 +771,10 @@ }); enifed('backburner/platform', ['exports'], function (exports) { // In IE 6-8, try/finally doesn't work without a catch. // Unfortunately, this is impossible to test for since wrapping it in a parent try/catch doesn't trigger the bug. // This tests for another broken try/catch behavior that only exhibits in the same versions of IE. - 'use strict'; - var needsIETryCatchFix = (function (e, x) { try { x(); } catch (e) {} // jshint ignore:line return !!e; @@ -910,22 +787,20 @@ if (typeof self === 'object') { platform = self; /* global global */ } else if (typeof global === 'object') { - platform = global; - } else { - throw new Error('no global: `self` or `global` found'); - } + platform = global; + } else { + throw new Error('no global: `self` or `global` found'); + } - exports["default"] = platform; + exports.default = platform; }); enifed('backburner/queue', ['exports', './utils'], function (exports, _utils) { - 'use strict'; + exports.default = Queue; - exports["default"] = Queue; - function Queue(name, options, globalOptions) { this.name = name; this.globalOptions = globalOptions || {}; this.options = options; this._queue = []; @@ -994,10 +869,15 @@ method: method }; }, pushUnique: function (target, method, args, stack) { + var queue = this._queue, + currentTarget, + currentMethod, + i, + l; var KEY = this.globalOptions.GUID_KEY; if (target && KEY) { var guid = target[KEY]; if (guid) { @@ -1151,12 +1031,10 @@ } } }; }); enifed('backburner/utils', ['exports'], function (exports) { - 'use strict'; - exports.each = each; exports.isString = isString; exports.isFunction = isFunction; exports.isNumber = isNumber; exports.isCoercableNumber = isCoercableNumber; @@ -1239,11 +1117,12 @@ } else { return packageVersion; } }; }); -enifed('container', ['exports', 'container/registry', 'container/container'], function (exports, _containerRegistry, _containerContainer) { +enifed('container', ['exports', 'ember-metal/core', 'container/registry', 'container/container'], function (exports, _emberMetalCore, _containerRegistry, _containerContainer) { + /* Public api for the container is still in flux. The public api, specified on the application namespace should be considered the stable api. // @module container @private @@ -1252,23 +1131,20 @@ /* Flag to enable/disable model factory injections (disabled by default) If model factory injections are enabled, models should not be accessed globally (only through `container.lookupFactory('model:modelName'))`); */ - 'use strict'; + _emberMetalCore.default.MODEL_FACTORY_INJECTIONS = false; - Ember.MODEL_FACTORY_INJECTIONS = false; - - if (Ember.ENV && typeof Ember.ENV.MODEL_FACTORY_INJECTIONS !== 'undefined') { - Ember.MODEL_FACTORY_INJECTIONS = !!Ember.ENV.MODEL_FACTORY_INJECTIONS; + if (_emberMetalCore.default.ENV && typeof _emberMetalCore.default.ENV.MODEL_FACTORY_INJECTIONS !== 'undefined') { + _emberMetalCore.default.MODEL_FACTORY_INJECTIONS = !!_emberMetalCore.default.ENV.MODEL_FACTORY_INJECTIONS; } - exports.Registry = _containerRegistry["default"]; - exports.Container = _containerContainer["default"]; + exports.Registry = _containerRegistry.default; + exports.Container = _containerContainer.default; }); -enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/keys', 'ember-metal/dictionary'], function (exports, _emberMetalCore, _emberMetalKeys, _emberMetalDictionary) { - 'use strict'; +enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/dictionary'], function (exports, _emberMetalCore, _emberMetalDictionary) { // TODO - Temporary workaround for v0.4.0 of the ES6 transpiler, which lacks support for circular dependencies. // See the below usage of requireModule. Instead, it should be possible to simply `import Registry from './registry';` var Registry; @@ -1294,13 +1170,13 @@ } return new Registry(); })(); - this.cache = _emberMetalDictionary["default"](options && options.cache ? options.cache : null); - this.factoryCache = _emberMetalDictionary["default"](options && options.factoryCache ? options.factoryCache : null); - this.validationCache = _emberMetalDictionary["default"](options && options.validationCache ? options.validationCache : null); + this.cache = _emberMetalDictionary.default(options && options.cache ? options.cache : null); + this.factoryCache = _emberMetalDictionary.default(options && options.factoryCache ? options.factoryCache : null); + this.validationCache = _emberMetalDictionary.default(options && options.validationCache ? options.validationCache : null); } Container.prototype = { /** @private @@ -1477,11 +1353,11 @@ if (factory === undefined) { return; } var type = fullName.split(':')[0]; - if (!factory || typeof factory.extend !== 'function' || !_emberMetalCore["default"].MODEL_FACTORY_INJECTIONS && type === 'model') { + if (!factory || typeof factory.extend !== 'function' || !_emberMetalCore.default.MODEL_FACTORY_INJECTIONS && type === 'model') { if (factory && typeof factory._onLookup === 'function') { factory._onLookup(fullName); } // TODO: think about a 'safe' merge style extension @@ -1567,11 +1443,11 @@ } } function eachDestroyable(container, callback) { var cache = container.cache; - var keys = _emberMetalKeys["default"](cache); + var keys = Object.keys(cache); var key, value; for (var i = 0, l = keys.length; i < l; i++) { key = keys[i]; value = cache[key]; @@ -1587,11 +1463,11 @@ if (value.destroy) { value.destroy(); } }); - container.cache.dict = _emberMetalDictionary["default"](null); + container.cache.dict = _emberMetalDictionary.default(null); } function resetMember(container, fullName) { var member = container.cache[fullName]; @@ -1604,23 +1480,21 @@ member.destroy(); } } } - exports["default"] = Container; + exports.default = Container; }); // Ember.assert -enifed('container/registry', ['exports', 'ember-metal/core', 'ember-metal/dictionary', 'ember-metal/keys', 'ember-metal/merge', './container'], function (exports, _emberMetalCore, _emberMetalDictionary, _emberMetalKeys, _emberMetalMerge, _container) { - 'use strict'; +enifed('container/registry', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/dictionary', 'ember-metal/merge', './container'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalDictionary, _emberMetalMerge, _container) { var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/; var instanceInitializersFeatureEnabled; - - instanceInitializersFeatureEnabled = true; - + instanceInitializersFeatureEnabled = true; + /** A registry used to store factory and option information keyed by type. A `Registry` stores the factory and option information needed by a @@ -1636,23 +1510,23 @@ function Registry(options) { this.fallback = options && options.fallback ? options.fallback : null; this.resolver = options && options.resolver ? options.resolver : function () {}; - this.registrations = _emberMetalDictionary["default"](options && options.registrations ? options.registrations : null); + this.registrations = _emberMetalDictionary.default(options && options.registrations ? options.registrations : null); - this._typeInjections = _emberMetalDictionary["default"](null); - this._injections = _emberMetalDictionary["default"](null); - this._factoryTypeInjections = _emberMetalDictionary["default"](null); - this._factoryInjections = _emberMetalDictionary["default"](null); + this._typeInjections = _emberMetalDictionary.default(null); + this._injections = _emberMetalDictionary.default(null); + this._factoryTypeInjections = _emberMetalDictionary.default(null); + this._factoryInjections = _emberMetalDictionary.default(null); - this._normalizeCache = _emberMetalDictionary["default"](null); - this._resolveCache = _emberMetalDictionary["default"](null); - this._failCache = _emberMetalDictionary["default"](null); + this._normalizeCache = _emberMetalDictionary.default(null); + this._resolveCache = _emberMetalDictionary.default(null); + this._failCache = _emberMetalDictionary.default(null); - this._options = _emberMetalDictionary["default"](null); - this._typeOptions = _emberMetalDictionary["default"](null); + this._options = _emberMetalDictionary.default(null); + this._typeOptions = _emberMetalDictionary.default(null); } Registry.prototype = { /** A backup registry for resolving registrations when no matches can be found. @@ -1748,11 +1622,11 @@ @method container @param {Object} options @return {Container} created container */ container: function (options) { - var container = new _container["default"](this, options); + var container = new _container.default(this, options); // 2.0TODO - remove `registerContainer` this.registerContainer(container); return container; @@ -2201,12 +2075,12 @@ */ knownForType: function (type) { var fallbackKnown = undefined, resolverKnown = undefined; - var localKnown = _emberMetalDictionary["default"](null); - var registeredNames = _emberMetalKeys["default"](this.registrations); + var localKnown = _emberMetalDictionary.default(null); + var registeredNames = Object.keys(this.registrations); for (var index = 0, _length = registeredNames.length; index < _length; index++) { var fullName = registeredNames[index]; var itemType = fullName.split(':')[0]; if (itemType === type) { @@ -2319,16 +2193,14 @@ function has(registry, fullName) { return registry.resolve(fullName) !== undefined; } - exports["default"] = Registry; + exports.default = Registry; }); // Ember.assert enifed("dag-map", ["exports"], function (exports) { - "use strict"; - function visit(vertex, fn, visited, path) { var name = vertex.name; var vertices = vertex.incoming; var names = vertex.incomingNames; var len = names.length; @@ -2483,77 +2355,75 @@ */ DAG.prototype.addEdges = function (name, value, before, after) { var i; this.map(name, value); if (before) { - if (typeof before === 'string') { + if (typeof before === "string") { this.addEdge(name, before); } else { for (i = 0; i < before.length; i++) { this.addEdge(name, before[i]); } } } if (after) { - if (typeof after === 'string') { + if (typeof after === "string") { this.addEdge(after, name); } else { for (i = 0; i < after.length; i++) { this.addEdge(after[i], name); } } } }; - exports["default"] = DAG; + exports.default = DAG; }); enifed('dag-map.umd', ['exports', './dag-map'], function (exports, _dagMap) { - 'use strict'; /* global define:true module:true window: true */ if (typeof enifed === 'function' && enifed.amd) { enifed(function () { - return _dagMap["default"]; + return _dagMap.default; }); } else if (typeof module !== 'undefined' && module.exports) { - module.exports = _dagMap["default"]; - } else if (typeof undefined !== 'undefined') { - undefined['DAG'] = _dagMap["default"]; + module.exports = _dagMap.default; + } else if (typeof this !== 'undefined') { + this['DAG'] = _dagMap.default; } }); enifed("dom-helper", ["exports", "./htmlbars-runtime/morph", "./morph-attr", "./dom-helper/build-html-dom", "./dom-helper/classes", "./dom-helper/prop"], function (exports, _htmlbarsRuntimeMorph, _morphAttr, _domHelperBuildHtmlDom, _domHelperClasses, _domHelperProp) { - "use strict"; - var doc = typeof document === 'undefined' ? false : document; + var doc = typeof document === "undefined" ? false : document; var deletesBlankTextNodes = doc && (function (document) { - var element = document.createElement('div'); - element.appendChild(document.createTextNode('')); + var element = document.createElement("div"); + element.appendChild(document.createTextNode("")); var clonedElement = element.cloneNode(true); return clonedElement.childNodes.length === 0; })(doc); var ignoresCheckedAttribute = doc && (function (document) { - var element = document.createElement('input'); - element.setAttribute('checked', 'checked'); + var element = document.createElement("input"); + element.setAttribute("checked", "checked"); var clonedElement = element.cloneNode(false); return !clonedElement.checked; })(doc); var canRemoveSvgViewBoxAttribute = doc && (doc.createElementNS ? (function (document) { - var element = document.createElementNS(_domHelperBuildHtmlDom.svgNamespace, 'svg'); - element.setAttribute('viewBox', '0 0 100 100'); - element.removeAttribute('viewBox'); - return !element.getAttribute('viewBox'); + var element = document.createElementNS(_domHelperBuildHtmlDom.svgNamespace, "svg"); + element.setAttribute("viewBox", "0 0 100 100"); + element.removeAttribute("viewBox"); + return !element.getAttribute("viewBox"); })(doc) : true); var canClone = doc && (function (document) { - var element = document.createElement('div'); - element.appendChild(document.createTextNode(' ')); - element.appendChild(document.createTextNode(' ')); + var element = document.createElement("div"); + element.appendChild(document.createTextNode(" ")); + element.appendChild(document.createTextNode(" ")); var clonedElement = element.cloneNode(true); - return clonedElement.childNodes[0].nodeValue === ' '; + return clonedElement.childNodes[0].nodeValue === " "; })(doc); // This is not the namespace of the element, but of // the elements inside that elements. function interiorNamespace(element) { @@ -2590,24 +2460,24 @@ // var omittedStartTagChildTest = /<([\w:]+)/; function detectOmittedStartTag(string, contextualElement) { // Omitted start tags are only inside table tags. - if (contextualElement.tagName === 'TABLE') { + if (contextualElement.tagName === "TABLE") { var omittedStartTagChildMatch = omittedStartTagChildTest.exec(string); if (omittedStartTagChildMatch) { var omittedStartTagChild = omittedStartTagChildMatch[1]; // It is already asserted that the contextual element is a table // and not the proper start tag. Just see if a tag was omitted. - return omittedStartTagChild === 'tr' || omittedStartTagChild === 'col'; + return omittedStartTagChild === "tr" || omittedStartTagChild === "col"; } } } function buildSVGDOM(html, dom) { - var div = dom.document.createElement('div'); - div.innerHTML = '<svg>' + html + '</svg>'; + var div = dom.document.createElement("div"); + div.innerHTML = "<svg>" + html + "</svg>"; return div.firstChild.childNodes; } var guid = 1; @@ -2758,11 +2628,11 @@ prototype.removeAttribute = function (element, name) { element.removeAttribute(name); }; } else { prototype.removeAttribute = function (element, name) { - if (element.tagName === 'svg' && name === 'viewBox') { + if (element.tagName === "svg" && name === "viewBox") { element.setAttribute(name, null); } else { element.removeAttribute(name); } }; @@ -2771,12 +2641,12 @@ prototype.setPropertyStrict = function (element, name, value) { if (value === undefined) { value = null; } - if (value === null && (name === 'value' || name === 'type' || name === 'src')) { - value = ''; + if (value === null && (name === "value" || name === "type" || name === "src")) { + value = ""; } element[name] = value; }; @@ -2784,11 +2654,11 @@ return element[name]; }; prototype.setProperty = function (element, name, value, namespace) { var lowercaseName = name.toLowerCase(); - if (element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace || lowercaseName === 'style') { + if (element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace || lowercaseName === "style") { if (_domHelperProp.isAttrRemovalValue(value)) { element.removeAttribute(name); } else { if (namespace) { element.setAttributeNS(namespace, name, value); @@ -2800,11 +2670,11 @@ var _normalizeProperty = _domHelperProp.normalizeProperty(element, name); var normalized = _normalizeProperty.normalized; var type = _normalizeProperty.type; - if (type === 'prop') { + if (type === "prop") { element[normalized] = value; } else { if (_domHelperProp.isAttrRemovalValue(value)) { element.removeAttribute(name); } else { @@ -2822,11 +2692,11 @@ // Only opt into namespace detection if a contextualElement // is passed. prototype.createElement = function (tagName, contextualElement) { var namespace = this.namespace; if (contextualElement) { - if (tagName === 'svg') { + if (tagName === "svg") { namespace = _domHelperBuildHtmlDom.svgNamespace; } else { namespace = interiorNamespace(contextualElement); } } @@ -2872,31 +2742,31 @@ }; prototype.repairClonedNode = function (element, blankChildTextNodes, isChecked) { if (deletesBlankTextNodes && blankChildTextNodes.length > 0) { for (var i = 0, len = blankChildTextNodes.length; i < len; i++) { - var textNode = this.document.createTextNode(''), + var textNode = this.document.createTextNode(""), offset = blankChildTextNodes[i], before = this.childAtIndex(element, offset); if (before) { element.insertBefore(textNode, before); } else { element.appendChild(textNode); } } } if (ignoresCheckedAttribute && isChecked) { - element.setAttribute('checked', 'checked'); + element.setAttribute("checked", "checked"); } }; prototype.cloneNode = function (element, deep) { var clone = element.cloneNode(!!deep); return clone; }; - prototype.AttrMorphClass = _morphAttr["default"]; + prototype.AttrMorphClass = _morphAttr.default; prototype.createAttrMorph = function (element, attrName, namespace) { return new this.AttrMorphClass(element, attrName, this, namespace); }; @@ -2910,11 +2780,11 @@ var morph = this.createAttrMorph(element, attrName, namespace); morph.escaped = false; return morph; }; - prototype.MorphClass = _htmlbarsRuntimeMorph["default"]; + prototype.MorphClass = _htmlbarsRuntimeMorph.default; prototype.createMorph = function (parent, start, end, contextualElement) { if (contextualElement && contextualElement.nodeType === 11) { throw new Error("Cannot pass a fragment as the contextual element to createMorph"); } @@ -2932,22 +2802,22 @@ if (contextualElement && contextualElement.nodeType === 11) { throw new Error("Cannot pass a fragment as the contextual element to createMorph"); } var fragment = this.createDocumentFragment(); - return _htmlbarsRuntimeMorph["default"].create(this, contextualElement, fragment); + return _htmlbarsRuntimeMorph.default.create(this, contextualElement, fragment); }; prototype.replaceContentWithMorph = function (element) { var firstChild = element.firstChild; if (!firstChild) { - var comment = this.createComment(''); + var comment = this.createComment(""); this.appendChild(element, comment); - return _htmlbarsRuntimeMorph["default"].create(this, element, comment); + return _htmlbarsRuntimeMorph.default.create(this, element, comment); } else { - var morph = _htmlbarsRuntimeMorph["default"].attach(this, element, firstChild, element.lastChild); + var morph = _htmlbarsRuntimeMorph.default.attach(this, element, firstChild, element.lastChild); morph.clear(); return morph; } }; @@ -2971,25 +2841,25 @@ morph.parseTextAsHTML = true; return morph; }; prototype.insertMorphBefore = function (element, referenceChild, contextualElement) { - var insertion = this.document.createComment(''); + var insertion = this.document.createComment(""); element.insertBefore(insertion, referenceChild); return this.createMorph(element, insertion, insertion, contextualElement); }; prototype.appendMorph = function (element, contextualElement) { - var insertion = this.document.createComment(''); + var insertion = this.document.createComment(""); element.appendChild(insertion); return this.createMorph(element, insertion, insertion, contextualElement); }; prototype.insertBoundary = function (fragment, index) { // this will always be null or firstChild var child = index === null ? null : this.childAtIndex(fragment, index); - this.insertBefore(fragment, this.createTextNode(''), child); + this.insertBefore(fragment, this.createTextNode(""), child); }; prototype.setMorphHTML = function (morph, html) { morph.setHTML(html); }; @@ -3018,11 +2888,11 @@ if (childNodes && childNodes.length > 0) { var currentNode = childNodes[0]; // We prepend an <option> to <select> boxes to absorb any browser bugs // related to auto-select behavior. Skip past it. - if (contextualElement.tagName === 'SELECT') { + if (contextualElement.tagName === "SELECT") { currentNode = currentNode.nextSibling; } while (currentNode) { var tempNode = currentNode; @@ -3038,23 +2908,21 @@ var parsingNode; // Used to determine whether a URL needs to be sanitized. prototype.protocolForURL = function (url) { if (!parsingNode) { - parsingNode = this.document.createElement('a'); + parsingNode = this.document.createElement("a"); } parsingNode.href = url; return parsingNode.protocol; }; - exports["default"] = DOMHelper; + exports.default = DOMHelper; }); enifed('dom-helper/build-html-dom', ['exports'], function (exports) { /* global XMLSerializer:false */ - 'use strict'; - var svgHTMLIntegrationPoints = { foreignObject: 1, desc: 1, title: 1 }; exports.svgHTMLIntegrationPoints = svgHTMLIntegrationPoints; var svgNamespace = 'http://www.w3.org/2000/svg'; exports.svgNamespace = svgNamespace; @@ -3066,30 +2934,30 @@ if (document.createElementNS === undefined) { return; } // In FF title will not accept innerHTML. var testEl = document.createElementNS(svgNamespace, 'title'); - testEl.innerHTML = "<div></div>"; + testEl.innerHTML = '<div></div>'; return testEl.childNodes.length === 0 || testEl.childNodes[0].nodeType !== 1; })(doc); // Internet Explorer prior to 9 does not allow setting innerHTML if the first element // is a "zero-scope" element. This problem can be worked around by making // the first node an invisible text node. We, like Modernizr, use &shy; var needsShy = doc && (function (document) { var testEl = document.createElement('div'); - testEl.innerHTML = "<div></div>"; - testEl.firstChild.innerHTML = "<script><\/script>"; + testEl.innerHTML = '<div></div>'; + testEl.firstChild.innerHTML = '<script></script>'; return testEl.firstChild.innerHTML === ''; })(doc); // IE 8 (and likely earlier) likes to move whitespace preceeding // a script tag to appear after it. This means that we can // accidentally remove whitespace when updating a morph. var movesWhitespace = doc && (function (document) { var testEl = document.createElement('div'); - testEl.innerHTML = "Test: <script type='text/x-placeholder'><\/script>Value"; + testEl.innerHTML = 'Test: <script type=\'text/x-placeholder\'></script>Value'; return testEl.childNodes[0].nodeValue === 'Test:' && testEl.childNodes[2].nodeValue === ' Value'; })(doc); var tagNamesRequiringInnerHTMLFix = doc && (function (document) { var tagNamesRequiringInnerHTMLFix; @@ -3141,11 +3009,11 @@ var shyElement = nodes[0]; while (shyElement.nodeType === 1 && !shyElement.nodeName) { shyElement = shyElement.firstChild; } // At this point it's the actual unicode character. - if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === "\u00AD") { + if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === '­') { var newValue = shyElement.nodeValue.slice(1); if (newValue.length) { shyElement.nodeValue = shyElement.nodeValue.slice(1); } else { shyElement.parentNode.removeChild(shyElement); @@ -3159,18 +3027,18 @@ var tagName = contextualElement.tagName; // Firefox versions < 11 do not have support for element.outerHTML. var outerHTML = contextualElement.outerHTML || new XMLSerializer().serializeToString(contextualElement); if (!outerHTML) { - throw "Can't set innerHTML on " + tagName + " in this browser"; + throw 'Can\'t set innerHTML on ' + tagName + ' in this browser'; } html = fixSelect(html, contextualElement); var wrappingTags = tagNamesRequiringInnerHTMLFix[tagName.toLowerCase()]; - var startTag = outerHTML.match(new RegExp("<" + tagName + "([^>]*)>", 'i'))[0]; + var startTag = outerHTML.match(new RegExp('<' + tagName + '([^>]*)>', 'i'))[0]; var endTag = '</' + tagName + '>'; var wrappedHTML = [startTag, html, endTag]; var i = wrappingTags.length; @@ -3214,11 +3082,11 @@ }; } function fixSelect(html, contextualElement) { if (contextualElement.tagName === 'SELECT') { - html = "<option></option>" + html; + html = '<option></option>' + html; } return html; } @@ -3306,12 +3174,10 @@ } exports.buildHTMLDOM = buildHTMLDOM; }); enifed('dom-helper/classes', ['exports'], function (exports) { - 'use strict'; - var doc = typeof document === 'undefined' ? false : document; // PhantomJS has a broken classList. See https://github.com/ariya/phantomjs/issues/12782 var canClassList = doc && (function () { var d = document.createElement('div'); @@ -3423,12 +3289,10 @@ exports.addClasses = addClasses; exports.removeClasses = removeClasses; }); enifed('dom-helper/prop', ['exports'], function (exports) { - 'use strict'; - exports.isAttrRemovalValue = isAttrRemovalValue; exports.normalizeProperty = normalizeProperty; function isAttrRemovalValue(value) { return value === null || value === undefined; @@ -3503,60 +3367,50 @@ var tag = ATTR_OVERRIDES[tagName.toUpperCase()]; return tag && tag[propName.toLowerCase()] || false; } }); enifed('ember-application', ['exports', 'ember-metal/core', 'ember-runtime/system/lazy_load', 'ember-application/system/resolver', 'ember-application/system/application', 'ember-application/ext/controller'], function (exports, _emberMetalCore, _emberRuntimeSystemLazy_load, _emberApplicationSystemResolver, _emberApplicationSystemApplication, _emberApplicationExtController) { - 'use strict'; - // side effect of extending ControllerMixin - _emberMetalCore["default"].Application = _emberApplicationSystemApplication["default"]; - _emberMetalCore["default"].Resolver = _emberApplicationSystemResolver.Resolver; - _emberMetalCore["default"].DefaultResolver = _emberApplicationSystemResolver["default"]; + _emberMetalCore.default.Application = _emberApplicationSystemApplication.default; + _emberMetalCore.default.Resolver = _emberApplicationSystemResolver.Resolver; + _emberMetalCore.default.DefaultResolver = _emberApplicationSystemResolver.default; - _emberRuntimeSystemLazy_load.runLoadHooks('Ember.Application', _emberApplicationSystemApplication["default"]); + _emberRuntimeSystemLazy_load.runLoadHooks('Ember.Application', _emberApplicationSystemApplication.default); }); /** @module ember @submodule ember-application */ -enifed("ember-application/ext/controller", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/error", "ember-metal/utils", "ember-metal/computed", "ember-runtime/mixins/controller", "ember-routing/system/controller_for"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalError, _emberMetalUtils, _emberMetalComputed, _emberRuntimeMixinsController, _emberRoutingSystemController_for) { - /** - @module ember - @submodule ember-application - @public - */ +enifed('ember-application/ext/controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/utils', 'ember-metal/computed', 'ember-runtime/mixins/controller', 'ember-routing/system/controller_for'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalError, _emberMetalUtils, _emberMetalComputed, _emberRuntimeMixinsController, _emberRoutingSystemController_for) { - "use strict"; - function verifyNeedsDependencies(controller, container, needs) { var dependency, i, l; var missing = []; for (i = 0, l = needs.length; i < l; i++) { dependency = needs[i]; if (dependency.indexOf(':') === -1) { - dependency = "controller:" + dependency; + dependency = 'controller:' + dependency; } // Structure assert to still do verification but not string concat in production if (!container._registry.has(dependency)) { missing.push(dependency); } } if (missing.length) { - throw new _emberMetalError["default"](_emberMetalUtils.inspect(controller) + " needs [ " + missing.join(', ') + " ] but " + (missing.length > 1 ? 'they' : 'it') + " could not be found"); + throw new _emberMetalError.default(_emberMetalUtils.inspect(controller) + ' needs [ ' + missing.join(', ') + ' ] but ' + (missing.length > 1 ? 'they' : 'it') + ' could not be found'); } } var defaultControllersComputedProperty = _emberMetalComputed.computed(function () { var controller = this; - return { needs: _emberMetalProperty_get.get(controller, 'needs'), container: _emberMetalProperty_get.get(controller, 'container'), unknownProperty: function (controllerName) { var needs = this.needs; @@ -3571,21 +3425,21 @@ var errorMessage = _emberMetalUtils.inspect(controller) + '#needs does not include `' + controllerName + '`. To access the ' + controllerName + ' controller from ' + _emberMetalUtils.inspect(controller) + ', ' + _emberMetalUtils.inspect(controller) + ' should have a `needs` property that is an array of the controllers it has access to.'; throw new ReferenceError(errorMessage); }, setUnknownProperty: function (key, value) { - throw new Error("You cannot overwrite the value of `controllers." + key + "` of " + _emberMetalUtils.inspect(controller)); + throw new Error('You cannot overwrite the value of `controllers.' + key + '` of ' + _emberMetalUtils.inspect(controller)); } }; }); /** @class ControllerMixin @namespace Ember @public */ - _emberRuntimeMixinsController["default"].reopen({ + _emberRuntimeMixinsController.default.reopen({ concatenatedProperties: ['needs'], /** An array of other controller objects available inside instances of this controller via the `controllers` @@ -3600,18 +3454,18 @@ controllers are accessible by name through the `controllers` property: ```javascript this.get('controllers.post'); // instance of App.PostController ``` - Given that you have a nested controller (nested resource): + Given that you have a nested controller (nested routes): ```javascript - App.CommentsNewController = Ember.ObjectController.extend({ + App.CommentsNewController = Ember.Controller.extend({ }); ``` When you define a controller that requires access to a nested one: ```javascript - App.IndexController = Ember.ObjectController.extend({ + App.IndexController = Ember.Controller.extend({ needs: ['commentsNew'] }); ``` You will be able to get access to it: ```javascript @@ -3643,15 +3497,15 @@ }, /** @method controllerFor @see {Ember.Route#controllerFor} - @deprecated Use `Ember.inject.controller()` instead. + @deprecated Use `needs` instead @public */ controllerFor: function (controllerName) { - return _emberRoutingSystemController_for["default"](_emberMetalProperty_get.get(this, 'container'), controllerName); + return _emberRoutingSystemController_for.default(_emberMetalProperty_get.get(this, 'container'), controllerName); }, /** Stores the instances of other controllers available from within this controller. Any controller listed by name in the `needs` @@ -3664,30 +3518,28 @@ return currentPost.get('title'); }.property('controllers.post.title') }); ``` @see {Ember.ControllerMixin#needs} - @deprecated Use `Ember.inject.controller()` instead. @property {Object} controllers @default null @public */ controllers: defaultControllersComputedProperty }); - exports["default"] = _emberRuntimeMixinsController["default"]; + exports.default = _emberRuntimeMixinsController.default; }); +/** +@module ember +@submodule ember-application +@public +*/ + // Ember.assert -enifed("ember-application/system/application-instance", ["exports", "ember-metal/property_get", "ember-metal/property_set", "ember-runtime/system/object", "ember-metal/run_loop", "ember-metal/computed", "container/registry"], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemObject, _emberMetalRun_loop, _emberMetalComputed, _containerRegistry) { - /** - @module ember - @submodule ember-application - @private - */ +enifed('ember-application/system/application-instance', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/object', 'ember-metal/run_loop', 'ember-metal/computed', 'container/registry'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemObject, _emberMetalRun_loop, _emberMetalComputed, _containerRegistry) { - "use strict"; - /** The `ApplicationInstance` encapsulates all of the stateful aspects of a running `Application`. At a high-level, we break application boot into two distinct phases: @@ -3707,11 +3559,11 @@ it once the particular test run or FastBoot request has finished. @public */ - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ /** The application instance's container. The container stores all of the instance-specific state for this application run. @property {Ember.Container} container @public @@ -3757,11 +3609,11 @@ init: function () { this._super.apply(this, arguments); // Create a per-instance registry that will use the application's registry // as a fallback for resolving registrations. - this.registry = new _containerRegistry["default"]({ + this.registry = new _containerRegistry.default({ fallback: this.applicationRegistry, resolver: this.applicationRegistry.resolver }); this.registry.normalizeFullName = this.applicationRegistry.normalizeFullName; this.registry.makeToString = this.applicationRegistry.makeToString; @@ -3863,32 +3715,30 @@ /** @private */ setupEventDispatcher: function () { var dispatcher = this.container.lookup('event_dispatcher:main'); - var applicationCustomEvents = _emberMetalProperty_get.get(this.application, 'customEvents'); + dispatcher.setup(this.customEvents, this.rootElement); - dispatcher.setup(applicationCustomEvents, this.rootElement); - return dispatcher; }, /** @private */ willDestroy: function () { this._super.apply(this, arguments); - _emberMetalRun_loop["default"](this.container, 'destroy'); + _emberMetalRun_loop.default(this.container, 'destroy'); } }); }); -enifed('ember-application/system/application', ['exports', 'dag-map', 'container/registry', 'ember-metal', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/lazy_load', 'ember-runtime/system/namespace', 'ember-runtime/mixins/deferred', 'ember-application/system/resolver', 'ember-metal/platform/create', 'ember-metal/run_loop', 'ember-metal/utils', 'ember-runtime/controllers/controller', 'ember-metal/enumerable_utils', 'ember-runtime/controllers/object_controller', 'ember-runtime/controllers/array_controller', 'ember-metal-views/renderer', 'ember-htmlbars/system/dom-helper', 'ember-views/views/select', 'ember-routing-views/views/outlet', 'ember-views/views/view', 'ember-views/system/event_dispatcher', '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-routing/system/cache', 'ember-application/system/application-instance', 'ember-views/views/text_field', 'ember-views/views/text_area', 'ember-views/views/checkbox', 'ember-views/views/legacy_each_view', 'ember-routing-views/views/link', 'ember-routing/services/routing', 'ember-extension-support/container_debug_adapter', 'ember-metal/environment'], function (exports, _dagMap, _containerRegistry, _emberMetal, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemLazy_load, _emberRuntimeSystemNamespace, _emberRuntimeMixinsDeferred, _emberApplicationSystemResolver, _emberMetalPlatformCreate, _emberMetalRun_loop, _emberMetalUtils, _emberRuntimeControllersController, _emberMetalEnumerable_utils, _emberRuntimeControllersObject_controller, _emberRuntimeControllersArray_controller, _emberMetalViewsRenderer, _emberHtmlbarsSystemDomHelper, _emberViewsViewsSelect, _emberRoutingViewsViewsOutlet, _emberViewsViewsView, _emberViewsSystemEvent_dispatcher, _emberViewsSystemJquery, _emberRoutingSystemRoute, _emberRoutingSystemRouter, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingLocationNone_location, _emberRoutingSystemCache, _emberApplicationSystemApplicationInstance, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsCheckbox, _emberViewsViewsLegacy_each_view, _emberRoutingViewsViewsLink, _emberRoutingServicesRouting, _emberExtensionSupportContainer_debug_adapter, _emberMetalEnvironment) { - /** - @module ember - @submodule ember-application - */ - 'use strict'; +/** +@module ember +@submodule ember-application +@private +*/ +enifed('ember-application/system/application', ['exports', 'dag-map', 'container/registry', 'ember-metal', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/lazy_load', 'ember-runtime/system/namespace', 'ember-application/system/resolver', 'ember-metal/run_loop', 'ember-metal/utils', 'ember-runtime/controllers/controller', 'ember-runtime/controllers/array_controller', 'ember-metal-views/renderer', 'ember-htmlbars/system/dom-helper', 'ember-views/views/select', 'ember-routing-views/views/outlet', 'ember-views/views/view', 'ember-views/system/event_dispatcher', '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-routing/system/cache', 'ember-application/system/application-instance', 'ember-views/views/text_field', 'ember-views/views/text_area', 'ember-views/views/checkbox', 'ember-views/views/legacy_each_view', 'ember-routing-views/views/link', 'ember-routing/services/routing', 'ember-extension-support/container_debug_adapter', 'ember-metal/environment'], function (exports, _dagMap, _containerRegistry, _emberMetal, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemLazy_load, _emberRuntimeSystemNamespace, _emberApplicationSystemResolver, _emberMetalRun_loop, _emberMetalUtils, _emberRuntimeControllersController, _emberRuntimeControllersArray_controller, _emberMetalViewsRenderer, _emberHtmlbarsSystemDomHelper, _emberViewsViewsSelect, _emberRoutingViewsViewsOutlet, _emberViewsViewsView, _emberViewsSystemEvent_dispatcher, _emberViewsSystemJquery, _emberRoutingSystemRoute, _emberRoutingSystemRouter, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingLocationNone_location, _emberRoutingSystemCache, _emberApplicationSystemApplicationInstance, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsCheckbox, _emberViewsViewsLegacy_each_view, _emberRoutingViewsViewsLink, _emberRoutingServicesRouting, _emberExtensionSupportContainer_debug_adapter, _emberMetalEnvironment) { function props(obj) { var properties = []; for (var key in obj) { @@ -4040,11 +3890,11 @@ @namespace Ember @extends Ember.Namespace @public */ - var Application = _emberRuntimeSystemNamespace["default"].extend(_emberRuntimeMixinsDeferred["default"], { + var Application = _emberRuntimeSystemNamespace.default.extend({ _suppressDeferredDeprecation: true, /** The root DOM element of the Application. This can be specified as an element or a @@ -4113,11 +3963,11 @@ init: function () { this._super.apply(this, arguments); if (!this.$) { - this.$ = _emberViewsSystemJquery["default"]; + this.$ = _emberViewsSystemJquery.default; } this.buildRegistry(); registerLibraries(); @@ -4125,15 +3975,13 @@ // Start off the number of deferrals at 1. This will be // decremented by the Application's own `initialize` method. this._readinessDeferrals = 1; - - this.Router = (this.Router || _emberRoutingSystemRouter["default"]).extend(); - this.buildDefaultInstance(); - this.waitForDOMReady(); - + this.Router = (this.Router || _emberRoutingSystemRouter.default).extend(); + this.buildDefaultInstance(); + this.waitForDOMReady(); }, /** Build and configure the registry for the current application. @private @@ -4151,23 +3999,23 @@ @private @method buildInstance @return {Ember.Container} the configured container */ buildInstance: function () { - return _emberApplicationSystemApplicationInstance["default"].create({ - application: this, + return _emberApplicationSystemApplicationInstance.default.create({ + customEvents: _emberMetalProperty_get.get(this, 'customEvents'), rootElement: _emberMetalProperty_get.get(this, 'rootElement'), applicationRegistry: this.registry }); }, buildDefaultInstance: function () { var instance = this.buildInstance(); // For the default instance only, set the view registry to the global // Ember.View.views hash for backwards-compatibility. - _emberViewsViewsView["default"].views = instance.container.lookup('-view-registry:main'); + _emberViewsViewsView.default.views = instance.container.lookup('-view-registry:main'); // TODO2.0: Legacy support for App.__container__ // and global methods on App that rely on a single, // default instance. this.__deprecatedInstance__ = instance; @@ -4189,13 +4037,13 @@ @private @method waitForDOMReady */ waitForDOMReady: function () { if (!this.$ || this.$.isReady) { - _emberMetalRun_loop["default"].schedule('actions', this, 'domReady'); + _emberMetalRun_loop.default.schedule('actions', this, 'domReady'); } else { - this.$().ready(_emberMetalRun_loop["default"].bind(this, 'domReady')); + this.$().ready(_emberMetalRun_loop.default.bind(this, 'domReady')); } }, /** Use this to defer readiness until some condition is true. @@ -4230,11 +4078,11 @@ */ advanceReadiness: function () { this._readinessDeferrals--; if (this._readinessDeferrals === 0) { - _emberMetalRun_loop["default"].once(this, this.didBecomeReady); + _emberMetalRun_loop.default.once(this, this.didBecomeReady); } }, /** Registers a factory that can be used for dependency injection (with @@ -4364,11 +4212,11 @@ boot: function () { if (this._bootPromise) { return this._bootPromise; } - var defer = new _emberMetal["default"].RSVP.defer(); + var defer = new _emberMetal.default.RSVP.defer(); this._bootPromise = defer.promise; this._bootResolver = defer; this.runInitializers(this.registry); _emberRuntimeSystemLazy_load.runLoadHooks('application', this); @@ -4437,29 +4285,28 @@ this._readinessDeferrals = 1; this._bootPromise = null; this._bootResolver = null; function handleReset() { - _emberMetalRun_loop["default"](instance, 'destroy'); + _emberMetalRun_loop.default(instance, 'destroy'); - _emberMetalRun_loop["default"].schedule('actions', this, 'domReady', this.buildDefaultInstance()); + _emberMetalRun_loop.default.schedule('actions', this, 'domReady', this.buildDefaultInstance()); } - _emberMetalRun_loop["default"].join(this, handleReset); + _emberMetalRun_loop.default.join(this, handleReset); }, /** @private @method runInitializers */ runInitializers: function (registry) { var App = this; this._runInitializer('initializers', function (name, initializer) { - - initializer.initialize(registry, App); - }); + initializer.initialize(registry, App); + }); }, runInstanceInitializers: function (instance) { this._runInitializer('instanceInitializers', function (name, initializer) { initializer.initialize(instance); @@ -4467,11 +4314,11 @@ }, _runInitializer: function (bucketName, cb) { var initializersByName = _emberMetalProperty_get.get(this.constructor, bucketName); var initializers = props(initializersByName); - var graph = new _dagMap["default"](); + var graph = new _dagMap.default(); var initializer; for (var i = 0; i < initializers.length; i++) { initializer = initializersByName[initializers[i]]; graph.addEdges(initializer.name, initializer, initializer.before, initializer.after); @@ -4486,25 +4333,23 @@ @private @method didBecomeReady */ didBecomeReady: function () { if (this.autoboot) { - if (_emberMetalEnvironment["default"].hasDOM) { + if (_emberMetalEnvironment.default.hasDOM) { this.__deprecatedInstance__.setupEventDispatcher(); } this.runInstanceInitializers(this.__deprecatedInstance__); this.ready(); // user hook this.__deprecatedInstance__.startRouting(); - if (!_emberMetal["default"].testing) { + if (!_emberMetal.default.testing) { // Eagerly name all classes that are already loaded - _emberMetal["default"].Namespace.processAll(); - _emberMetal["default"].BOOTED = true; + _emberMetal.default.Namespace.processAll(); + _emberMetal.default.BOOTED = true; } - - this.resolve(this); } this._bootResolver.resolve(); }, @@ -4534,18 +4379,14 @@ Resolver: null, // This method must be moved to the application instance object willDestroy: function () { this._super.apply(this, arguments); - _emberMetal["default"].BOOTED = false; + _emberMetal.default.BOOTED = false; this._bootPromise = null; this._bootResolver = null; - if (_emberRuntimeSystemLazy_load._loaded.application === this) { - _emberRuntimeSystemLazy_load._loaded.application = undefined; - } - if (this.__deprecatedInstance__) { this.__deprecatedInstance__.destroy(); } }, @@ -4562,35 +4403,26 @@ this._super.apply(this, arguments); } }); - - Application.reopen({ - instanceInitializer: function (options) { - this.constructor.instanceInitializer(options); - } - }); + Application.reopen({ + instanceInitializer: function (options) { + this.constructor.instanceInitializer(options); + } + }); - Application.reopenClass({ - instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer') - }); - + Application.reopenClass({ + instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer') + }); - Application.reopenClass({ - initializers: _emberMetalPlatformCreate["default"](null), - instanceInitializers: _emberMetalPlatformCreate["default"](null), + initializers: Object.create(null), + instanceInitializers: Object.create(null), /** - The goal of initializers should be to register dependencies and injections. - This phase runs once. Because these initializers may load code, they are - allowed to defer application readiness and advance it. If you need to access - the container or store you should use an InstanceInitializer that will be run - after all initializers and therefore after all code is loaded and the app is - ready. - Initializer receives an object which has the following attributes: + Initializer receives an object which has the following attributes: `name`, `before`, `after`, `initialize`. The only required attribute is `initialize`, all others are optional. * `name` allows you to specify under which name the initializer is registered. This must be a unique name, as trying to register two initializers with the same name will result in an error. @@ -4661,11 +4493,10 @@ and `application` on which you can operate. Example of using `container` to preload data into the store: ```javascript Ember.Application.initializer({ name: 'preload-data', - after: 'ember-data', // ember-data must be loaded before we can access store initialize: function(container, application) { var store = container.lookup('store:main'); store.pushPayload(preloadedData); } }); @@ -4680,66 +4511,11 @@ }); ``` @method initializer @param initializer {Object} @public - */ - - /** - InstanceInitializers run after all initializers have run. Because - instanceInitializers run after the app is fully set up. We have access - to the store, container, and other items. However, these initializers run - after code has loaded and are not allowed to defer readiness. - InstanceInitializer receives an object which has the following attributes: - `name`, `before`, `after`, `initialize`. The only required attribute is - `initialize`, all others are optional. - * `name` allows you to specify under which name the instanceInitializer is - registered. This must be a unique name, as trying to register two - instanceInitializer with the same name will result in an error. - ```javascript - Ember.Application.instanceInitializer({ - name: 'namedinstanceInitializer', - initialize: function(application) { - Ember.debug('Running namedInitializer!'); - } - }); - ``` - * `before` and `after` are used to ensure that this initializer is ran prior - or after the one identified by the value. This value can be a single string - or an array of strings, referencing the `name` of other initializers. - * See Ember.Application.initializer for discussion on the usage of before - and after. - Example instanceInitializer to preload data into the store. - ```javascript - Ember.Application.initializer({ - name: 'preload-data', - initialize: function(application) { - var userConfig, userConfigEncoded, store; - // We have a HTML escaped JSON representation of the user's basic - // configuration generated server side and stored in the DOM of the main - // index.html file. This allows the app to have access to a set of data - // without making any additional remote calls. Good for basic data that is - // needed for immediate rendering of the page. Keep in mind, this data, - // like all local models and data can be manipulated by the user, so it - // should not be relied upon for security or authorization. - // - // Grab the encoded data from the meta tag - userConfigEncoded = Ember.$('head meta[name=app-user-config]').attr('content'); - // Unescape the text, then parse the resulting JSON into a real object - userConfig = JSON.parse(unescape(userConfigEncoded)); - // Lookup the store - store = application.container.lookup('service:store'); - // Push the encoded JSON into the store - store.pushPayload(userConfig); - } - }); - ``` - @method instanceInitializer - @param instanceInitializer - @public - */ - + */ initializer: buildInitializerMethod('initializers', 'initializer'), /** This creates a registry with the default Ember naming conventions. It also configures the registry: @@ -4762,11 +4538,11 @@ build the registry @return {Ember.Registry} the built registry @public */ buildRegistry: function (namespace) { - var registry = new _containerRegistry["default"](); + var registry = new _containerRegistry.default(); registry.set = _emberMetalProperty_set.set; registry.resolver = resolverFor(namespace); registry.normalizeFullName = registry.resolver.normalize; registry.describe = registry.resolver.describe; @@ -4776,69 +4552,68 @@ registry.optionsForType('view', { singleton: false }); registry.optionsForType('template', { instantiate: false }); registry.register('application:main', namespace, { instantiate: false }); - registry.register('controller:basic', _emberRuntimeControllersController["default"], { instantiate: false }); - registry.register('controller:object', _emberRuntimeControllersObject_controller["default"], { instantiate: false }); - registry.register('controller:array', _emberRuntimeControllersArray_controller["default"], { instantiate: false }); + registry.register('controller:basic', _emberRuntimeControllersController.default, { instantiate: false }); + registry.register('controller:array', _emberRuntimeControllersArray_controller.default, { instantiate: false }); registry.register('renderer:-dom', { create: function () { - return new _emberMetalViewsRenderer["default"](new _emberHtmlbarsSystemDomHelper["default"]()); + return new _emberMetalViewsRenderer.default(new _emberHtmlbarsSystemDomHelper.default()); } }); registry.injection('view', 'renderer', 'renderer:-dom'); - registry.register('view:select', _emberViewsViewsSelect["default"]); + registry.register('view:select', _emberViewsViewsSelect.default); registry.register('view:-outlet', _emberRoutingViewsViewsOutlet.OutletView); registry.register('-view-registry:main', { create: function () { return {}; } }); registry.injection('view', '_viewRegistry', '-view-registry:main'); - registry.register('view:toplevel', _emberViewsViewsView["default"].extend()); + registry.register('view:toplevel', _emberViewsViewsView.default.extend()); - registry.register('route:basic', _emberRoutingSystemRoute["default"], { instantiate: false }); - registry.register('event_dispatcher:main', _emberViewsSystemEvent_dispatcher["default"]); + registry.register('route:basic', _emberRoutingSystemRoute.default, { instantiate: false }); + registry.register('event_dispatcher:main', _emberViewsSystemEvent_dispatcher.default); registry.injection('router:main', 'namespace', 'application:main'); registry.injection('view:-outlet', 'namespace', 'application:main'); - registry.register('location:auto', _emberRoutingLocationAuto_location["default"]); - registry.register('location:hash', _emberRoutingLocationHash_location["default"]); - registry.register('location:history', _emberRoutingLocationHistory_location["default"]); - registry.register('location:none', _emberRoutingLocationNone_location["default"]); + registry.register('location:auto', _emberRoutingLocationAuto_location.default); + registry.register('location:hash', _emberRoutingLocationHash_location.default); + registry.register('location:history', _emberRoutingLocationHistory_location.default); + registry.register('location:none', _emberRoutingLocationNone_location.default); registry.injection('controller', 'target', 'router:main'); registry.injection('controller', 'namespace', 'application:main'); - registry.register('-bucket-cache:main', _emberRoutingSystemCache["default"]); + registry.register('-bucket-cache:main', _emberRoutingSystemCache.default); registry.injection('router', '_bucketCache', '-bucket-cache:main'); registry.injection('route', '_bucketCache', '-bucket-cache:main'); registry.injection('controller', '_bucketCache', '-bucket-cache:main'); registry.injection('route', 'router', 'router:main'); - registry.register('component:-text-field', _emberViewsViewsText_field["default"]); - registry.register('component:-text-area', _emberViewsViewsText_area["default"]); - registry.register('component:-checkbox', _emberViewsViewsCheckbox["default"]); - registry.register('view:-legacy-each', _emberViewsViewsLegacy_each_view["default"]); - registry.register('component:-link-to', _emberRoutingViewsViewsLink["default"]); + registry.register('component:-text-field', _emberViewsViewsText_field.default); + registry.register('component:-text-area', _emberViewsViewsText_area.default); + registry.register('component:-checkbox', _emberViewsViewsCheckbox.default); + registry.register('view:-legacy-each', _emberViewsViewsLegacy_each_view.default); + registry.register('component:-link-to', _emberRoutingViewsViewsLink.default); // Register the routing service... - registry.register('service:-routing', _emberRoutingServicesRouting["default"]); + registry.register('service:-routing', _emberRoutingServicesRouting.default); // Then inject the app router into it registry.injection('service:-routing', 'router', 'router:main'); // DEBUGGING registry.register('resolver-for-debugging:main', registry.resolver.__resolver__, { instantiate: false }); registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); // Custom resolver authors may want to register their own ContainerDebugAdapter with this key - registry.register('container-debug-adapter:main', _emberExtensionSupportContainer_debug_adapter["default"]); + registry.register('container-debug-adapter:main', _emberExtensionSupportContainer_debug_adapter.default); return registry; } }); @@ -4858,11 +4633,11 @@ @param {Ember.Namespace} namespace the namespace to look for classes @return {*} the resolved value for a given lookup */ function resolverFor(namespace) { - var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || _emberApplicationSystemResolver["default"]; + var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || _emberApplicationSystemResolver.default; var resolver = ResolverClass.create({ namespace: namespace }); function resolve(fullName) { @@ -4900,23 +4675,23 @@ function registerLibraries() { if (!librariesRegistered) { librariesRegistered = true; - if (_emberMetalEnvironment["default"].hasDOM) { - _emberMetal["default"].libraries.registerCoreLibrary('jQuery', _emberViewsSystemJquery["default"]().jquery); + if (_emberMetalEnvironment.default.hasDOM) { + _emberMetal.default.libraries.registerCoreLibrary('jQuery', _emberViewsSystemJquery.default().jquery); } } } function logLibraryVersions() { - if (_emberMetal["default"].LOG_VERSION) { + if (_emberMetal.default.LOG_VERSION) { // we only need to see this once per Application#init - _emberMetal["default"].LOG_VERSION = false; - var libs = _emberMetal["default"].libraries._registry; + _emberMetal.default.LOG_VERSION = false; + var libs = _emberMetal.default.libraries._registry; - var nameLengths = _emberMetalEnumerable_utils.map(libs, function (item) { + var nameLengths = libs.map(function (item) { return _emberMetalProperty_get.get(item, 'name.length'); }); var maxNameLength = Math.max.apply(this, nameLengths); @@ -4933,31 +4708,47 @@ // to make sure we have a new `initializers` object, which extends from the parent class' using // prototypal inheritance. Without this, attempting to add initializers to the subclass would // pollute the parent class as well as other subclasses. if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) { var attrs = {}; - attrs[bucketName] = _emberMetalPlatformCreate["default"](this[bucketName]); + attrs[bucketName] = Object.create(this[bucketName]); this.reopenClass(attrs); } this[bucketName][initializer.name] = initializer; }; } - exports["default"] = Application; + exports.default = Application; }); -// Ember.FEATURES, Ember.deprecate, Ember.assert, Ember.libraries, LOG_VERSION, Namespace, BOOTED -enifed('ember-application/system/resolver', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/logger', 'ember-metal/keys', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/system/namespace', 'ember-htmlbars/helpers', 'ember-application/utils/validate-type', 'ember-metal/dictionary'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalLogger, _emberMetalKeys, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace, _emberHtmlbarsHelpers, _emberApplicationUtilsValidateType, _emberMetalDictionary) { - /** - @module ember - @submodule ember-application - */ +/** +@module ember +@submodule ember-application +*/ +// Ember.deprecate, Ember.assert, Ember.libraries, LOG_VERSION, Namespace, BOOTED - 'use strict'; +// Create subclass of Ember.Router for this Application instance. +// This is to ensure that someone reopening `App.Router` does not +// tamper with the default `Ember.Router`. +// 2.0TODO: Can we move this into a globals-mode-only library? - var Resolver = _emberRuntimeSystemObject["default"].extend({ +/** + Creates a new instance of the application and instructs it to route to the + specified initial URL. This method returns a promise that will be resolved + once rendering is complete. That promise is resolved with the instance. + ```js + App.visit('/users').then(function(instance) { + var view = instance.view; + view.appendTo('#qunit-test-fixtures'); + }); + ``` + @method visit + @private +*/ +enifed('ember-application/system/resolver', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/logger', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/system/namespace', 'ember-htmlbars/helpers', 'ember-application/utils/validate-type', 'ember-metal/dictionary'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalLogger, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace, _emberHtmlbarsHelpers, _emberApplicationUtilsValidateType, _emberMetalDictionary) { + var Resolver = _emberRuntimeSystemObject.default.extend({ /* This will be set to the Application instance when it is created. @property namespace */ @@ -5042,21 +4833,21 @@ @namespace Ember @extends Ember.Object @public */ - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ /** This will be set to the Application instance when it is created. @property namespace @public */ namespace: null, init: function () { - this._parseNameCache = _emberMetalDictionary["default"](null); + this._parseNameCache = _emberMetalDictionary.default(null); }, normalize: function (fullName) { var _fullName$split = fullName.split(':', 2); var type = _fullName$split[0]; @@ -5107,11 +4898,11 @@ if (parsedName.root && parsedName.root.LOG_RESOLVER) { this._logLookup(resolved, parsedName); } if (resolved) { - _emberApplicationUtilsValidateType["default"](resolved, parsedName); + _emberApplicationUtilsValidateType.default(resolved, parsedName); } return resolved; }, @@ -5141,11 +4932,11 @@ if (type !== 'template' && name.indexOf('/') !== -1) { var parts = name.split('/'); name = parts[parts.length - 1]; var namespaceName = _emberRuntimeSystemString.capitalize(parts.slice(0, -1).join('.')); - root = _emberRuntimeSystemNamespace["default"].byName(namespaceName); + root = _emberRuntimeSystemNamespace.default.byName(namespaceName); } var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : _emberRuntimeSystemString.classify(type); @@ -5218,17 +5009,17 @@ @public */ resolveTemplate: function (parsedName) { var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); - if (_emberMetalCore["default"].TEMPLATES[templateName]) { - return _emberMetalCore["default"].TEMPLATES[templateName]; + if (_emberMetalCore.default.TEMPLATES[templateName]) { + return _emberMetalCore.default.TEMPLATES[templateName]; } templateName = _emberRuntimeSystemString.decamelize(templateName); - if (_emberMetalCore["default"].TEMPLATES[templateName]) { - return _emberMetalCore["default"].TEMPLATES[templateName]; + if (_emberMetalCore.default.TEMPLATES[templateName]) { + return _emberMetalCore.default.TEMPLATES[templateName]; } }, /** Lookup the view using `resolveOther` @@ -5292,11 +5083,11 @@ fullName lookup string @method resolveHelper @public */ resolveHelper: function (parsedName) { - return this.resolveOther(parsedName) || _emberHtmlbarsHelpers["default"][parsedName.fullNameWithoutType]; + return this.resolveOther(parsedName) || _emberHtmlbarsHelpers.default[parsedName.fullNameWithoutType]; }, /** Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application) @protected @@ -5337,11 +5128,11 @@ padding = '.'; } else { padding = new Array(60 - parsedName.fullName.length).join('.'); } - _emberMetalLogger["default"].info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName)); + _emberMetalLogger.default.info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName)); }, /** Used to iterate all items of a given type. @method knownForType @@ -5351,12 +5142,12 @@ knownForType: function (type) { var namespace = _emberMetalProperty_get.get(this, 'namespace'); var suffix = _emberRuntimeSystemString.classify(type); var typeRegexp = new RegExp(suffix + '$'); - var known = _emberMetalDictionary["default"](null); - var knownKeys = _emberMetalKeys["default"](namespace); + var known = _emberMetalDictionary.default(null); + var knownKeys = Object.keys(namespace); for (var index = 0, _length = knownKeys.length; index < _length; index++) { var _name = knownKeys[index]; if (typeRegexp.test(_name)) { var containerName = this.translateToContainerFullname(type, _name); @@ -5386,20 +5177,19 @@ return type + ':' + dasherizedName; } }); }); +/** +@module ember +@submodule ember-application +*/ + // Ember.TEMPLATES, Ember.assert -enifed('ember-application/utils/validate-type', ['exports'], function (exports) { - /** - @module ember - @submodule ember-application - */ +enifed('ember-application/utils/validate-type', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + exports.default = validateType; - 'use strict'; - - exports["default"] = validateType; var VALIDATED_TYPES = { route: ['assert', 'isRouteFactory', 'Ember.Route'], component: ['deprecate', 'isComponentFactory', 'Ember.Component'], view: ['deprecate', 'isViewFactory', 'Ember.View'], service: ['deprecate', 'isServiceFactory', 'Ember.Service'] @@ -5419,23 +5209,24 @@ if (action === 'deprecate') { } else { } } }); -enifed("ember-extension-support", ["exports", "ember-metal/core", "ember-extension-support/data_adapter", "ember-extension-support/container_debug_adapter"], function (exports, _emberMetalCore, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { - /** - @module ember - @submodule ember-extension-support - */ +/** +@module ember +@submodule ember-application +*/ +enifed('ember-extension-support', ['exports', 'ember-metal/core', 'ember-extension-support/data_adapter', 'ember-extension-support/container_debug_adapter'], function (exports, _emberMetalCore, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { - "use strict"; - - _emberMetalCore["default"].DataAdapter = _emberExtensionSupportData_adapter["default"]; - _emberMetalCore["default"].ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter["default"]; + _emberMetalCore.default.DataAdapter = _emberExtensionSupportData_adapter.default; + _emberMetalCore.default.ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter.default; }); -enifed("ember-extension-support/container_debug_adapter", ["exports", "ember-metal/core", "ember-runtime/system/native_array", "ember-runtime/utils", "ember-runtime/system/string", "ember-runtime/system/namespace", "ember-runtime/system/object"], function (exports, _emberMetalCore, _emberRuntimeSystemNative_array, _emberRuntimeUtils, _emberRuntimeSystemString, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject) { - "use strict"; +/** +@module ember +@submodule ember-extension-support +*/ +enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-metal/core', 'ember-runtime/system/native_array', 'ember-runtime/utils', 'ember-runtime/system/string', 'ember-runtime/system/namespace', 'ember-runtime/system/object'], function (exports, _emberMetalCore, _emberRuntimeSystemNative_array, _emberRuntimeUtils, _emberRuntimeSystemString, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject) { /** @module ember @submodule ember-extension-support */ @@ -5473,11 +5264,11 @@ @namespace Ember @extends Ember.Object @since 1.5.0 @public */ - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ /** The container of the application being debugged. This property will be injected on creation. @property container @@ -5518,16 +5309,16 @@ @param {String} type The type. e.g. "model", "controller", "route" @return {Array} An array of strings. @public */ catalogEntriesByType: function (type) { - var namespaces = _emberRuntimeSystemNative_array.A(_emberRuntimeSystemNamespace["default"].NAMESPACES); + var namespaces = _emberRuntimeSystemNative_array.A(_emberRuntimeSystemNamespace.default.NAMESPACES); var types = _emberRuntimeSystemNative_array.A(); - var typeSuffixRegex = new RegExp(_emberRuntimeSystemString.classify(type) + "$"); + var typeSuffixRegex = new RegExp(_emberRuntimeSystemString.classify(type) + '$'); namespaces.forEach(function (namespace) { - if (namespace !== _emberMetalCore["default"]) { + if (namespace !== _emberMetalCore.default) { for (var key in namespace) { if (!namespace.hasOwnProperty(key)) { continue; } if (typeSuffixRegex.test(key)) { @@ -5541,12 +5332,11 @@ }); return types; } }); }); -enifed("ember-extension-support/data_adapter", ["exports", "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"], function (exports, _emberMetalProperty_get, _emberMetalRun_loop, _emberRuntimeSystemString, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array, _emberApplicationSystemApplication) { - "use strict"; +enifed('ember-extension-support/data_adapter', ['exports', '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'], function (exports, _emberMetalProperty_get, _emberMetalRun_loop, _emberRuntimeSystemString, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array, _emberApplicationSystemApplication) { /** @module ember @submodule ember-extension-support */ @@ -5591,11 +5381,11 @@ @class DataAdapter @namespace Ember @extends EmberObject @public */ - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ init: function () { this._super.apply(this, arguments); this.releaseMethods = _emberRuntimeSystemNative_array.A(); }, @@ -5701,11 +5491,11 @@ return release; }, _nameToClass: function (type) { if (typeof type === 'string') { - type = this.container.lookupFactory("model:" + type); + type = this.container.lookupFactory('model:' + type); } return type; }, /** @@ -5831,11 +5621,11 @@ var onChange = function () { typesUpdated([_this3.wrapModelType(klass, modelName)]); }; var observer = { didChange: function () { - _emberMetalRun_loop["default"].scheduleOnce('actions', this, onChange); + _emberMetalRun_loop.default.scheduleOnce('actions', this, onChange); }, willChange: function () { return this; } }; @@ -5919,11 +5709,11 @@ @return {Array} Array of model type strings */ _getObjectsOnNamespaces: function () { var _this5 = this; - var namespaces = _emberRuntimeSystemNative_array.A(_emberRuntimeSystemNamespace["default"].NAMESPACES); + var namespaces = _emberRuntimeSystemNative_array.A(_emberRuntimeSystemNamespace.default.NAMESPACES); var types = _emberRuntimeSystemNative_array.A(); namespaces.forEach(function (namespace) { for (var key in namespace) { if (!namespace.hasOwnProperty(key)) { @@ -5934,12 +5724,12 @@ // (especially when `Ember.MODEL_FACTORY_INJECTIONS` is `true`) if (!_this5.detect(namespace[key])) { continue; } var name = _emberRuntimeSystemString.dasherize(key); - if (!(namespace instanceof _emberApplicationSystemApplication["default"]) && namespace.toString()) { - name = namespace + "/" + name; + if (!(namespace instanceof _emberApplicationSystemApplication.default) && namespace.toString()) { + name = namespace + '/' + name; } types.push(name); } }); return types; @@ -6033,169 +5823,93 @@ observeRecord: function (record, recordUpdated) { return function () {}; } }); }); -enifed("ember-htmlbars", ["exports", "ember-metal/core", "ember-template-compiler", "ember-htmlbars/system/make-view-helper", "ember-htmlbars/system/make_bound_helper", "ember-htmlbars/helpers", "ember-htmlbars/helpers/if_unless", "ember-htmlbars/helpers/with", "ember-htmlbars/helpers/loc", "ember-htmlbars/helpers/log", "ember-htmlbars/helpers/each", "ember-htmlbars/helpers/-bind-attr-class", "ember-htmlbars/helpers/-normalize-class", "ember-htmlbars/helpers/-concat", "ember-htmlbars/helpers/-join-classes", "ember-htmlbars/helpers/-legacy-each-with-controller", "ember-htmlbars/helpers/-legacy-each-with-keyword", "ember-htmlbars/helpers/-html-safe", "ember-htmlbars/system/dom-helper", "ember-htmlbars/helper", "ember-htmlbars/system/bootstrap", "ember-htmlbars/compat"], function (exports, _emberMetalCore, _emberTemplateCompiler, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsSystemMake_bound_helper, _emberHtmlbarsHelpers, _emberHtmlbarsHelpersIf_unless, _emberHtmlbarsHelpersWith, _emberHtmlbarsHelpersLoc, _emberHtmlbarsHelpersLog, _emberHtmlbarsHelpersEach, _emberHtmlbarsHelpersBindAttrClass, _emberHtmlbarsHelpersNormalizeClass, _emberHtmlbarsHelpersConcat, _emberHtmlbarsHelpersJoinClasses, _emberHtmlbarsHelpersLegacyEachWithController, _emberHtmlbarsHelpersLegacyEachWithKeyword, _emberHtmlbarsHelpersHtmlSafe, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsHelper, _emberHtmlbarsSystemBootstrap, _emberHtmlbarsCompat) { - /** - Ember templates are executed by [HTMLBars](https://github.com/tildeio/htmlbars), - an HTML-friendly version of [Handlebars](http://handlebarsjs.com/). Any valid Handlebars syntax is valid in an Ember template. - - ### Showing a property - - Templates manage the flow of an application's UI, and display state (through - the DOM) to a user. For example, given a component with the property "name", - that component's template can use the name in several ways: - - ```javascript - // app/components/person.js - export default Ember.Component.extend({ - name: 'Jill' - }); - ``` - - ```handlebars - {{! app/components/person.hbs }} - {{name}} - <div>{{name}}</div> - <span data-name={{name}}></span> - ``` - - Any time the "name" property on the component changes, the DOM will be - updated. - - Properties can be chained as well: - - ```handlebars - {{aUserModel.name}} - <div>{{listOfUsers.firstObject.name}}</div> - ``` - - ### Using Ember helpers - - When content is passed in mustaches `{{}}`, Ember will first try to find a helper - or component with that name. For example, the `if` helper: - - ```handlebars - {{if name "I have a name" "I have no name"}} - <span data-has-name={{if name true}}></span> - ``` - - The returned value is placed where the `{{}}` is called. The above style is - called "inline". A second style of helper usage is called "block". For example: - - ```handlebars - {{#if name}} - I have a name - {{else}} - I have no name - {{/if}} - ``` - - The block form of helpers allows you to control how the UI is created based - on the values of properties. - - A third form of helper is called "nested". For example here the concat - helper will add " Doe" to a displayed name if the person has no last name: - - ```handlebars - <span data-name={{concat firstName ( - if lastName (concat " " lastName) "Doe" - )}}></span> - ``` - - Ember's built-in helpers are described under the [Ember.Templates.helpers](/api/classes/Ember.Templates.helpers.html) - namespace. Documentation on creating custom helpers can be found under - [Ember.Helper](/api/classes/Ember.Helper.html). - - ### Invoking a Component - - Ember components represent state to the UI of an application. Further - reading on components can be found under [Ember.Component](/api/classes/Ember.Component.html). - - @module ember - @submodule ember-templates - @main ember-templates - @public - */ +enifed('ember-htmlbars', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-template-compiler', 'ember-htmlbars/system/make-view-helper', 'ember-htmlbars/system/make_bound_helper', 'ember-htmlbars/helpers', 'ember-htmlbars/helpers/if_unless', 'ember-htmlbars/helpers/with', 'ember-htmlbars/helpers/loc', 'ember-htmlbars/helpers/log', 'ember-htmlbars/helpers/each', 'ember-htmlbars/helpers/each-in', 'ember-htmlbars/helpers/-normalize-class', 'ember-htmlbars/helpers/-concat', 'ember-htmlbars/helpers/-join-classes', 'ember-htmlbars/helpers/-legacy-each-with-controller', 'ember-htmlbars/helpers/-legacy-each-with-keyword', 'ember-htmlbars/helpers/-get', 'ember-htmlbars/helpers/-html-safe', 'ember-htmlbars/system/dom-helper', 'ember-htmlbars/helper', 'ember-htmlbars/system/bootstrap', 'ember-htmlbars/compat'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberTemplateCompiler, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsSystemMake_bound_helper, _emberHtmlbarsHelpers, _emberHtmlbarsHelpersIf_unless, _emberHtmlbarsHelpersWith, _emberHtmlbarsHelpersLoc, _emberHtmlbarsHelpersLog, _emberHtmlbarsHelpersEach, _emberHtmlbarsHelpersEachIn, _emberHtmlbarsHelpersNormalizeClass, _emberHtmlbarsHelpersConcat, _emberHtmlbarsHelpersJoinClasses, _emberHtmlbarsHelpersLegacyEachWithController, _emberHtmlbarsHelpersLegacyEachWithKeyword, _emberHtmlbarsHelpersGet, _emberHtmlbarsHelpersHtmlSafe, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsHelper, _emberHtmlbarsSystemBootstrap, _emberHtmlbarsCompat) { - /** - - [HTMLBars](https://github.com/tildeio/htmlbars) is a [Handlebars](http://handlebarsjs.com/) - compatible templating engine used by Ember.js. The classes and namespaces - covered by this documentation attempt to focus on APIs for interacting - with HTMLBars itself. For more general guidance on Ember.js templates and - helpers, please see the [ember-templates](/api/modules/ember-templates.html) - package. - - @module ember - @submodule ember-htmlbars - @main ember-htmlbars - @public - */ - "use strict"; - _emberHtmlbarsHelpers.registerHelper('if', _emberHtmlbarsHelpersIf_unless.ifHelper); _emberHtmlbarsHelpers.registerHelper('unless', _emberHtmlbarsHelpersIf_unless.unlessHelper); - _emberHtmlbarsHelpers.registerHelper('with', _emberHtmlbarsHelpersWith["default"]); - _emberHtmlbarsHelpers.registerHelper('loc', _emberHtmlbarsHelpersLoc["default"]); - _emberHtmlbarsHelpers.registerHelper('log', _emberHtmlbarsHelpersLog["default"]); - _emberHtmlbarsHelpers.registerHelper('each', _emberHtmlbarsHelpersEach["default"]); - _emberHtmlbarsHelpers.registerHelper('-bind-attr-class', _emberHtmlbarsHelpersBindAttrClass["default"]); - _emberHtmlbarsHelpers.registerHelper('-normalize-class', _emberHtmlbarsHelpersNormalizeClass["default"]); - _emberHtmlbarsHelpers.registerHelper('concat', _emberHtmlbarsHelpersConcat["default"]); - _emberHtmlbarsHelpers.registerHelper('-join-classes', _emberHtmlbarsHelpersJoinClasses["default"]); - _emberHtmlbarsHelpers.registerHelper('-legacy-each-with-controller', _emberHtmlbarsHelpersLegacyEachWithController["default"]); - _emberHtmlbarsHelpers.registerHelper('-legacy-each-with-keyword', _emberHtmlbarsHelpersLegacyEachWithKeyword["default"]); - _emberHtmlbarsHelpers.registerHelper('-html-safe', _emberHtmlbarsHelpersHtmlSafe["default"]); + _emberHtmlbarsHelpers.registerHelper('with', _emberHtmlbarsHelpersWith.default); + _emberHtmlbarsHelpers.registerHelper('loc', _emberHtmlbarsHelpersLoc.default); + _emberHtmlbarsHelpers.registerHelper('log', _emberHtmlbarsHelpersLog.default); + _emberHtmlbarsHelpers.registerHelper('each', _emberHtmlbarsHelpersEach.default); - _emberMetalCore["default"].HTMLBars = { - _registerHelper: _emberHtmlbarsHelpers.deprecatedRegisterHelper, + _emberHtmlbarsHelpers.registerHelper('each-in', _emberHtmlbarsHelpersEachIn.default); + + _emberHtmlbarsHelpers.registerHelper('-normalize-class', _emberHtmlbarsHelpersNormalizeClass.default); + _emberHtmlbarsHelpers.registerHelper('concat', _emberHtmlbarsHelpersConcat.default); + _emberHtmlbarsHelpers.registerHelper('-join-classes', _emberHtmlbarsHelpersJoinClasses.default); + _emberHtmlbarsHelpers.registerHelper('-legacy-each-with-controller', _emberHtmlbarsHelpersLegacyEachWithController.default); + _emberHtmlbarsHelpers.registerHelper('-legacy-each-with-keyword', _emberHtmlbarsHelpersLegacyEachWithKeyword.default); + + _emberHtmlbarsHelpers.registerHelper('-get', _emberHtmlbarsHelpersGet.default); + + _emberHtmlbarsHelpers.registerHelper('-html-safe', _emberHtmlbarsHelpersHtmlSafe.default); + + _emberMetalCore.default.HTMLBars = { + _registerHelper: _emberHtmlbarsHelpers.registerHelper, template: _emberTemplateCompiler.template, compile: _emberTemplateCompiler.compile, precompile: _emberTemplateCompiler.precompile, - makeViewHelper: _emberHtmlbarsSystemMakeViewHelper["default"], - makeBoundHelper: _emberHtmlbarsSystemMake_bound_helper["default"], + makeViewHelper: _emberHtmlbarsSystemMakeViewHelper.default, + makeBoundHelper: _emberHtmlbarsSystemMake_bound_helper.default, registerPlugin: _emberTemplateCompiler.registerPlugin, - DOMHelper: _emberHtmlbarsSystemDomHelper["default"] + DOMHelper: _emberHtmlbarsSystemDomHelper.default }; - - _emberHtmlbarsHelper["default"].helper = _emberHtmlbarsHelper.helper; - _emberMetalCore["default"].Helper = _emberHtmlbarsHelper["default"]; - + _emberHtmlbarsHelper.default.helper = _emberHtmlbarsHelper.helper; + _emberMetalCore.default.Helper = _emberHtmlbarsHelper.default; }); +/** + &nbsp; + +@module ember +@submodule ember-templates +@main ember-templates +*/ + +/** + + [HTMLBars](https://github.com/tildeio/htmlbars) is a [Handlebars](http://handlebarsjs.com/) + compatible templating engine used by Ember.js. The classes and namespaces + covered by this documentation attempt to focus on APIs for interacting + with HTMLBars itself. For more general guidance on Ember.js templates and + helpers, please see the [ember-templates](/api/modules/ember-templates.html) + package. + +@module ember +@submodule ember-htmlbars +@main ember-htmlbars +*/ + // importing adds template bootstrapping // initializer to enable embedded templates // importing ember-htmlbars/compat updates the // Ember.Handlebars global if htmlbars is enabled -enifed("ember-htmlbars/compat", ["exports", "ember-metal/core", "ember-htmlbars/helpers", "ember-htmlbars/compat/helper", "ember-htmlbars/compat/handlebars-get", "ember-htmlbars/compat/make-bound-helper", "ember-htmlbars/compat/register-bound-helper", "ember-htmlbars/system/make-view-helper", "ember-htmlbars/utils/string"], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberHtmlbarsCompatHelper, _emberHtmlbarsCompatHandlebarsGet, _emberHtmlbarsCompatMakeBoundHelper, _emberHtmlbarsCompatRegisterBoundHelper, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsUtilsString) { - "use strict"; +enifed('ember-htmlbars/compat', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-htmlbars/compat/helper', 'ember-htmlbars/compat/handlebars-get', 'ember-htmlbars/compat/make-bound-helper', 'ember-htmlbars/compat/register-bound-helper', 'ember-htmlbars/system/make-view-helper', 'ember-htmlbars/utils/string'], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberHtmlbarsCompatHelper, _emberHtmlbarsCompatHandlebarsGet, _emberHtmlbarsCompatMakeBoundHelper, _emberHtmlbarsCompatRegisterBoundHelper, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsUtilsString) { - var EmberHandlebars = _emberMetalCore["default"].Handlebars = _emberMetalCore["default"].Handlebars || {}; - EmberHandlebars.helpers = _emberHtmlbarsHelpers["default"]; + var EmberHandlebars = _emberMetalCore.default.Handlebars = _emberMetalCore.default.Handlebars || {}; + EmberHandlebars.helpers = _emberHtmlbarsHelpers.default; EmberHandlebars.helper = _emberHtmlbarsCompatHelper.handlebarsHelper; EmberHandlebars.registerHelper = _emberHtmlbarsCompatHelper.registerHandlebarsCompatibleHelper; - EmberHandlebars.registerBoundHelper = _emberHtmlbarsCompatRegisterBoundHelper["default"]; - EmberHandlebars.makeBoundHelper = _emberHtmlbarsCompatMakeBoundHelper["default"]; - EmberHandlebars.get = _emberHtmlbarsCompatHandlebarsGet["default"]; - EmberHandlebars.makeViewHelper = _emberHtmlbarsSystemMakeViewHelper["default"]; + EmberHandlebars.registerBoundHelper = _emberHtmlbarsCompatRegisterBoundHelper.default; + EmberHandlebars.makeBoundHelper = _emberHtmlbarsCompatMakeBoundHelper.default; + EmberHandlebars.get = _emberHtmlbarsCompatHandlebarsGet.default; + EmberHandlebars.makeViewHelper = _emberHtmlbarsSystemMakeViewHelper.default; EmberHandlebars.SafeString = _emberHtmlbarsUtilsString.SafeString; EmberHandlebars.Utils = { escapeExpression: _emberHtmlbarsUtilsString.escapeExpression }; - exports["default"] = EmberHandlebars; + exports.default = EmberHandlebars; }); -enifed('ember-htmlbars/compat/handlebars-get', ['exports'], function (exports) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/compat/handlebars-get', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + exports.default = handlebarsGet; /** Lookup both on root and on window. If the path starts with a keyword, the corresponding object will be looked up in the template's data hash and used to resolve the path. @@ -6206,27 +5920,21 @@ @param {String} path The path to be lookedup @param {Object} options The template's option hash @deprecated @public */ - 'use strict'; - exports["default"] = handlebarsGet; - function handlebarsGet(root, path, options) { return options.legacyGetPath(path); } }); -enifed("ember-htmlbars/compat/helper", ["exports", "ember-htmlbars/helpers", "ember-views/views/view", "ember-views/views/component", "ember-htmlbars/system/make-view-helper", "ember-htmlbars/compat/make-bound-helper", "ember-metal/streams/utils", "ember-htmlbars/keywords"], function (exports, _emberHtmlbarsHelpers, _emberViewsViewsView, _emberViewsViewsComponent, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsCompatMakeBoundHelper, _emberMetalStreamsUtils, _emberHtmlbarsKeywords) { - /** - @module ember - @submodule ember-htmlbars - */ - - "use strict"; - +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/compat/helper', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-views/views/view', 'ember-views/views/component', 'ember-htmlbars/system/make-view-helper', 'ember-htmlbars/compat/make-bound-helper', 'ember-metal/streams/utils', 'ember-htmlbars/keywords'], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberViewsViewsView, _emberViewsViewsComponent, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsCompatMakeBoundHelper, _emberMetalStreamsUtils, _emberHtmlbarsKeywords) { exports.registerHandlebarsCompatibleHelper = registerHandlebarsCompatibleHelper; exports.handlebarsHelper = handlebarsHelper; var slice = [].slice; @@ -6263,11 +5971,11 @@ @private */ function HandlebarsCompatibleHelper(fn) { this.helperFunction = function helperFunc(params, hash, options, env, scope) { var param, fnResult; - var hasBlock = options.template && options.template["yield"]; + var hasBlock = options.template && options.template.yield; var handlebarsOptions = { hash: {}, types: new Array(params.length), hashTypes: {} @@ -6275,16 +5983,16 @@ handlebarsOptions.hash = {}; if (hasBlock) { handlebarsOptions.fn = function () { - options.template["yield"](); + options.template.yield(); }; - if (options.inverse["yield"]) { + if (options.inverse.yield) { handlebarsOptions.inverse = function () { - options.inverse["yield"](); + options.inverse.yield(); }; } } for (var prop in hash) { @@ -6312,11 +6020,11 @@ fnResult = fn.apply(this, args); if (options.element) { applyAttributes(env.dom, options.element, fnResult); - } else if (!options.template["yield"]) { + } else if (!options.template.yield) { return fnResult; } }; this.isHTMLBars = true; @@ -6325,11 +6033,10 @@ HandlebarsCompatibleHelper.prototype = { preprocessArguments: function () {} }; function registerHandlebarsCompatibleHelper(name, value) { - if (value && value.isLegacyViewHelper) { _emberHtmlbarsKeywords.registerKeyword(name, function (morph, env, scope, params, hash, template, inverse, visitor) { env.hooks.keyword('view', morph, env, scope, [value.viewClass], hash, template, inverse, visitor); return true; @@ -6343,45 +6050,45 @@ helper = value; } else { helper = new HandlebarsCompatibleHelper(value); } - _emberHtmlbarsHelpers["default"][name] = helper; + _emberHtmlbarsHelpers.default[name] = helper; } function handlebarsHelper(name, value) { - - if (_emberViewsViewsView["default"].detect(value)) { - _emberHtmlbarsHelpers["default"][name] = _emberHtmlbarsSystemMakeViewHelper["default"](value); + if (_emberViewsViewsView.default.detect(value)) { + _emberHtmlbarsHelpers.default[name] = _emberHtmlbarsSystemMakeViewHelper.default(value); } else { var boundHelperArgs = slice.call(arguments, 1); - var boundFn = _emberHtmlbarsCompatMakeBoundHelper["default"].apply(this, boundHelperArgs); + var boundFn = _emberHtmlbarsCompatMakeBoundHelper.default.apply(this, boundHelperArgs); - _emberHtmlbarsHelpers["default"][name] = boundFn; + _emberHtmlbarsHelpers.default[name] = boundFn; } } function applyAttributes(dom, element, innerString) { - var string = "<" + element.tagName + " " + innerString + "></div>"; + var string = '<' + element.tagName + ' ' + innerString + '></div>'; var fragment = dom.parseHTML(string, dom.createElement(element.tagName)); var attrs = fragment.firstChild.attributes; for (var i = 0, l = attrs.length; i < l; i++) { element.setAttributeNode(attrs[i].cloneNode()); } } - exports["default"] = HandlebarsCompatibleHelper; + exports.default = HandlebarsCompatibleHelper; }); -enifed("ember-htmlbars/compat/make-bound-helper", ["exports", "ember-metal/streams/utils"], function (exports, _emberMetalStreamsUtils) { - "use strict"; +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/compat/make-bound-helper', ['exports', 'ember-metal/core', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalStreamsUtils) { + exports.default = makeBoundHelper; - exports.makeBoundHelper = makeBoundHelper; - exports["default"] = deprecatedMakeBoundHelper; - /** @module ember @submodule ember-htmlbars */ @@ -6442,31 +6149,14 @@ args.push({ hash: _emberMetalStreamsUtils.readHash(hash), templates: templates, data: { properties: properties } }); return fn.apply(undefined, args); } }; } - - function deprecatedMakeBoundHelper(fn) { - for (var _len2 = arguments.length, dependentKeys = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - dependentKeys[_key2 - 1] = arguments[_key2]; - } - - - return makeBoundHelper.apply(undefined, arguments); - } }); -enifed('ember-htmlbars/compat/register-bound-helper', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-htmlbars/compat/make-bound-helper'], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberHtmlbarsCompatMakeBoundHelper) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/compat/register-bound-helper', ['exports', 'ember-htmlbars/helpers', 'ember-htmlbars/compat/make-bound-helper'], function (exports, _emberHtmlbarsHelpers, _emberHtmlbarsCompatMakeBoundHelper) { + exports.default = registerBoundHelper; - 'use strict'; - - exports.registerBoundHelper = registerBoundHelper; - exports["default"] = deprecatedRegisterBoundHelper; - var slice = [].slice; /** Register a bound handlebars helper. Bound helpers behave similarly to regular handlebars helpers, with the added ability to re-render when the underlying data @@ -6578,90 +6268,82 @@ @private */ function registerBoundHelper(name, fn) { var boundHelperArgs = slice.call(arguments, 1); - var boundFn = _emberHtmlbarsCompatMakeBoundHelper.makeBoundHelper.apply(this, boundHelperArgs); + var boundFn = _emberHtmlbarsCompatMakeBoundHelper.default.apply(this, boundHelperArgs); - _emberHtmlbarsHelpers["default"][name] = boundFn; + _emberHtmlbarsHelpers.default[name] = boundFn; } - - function deprecatedRegisterBoundHelper() { - - return registerBoundHelper.apply(undefined, arguments); - } }); -enifed("ember-htmlbars/env", ["exports", "ember-metal/environment", "htmlbars-runtime", "ember-metal/merge", "ember-htmlbars/hooks/subexpr", "ember-htmlbars/hooks/concat", "ember-htmlbars/hooks/link-render-node", "ember-htmlbars/hooks/create-fresh-scope", "ember-htmlbars/hooks/bind-shadow-scope", "ember-htmlbars/hooks/bind-self", "ember-htmlbars/hooks/bind-scope", "ember-htmlbars/hooks/bind-local", "ember-htmlbars/hooks/update-self", "ember-htmlbars/hooks/get-root", "ember-htmlbars/hooks/get-child", "ember-htmlbars/hooks/get-value", "ember-htmlbars/hooks/get-cell-or-value", "ember-htmlbars/hooks/cleanup-render-node", "ember-htmlbars/hooks/destroy-render-node", "ember-htmlbars/hooks/did-render-node", "ember-htmlbars/hooks/will-cleanup-tree", "ember-htmlbars/hooks/did-cleanup-tree", "ember-htmlbars/hooks/classify", "ember-htmlbars/hooks/component", "ember-htmlbars/hooks/lookup-helper", "ember-htmlbars/hooks/has-helper", "ember-htmlbars/hooks/invoke-helper", "ember-htmlbars/hooks/element", "ember-htmlbars/helpers", "ember-htmlbars/keywords", "ember-htmlbars/system/dom-helper", "ember-htmlbars/keywords/debugger", "ember-htmlbars/keywords/with", "ember-htmlbars/keywords/outlet", "ember-htmlbars/keywords/real_outlet", "ember-htmlbars/keywords/customized_outlet", "ember-htmlbars/keywords/unbound", "ember-htmlbars/keywords/view", "ember-htmlbars/keywords/component", "ember-htmlbars/keywords/partial", "ember-htmlbars/keywords/input", "ember-htmlbars/keywords/textarea", "ember-htmlbars/keywords/collection", "ember-htmlbars/keywords/template", "ember-htmlbars/keywords/legacy-yield", "ember-htmlbars/keywords/mut", "ember-htmlbars/keywords/each", "ember-htmlbars/keywords/readonly"], function (exports, _emberMetalEnvironment, _htmlbarsRuntime, _emberMetalMerge, _emberHtmlbarsHooksSubexpr, _emberHtmlbarsHooksConcat, _emberHtmlbarsHooksLinkRenderNode, _emberHtmlbarsHooksCreateFreshScope, _emberHtmlbarsHooksBindShadowScope, _emberHtmlbarsHooksBindSelf, _emberHtmlbarsHooksBindScope, _emberHtmlbarsHooksBindLocal, _emberHtmlbarsHooksUpdateSelf, _emberHtmlbarsHooksGetRoot, _emberHtmlbarsHooksGetChild, _emberHtmlbarsHooksGetValue, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsHooksCleanupRenderNode, _emberHtmlbarsHooksDestroyRenderNode, _emberHtmlbarsHooksDidRenderNode, _emberHtmlbarsHooksWillCleanupTree, _emberHtmlbarsHooksDidCleanupTree, _emberHtmlbarsHooksClassify, _emberHtmlbarsHooksComponent, _emberHtmlbarsHooksLookupHelper, _emberHtmlbarsHooksHasHelper, _emberHtmlbarsHooksInvokeHelper, _emberHtmlbarsHooksElement, _emberHtmlbarsHelpers, _emberHtmlbarsKeywords, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsKeywordsDebugger, _emberHtmlbarsKeywordsWith, _emberHtmlbarsKeywordsOutlet, _emberHtmlbarsKeywordsReal_outlet, _emberHtmlbarsKeywordsCustomized_outlet, _emberHtmlbarsKeywordsUnbound, _emberHtmlbarsKeywordsView, _emberHtmlbarsKeywordsComponent, _emberHtmlbarsKeywordsPartial, _emberHtmlbarsKeywordsInput, _emberHtmlbarsKeywordsTextarea, _emberHtmlbarsKeywordsCollection, _emberHtmlbarsKeywordsTemplate, _emberHtmlbarsKeywordsLegacyYield, _emberHtmlbarsKeywordsMut, _emberHtmlbarsKeywordsEach, _emberHtmlbarsKeywordsReadonly) { - "use strict"; +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/env', ['exports', 'ember-metal/features', 'ember-metal/environment', 'htmlbars-runtime', 'ember-metal/merge', 'ember-htmlbars/hooks/subexpr', 'ember-htmlbars/hooks/concat', 'ember-htmlbars/hooks/link-render-node', 'ember-htmlbars/hooks/create-fresh-scope', 'ember-htmlbars/hooks/bind-shadow-scope', 'ember-htmlbars/hooks/bind-self', 'ember-htmlbars/hooks/bind-scope', 'ember-htmlbars/hooks/bind-local', 'ember-htmlbars/hooks/update-self', 'ember-htmlbars/hooks/get-root', 'ember-htmlbars/hooks/get-child', 'ember-htmlbars/hooks/get-value', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-htmlbars/hooks/cleanup-render-node', 'ember-htmlbars/hooks/destroy-render-node', 'ember-htmlbars/hooks/did-render-node', 'ember-htmlbars/hooks/will-cleanup-tree', 'ember-htmlbars/hooks/did-cleanup-tree', 'ember-htmlbars/hooks/classify', 'ember-htmlbars/hooks/component', 'ember-htmlbars/hooks/lookup-helper', 'ember-htmlbars/hooks/has-helper', 'ember-htmlbars/hooks/invoke-helper', 'ember-htmlbars/hooks/element', 'ember-htmlbars/helpers', 'ember-htmlbars/keywords', 'ember-htmlbars/system/dom-helper', 'ember-htmlbars/keywords/debugger', 'ember-htmlbars/keywords/with', 'ember-htmlbars/keywords/outlet', 'ember-htmlbars/keywords/real_outlet', 'ember-htmlbars/keywords/customized_outlet', 'ember-htmlbars/keywords/unbound', 'ember-htmlbars/keywords/view', 'ember-htmlbars/keywords/component', 'ember-htmlbars/keywords/partial', 'ember-htmlbars/keywords/input', 'ember-htmlbars/keywords/textarea', 'ember-htmlbars/keywords/collection', 'ember-htmlbars/keywords/template', 'ember-htmlbars/keywords/legacy-yield', 'ember-htmlbars/keywords/mut', 'ember-htmlbars/keywords/each', 'ember-htmlbars/keywords/readonly', 'ember-htmlbars/keywords/get'], function (exports, _emberMetalFeatures, _emberMetalEnvironment, _htmlbarsRuntime, _emberMetalMerge, _emberHtmlbarsHooksSubexpr, _emberHtmlbarsHooksConcat, _emberHtmlbarsHooksLinkRenderNode, _emberHtmlbarsHooksCreateFreshScope, _emberHtmlbarsHooksBindShadowScope, _emberHtmlbarsHooksBindSelf, _emberHtmlbarsHooksBindScope, _emberHtmlbarsHooksBindLocal, _emberHtmlbarsHooksUpdateSelf, _emberHtmlbarsHooksGetRoot, _emberHtmlbarsHooksGetChild, _emberHtmlbarsHooksGetValue, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsHooksCleanupRenderNode, _emberHtmlbarsHooksDestroyRenderNode, _emberHtmlbarsHooksDidRenderNode, _emberHtmlbarsHooksWillCleanupTree, _emberHtmlbarsHooksDidCleanupTree, _emberHtmlbarsHooksClassify, _emberHtmlbarsHooksComponent, _emberHtmlbarsHooksLookupHelper, _emberHtmlbarsHooksHasHelper, _emberHtmlbarsHooksInvokeHelper, _emberHtmlbarsHooksElement, _emberHtmlbarsHelpers, _emberHtmlbarsKeywords, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsKeywordsDebugger, _emberHtmlbarsKeywordsWith, _emberHtmlbarsKeywordsOutlet, _emberHtmlbarsKeywordsReal_outlet, _emberHtmlbarsKeywordsCustomized_outlet, _emberHtmlbarsKeywordsUnbound, _emberHtmlbarsKeywordsView, _emberHtmlbarsKeywordsComponent, _emberHtmlbarsKeywordsPartial, _emberHtmlbarsKeywordsInput, _emberHtmlbarsKeywordsTextarea, _emberHtmlbarsKeywordsCollection, _emberHtmlbarsKeywordsTemplate, _emberHtmlbarsKeywordsLegacyYield, _emberHtmlbarsKeywordsMut, _emberHtmlbarsKeywordsEach, _emberHtmlbarsKeywordsReadonly, _emberHtmlbarsKeywordsGet) { - var emberHooks = _emberMetalMerge["default"]({}, _htmlbarsRuntime.hooks); - emberHooks.keywords = _emberHtmlbarsKeywords["default"]; + var emberHooks = _emberMetalMerge.default({}, _htmlbarsRuntime.hooks); + emberHooks.keywords = _emberHtmlbarsKeywords.default; - _emberMetalMerge["default"](emberHooks, { - linkRenderNode: _emberHtmlbarsHooksLinkRenderNode["default"], - createFreshScope: _emberHtmlbarsHooksCreateFreshScope["default"], - bindShadowScope: _emberHtmlbarsHooksBindShadowScope["default"], - bindSelf: _emberHtmlbarsHooksBindSelf["default"], - bindScope: _emberHtmlbarsHooksBindScope["default"], - bindLocal: _emberHtmlbarsHooksBindLocal["default"], - updateSelf: _emberHtmlbarsHooksUpdateSelf["default"], - getRoot: _emberHtmlbarsHooksGetRoot["default"], - getChild: _emberHtmlbarsHooksGetChild["default"], - getValue: _emberHtmlbarsHooksGetValue["default"], - getCellOrValue: _emberHtmlbarsHooksGetCellOrValue["default"], - subexpr: _emberHtmlbarsHooksSubexpr["default"], - concat: _emberHtmlbarsHooksConcat["default"], - cleanupRenderNode: _emberHtmlbarsHooksCleanupRenderNode["default"], - destroyRenderNode: _emberHtmlbarsHooksDestroyRenderNode["default"], - willCleanupTree: _emberHtmlbarsHooksWillCleanupTree["default"], - didCleanupTree: _emberHtmlbarsHooksDidCleanupTree["default"], - didRenderNode: _emberHtmlbarsHooksDidRenderNode["default"], - classify: _emberHtmlbarsHooksClassify["default"], - component: _emberHtmlbarsHooksComponent["default"], - lookupHelper: _emberHtmlbarsHooksLookupHelper["default"], - hasHelper: _emberHtmlbarsHooksHasHelper["default"], - invokeHelper: _emberHtmlbarsHooksInvokeHelper["default"], - element: _emberHtmlbarsHooksElement["default"] + _emberMetalMerge.default(emberHooks, { + linkRenderNode: _emberHtmlbarsHooksLinkRenderNode.default, + createFreshScope: _emberHtmlbarsHooksCreateFreshScope.default, + bindShadowScope: _emberHtmlbarsHooksBindShadowScope.default, + bindSelf: _emberHtmlbarsHooksBindSelf.default, + bindScope: _emberHtmlbarsHooksBindScope.default, + bindLocal: _emberHtmlbarsHooksBindLocal.default, + updateSelf: _emberHtmlbarsHooksUpdateSelf.default, + getRoot: _emberHtmlbarsHooksGetRoot.default, + getChild: _emberHtmlbarsHooksGetChild.default, + getValue: _emberHtmlbarsHooksGetValue.default, + getCellOrValue: _emberHtmlbarsHooksGetCellOrValue.default, + subexpr: _emberHtmlbarsHooksSubexpr.default, + concat: _emberHtmlbarsHooksConcat.default, + cleanupRenderNode: _emberHtmlbarsHooksCleanupRenderNode.default, + destroyRenderNode: _emberHtmlbarsHooksDestroyRenderNode.default, + willCleanupTree: _emberHtmlbarsHooksWillCleanupTree.default, + didCleanupTree: _emberHtmlbarsHooksDidCleanupTree.default, + didRenderNode: _emberHtmlbarsHooksDidRenderNode.default, + classify: _emberHtmlbarsHooksClassify.default, + component: _emberHtmlbarsHooksComponent.default, + lookupHelper: _emberHtmlbarsHooksLookupHelper.default, + hasHelper: _emberHtmlbarsHooksHasHelper.default, + invokeHelper: _emberHtmlbarsHooksInvokeHelper.default, + element: _emberHtmlbarsHooksElement.default }); - _emberHtmlbarsKeywords.registerKeyword('debugger', _emberHtmlbarsKeywordsDebugger["default"]); - _emberHtmlbarsKeywords.registerKeyword('with', _emberHtmlbarsKeywordsWith["default"]); - _emberHtmlbarsKeywords.registerKeyword('outlet', _emberHtmlbarsKeywordsOutlet["default"]); - _emberHtmlbarsKeywords.registerKeyword('@real_outlet', _emberHtmlbarsKeywordsReal_outlet["default"]); - _emberHtmlbarsKeywords.registerKeyword('@customized_outlet', _emberHtmlbarsKeywordsCustomized_outlet["default"]); - _emberHtmlbarsKeywords.registerKeyword('unbound', _emberHtmlbarsKeywordsUnbound["default"]); - _emberHtmlbarsKeywords.registerKeyword('view', _emberHtmlbarsKeywordsView["default"]); - _emberHtmlbarsKeywords.registerKeyword('component', _emberHtmlbarsKeywordsComponent["default"]); - _emberHtmlbarsKeywords.registerKeyword('partial', _emberHtmlbarsKeywordsPartial["default"]); - _emberHtmlbarsKeywords.registerKeyword('template', _emberHtmlbarsKeywordsTemplate["default"]); - _emberHtmlbarsKeywords.registerKeyword('input', _emberHtmlbarsKeywordsInput["default"]); - _emberHtmlbarsKeywords.registerKeyword('textarea', _emberHtmlbarsKeywordsTextarea["default"]); - _emberHtmlbarsKeywords.registerKeyword('collection', _emberHtmlbarsKeywordsCollection["default"]); - _emberHtmlbarsKeywords.registerKeyword('legacy-yield', _emberHtmlbarsKeywordsLegacyYield["default"]); - _emberHtmlbarsKeywords.registerKeyword('mut', _emberHtmlbarsKeywordsMut["default"]); + _emberHtmlbarsKeywords.registerKeyword('debugger', _emberHtmlbarsKeywordsDebugger.default); + _emberHtmlbarsKeywords.registerKeyword('with', _emberHtmlbarsKeywordsWith.default); + _emberHtmlbarsKeywords.registerKeyword('outlet', _emberHtmlbarsKeywordsOutlet.default); + _emberHtmlbarsKeywords.registerKeyword('@real_outlet', _emberHtmlbarsKeywordsReal_outlet.default); + _emberHtmlbarsKeywords.registerKeyword('@customized_outlet', _emberHtmlbarsKeywordsCustomized_outlet.default); + _emberHtmlbarsKeywords.registerKeyword('unbound', _emberHtmlbarsKeywordsUnbound.default); + _emberHtmlbarsKeywords.registerKeyword('view', _emberHtmlbarsKeywordsView.default); + _emberHtmlbarsKeywords.registerKeyword('component', _emberHtmlbarsKeywordsComponent.default); + _emberHtmlbarsKeywords.registerKeyword('partial', _emberHtmlbarsKeywordsPartial.default); + _emberHtmlbarsKeywords.registerKeyword('template', _emberHtmlbarsKeywordsTemplate.default); + _emberHtmlbarsKeywords.registerKeyword('input', _emberHtmlbarsKeywordsInput.default); + _emberHtmlbarsKeywords.registerKeyword('textarea', _emberHtmlbarsKeywordsTextarea.default); + _emberHtmlbarsKeywords.registerKeyword('collection', _emberHtmlbarsKeywordsCollection.default); + _emberHtmlbarsKeywords.registerKeyword('legacy-yield', _emberHtmlbarsKeywordsLegacyYield.default); + _emberHtmlbarsKeywords.registerKeyword('mut', _emberHtmlbarsKeywordsMut.default); _emberHtmlbarsKeywords.registerKeyword('@mut', _emberHtmlbarsKeywordsMut.privateMut); - _emberHtmlbarsKeywords.registerKeyword('each', _emberHtmlbarsKeywordsEach["default"]); - _emberHtmlbarsKeywords.registerKeyword('readonly', _emberHtmlbarsKeywordsReadonly["default"]); + _emberHtmlbarsKeywords.registerKeyword('each', _emberHtmlbarsKeywordsEach.default); + _emberHtmlbarsKeywords.registerKeyword('readonly', _emberHtmlbarsKeywordsReadonly.default); - exports["default"] = { + _emberHtmlbarsKeywords.registerKeyword('get', _emberHtmlbarsKeywordsGet.default); + exports.default = { hooks: emberHooks, - helpers: _emberHtmlbarsHelpers["default"], + helpers: _emberHtmlbarsHelpers.default, useFragmentCache: true }; - var domHelper = _emberMetalEnvironment["default"].hasDOM ? new _emberHtmlbarsSystemDomHelper["default"]() : null; + var domHelper = _emberMetalEnvironment.default.hasDOM ? new _emberHtmlbarsSystemDomHelper.default() : null; exports.domHelper = domHelper; }); enifed('ember-htmlbars/helper', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { - /** - @module ember - @submodule ember-templates - */ - - 'use strict'; - exports.helper = helper; /** Ember Helpers are functions that can compute values, and are used in templates. For example, this code calls a helper named `format-currency`: @@ -6699,11 +6381,11 @@ Additionally, class helpers can call `recompute` to force a new computation. @class Ember.Helper @public */ - var Helper = _emberRuntimeSystemObject["default"].extend({ + var Helper = _emberRuntimeSystemObject.default.extend({ isHelper: true, /** On a class-based helper, it may be useful to force a recomputation of that helpers value. This is akin to `rerender` on a component. @@ -6766,27 +6448,28 @@ isHelperInstance: true, compute: helperFn }; } - exports["default"] = Helper; + exports.default = Helper; }); -enifed('ember-htmlbars/helpers', ['exports', 'ember-metal/platform/create', 'ember-metal/core'], function (exports, _emberMetalPlatformCreate, _emberMetalCore) { +/** +@module ember +@submodule ember-templates +*/ +enifed("ember-htmlbars/helpers", ["exports"], function (exports) { + exports.registerHelper = registerHelper; /** @module ember @submodule ember-htmlbars */ - 'use strict'; - - exports.registerHelper = registerHelper; - /** @private @property helpers */ - var helpers = _emberMetalPlatformCreate["default"](null); + var helpers = Object.create(null); /** @module ember @submodule ember-htmlbars */ @@ -6801,48 +6484,15 @@ function registerHelper(name, helperFunc) { helpers[name] = helperFunc; } - var deprecatedRegisterHelper = _emberMetalCore["default"].deprecateFunc('Using Ember.HTMLBars._registerHelper is deprecated. Helpers (even dashless ones) are automatically resolved.', { id: 'ember-htmlbars.register-helper', until: '2.0.0' }, registerHelper); - - exports.deprecatedRegisterHelper = deprecatedRegisterHelper; - exports["default"] = helpers; + exports.default = helpers; }); -enifed('ember-htmlbars/helpers/-bind-attr-class', ['exports', 'ember-metal/property_get', 'ember-metal/utils'], function (exports, _emberMetalProperty_get, _emberMetalUtils) { - /** - @module ember - @submodule ember-htmlbars - */ - - 'use strict'; - - exports["default"] = bindAttrClassHelper; - - function bindAttrClassHelper(params) { - var value = params[0]; - - if (_emberMetalUtils.isArray(value)) { - value = _emberMetalProperty_get.get(value, 'length') !== 0; - } - - if (value === true) { - return params[1]; - }if (value === false || value === undefined || value === null) { - return ""; - } else { - return value; - } - } -}); enifed('ember-htmlbars/helpers/-concat', ['exports'], function (exports) { + exports.default = concat; /** - @module ember - @submodule ember-templates - */ - - /** Concatenates input params together. Example: ```handlebars @@ -6851,49 +6501,56 @@ {{! would pass name="<first name value> <last name value>" to the component}} ``` @public @method concat - @for Ember.Templates.helpers + @for Ember.HTMLBars */ - 'use strict'; - exports["default"] = concat; - function concat(params) { return params.join(''); } }); -enifed("ember-htmlbars/helpers/-html-safe", ["exports", "htmlbars-util/safe-string"], function (exports, _htmlbarsUtilSafeString) { - "use strict"; +enifed('ember-htmlbars/helpers/-get', ['exports', 'ember-metal/features'], function (exports, _emberMetalFeatures) { - exports["default"] = htmlSafeHelper; + /* + This private helper is used in conjuntion with the get keyword + @private + */ + var getHelper = function getHelper(_ref) { + var value = _ref[0]; + + return value; + }; + + exports.default = getHelper; +}); +enifed('ember-htmlbars/helpers/-html-safe', ['exports', 'htmlbars-util/safe-string'], function (exports, _htmlbarsUtilSafeString) { + exports.default = htmlSafeHelper; + /** This private helper is used internally to handle `isVisible: false` for Ember.View and Ember.Component. @private */ function htmlSafeHelper(_ref) { var value = _ref[0]; - return new _htmlbarsUtilSafeString["default"](value); + return new _htmlbarsUtilSafeString.default(value); } }); enifed('ember-htmlbars/helpers/-join-classes', ['exports'], function (exports) { + exports.default = joinClasses; /* this private helper is used to join and compact a list of class names @private */ - 'use strict'; - - exports["default"] = joinClasses; - function joinClasses(classNames) { var result = []; for (var i = 0, l = classNames.length; i < l; i++) { var className = classNames[i]; @@ -6903,36 +6560,34 @@ } return result.join(' '); } }); -enifed("ember-htmlbars/helpers/-legacy-each-with-controller", ["exports", "ember-metal/property_get", "ember-metal/enumerable_utils", "ember-htmlbars/utils/normalize-self", "ember-htmlbars/utils/decode-each-key"], function (exports, _emberMetalProperty_get, _emberMetalEnumerable_utils, _emberHtmlbarsUtilsNormalizeSelf, _emberHtmlbarsUtilsDecodeEachKey) { - "use strict"; +enifed('ember-htmlbars/helpers/-legacy-each-with-controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-htmlbars/utils/normalize-self', 'ember-htmlbars/utils/decode-each-key'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberHtmlbarsUtilsNormalizeSelf, _emberHtmlbarsUtilsDecodeEachKey) { + exports.default = legacyEachWithControllerHelper; - exports["default"] = legacyEachWithControllerHelper; - function legacyEachWithControllerHelper(params, hash, blocks) { var list = params[0]; var keyPath = hash.key; // TODO: Correct falsy semantics if (!list || _emberMetalProperty_get.get(list, 'length') === 0) { - if (blocks.inverse["yield"]) { - blocks.inverse["yield"](); + if (blocks.inverse.yield) { + blocks.inverse.yield(); } return; } - _emberMetalEnumerable_utils.forEach(list, function (item, i) { + list.forEach(function (item, i) { var self; if (blocks.template.arity === 0) { - self = _emberHtmlbarsUtilsNormalizeSelf["default"](item); + self = _emberHtmlbarsUtilsNormalizeSelf.default(item); self = bindController(self, true); } - var key = _emberHtmlbarsUtilsDecodeEachKey["default"](item, keyPath, i); + var key = _emberHtmlbarsUtilsDecodeEachKey.default(item, keyPath, i); blocks.template.yieldItem(key, [item, i], self); }); } function bindController(controller, isSelf) { @@ -6941,35 +6596,33 @@ hasBoundController: true, self: controller ? controller : undefined }; } - var deprecation = "Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead."; + var deprecation = 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead.'; exports.deprecation = deprecation; }); -enifed("ember-htmlbars/helpers/-legacy-each-with-keyword", ["exports", "ember-metal/enumerable_utils", "ember-views/streams/should_display", "ember-htmlbars/utils/decode-each-key"], function (exports, _emberMetalEnumerable_utils, _emberViewsStreamsShould_display, _emberHtmlbarsUtilsDecodeEachKey) { - "use strict"; +enifed('ember-htmlbars/helpers/-legacy-each-with-keyword', ['exports', 'ember-views/streams/should_display', 'ember-htmlbars/utils/decode-each-key'], function (exports, _emberViewsStreamsShould_display, _emberHtmlbarsUtilsDecodeEachKey) { + exports.default = legacyEachWithKeywordHelper; - exports["default"] = legacyEachWithKeywordHelper; - function legacyEachWithKeywordHelper(params, hash, blocks) { var list = params[0]; var keyPath = hash.key; var legacyKeyword = hash['-legacy-keyword']; - if (_emberViewsStreamsShould_display["default"](list)) { - _emberMetalEnumerable_utils.forEach(list, function (item, i) { + if (_emberViewsStreamsShould_display.default(list)) { + list.forEach(function (item, i) { var self; if (legacyKeyword) { self = bindKeyword(self, legacyKeyword, item); } - var key = _emberHtmlbarsUtilsDecodeEachKey["default"](item, keyPath, i); + var key = _emberHtmlbarsUtilsDecodeEachKey.default(item, keyPath, i); blocks.template.yieldItem(key, [item, i], self); }); - } else if (blocks.inverse["yield"]) { - blocks.inverse["yield"](); + } else if (blocks.inverse.yield) { + blocks.inverse.yield(); } } function bindKeyword(self, keyword, item) { var _ref; @@ -6977,18 +6630,16 @@ return (_ref = { self: self }, _ref[keyword] = item, _ref); } - var deprecation = "Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead."; + var deprecation = 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead.'; exports.deprecation = deprecation; }); -enifed("ember-htmlbars/helpers/-normalize-class", ["exports", "ember-runtime/system/string", "ember-metal/path_cache"], function (exports, _emberRuntimeSystemString, _emberMetalPath_cache) { - "use strict"; +enifed('ember-htmlbars/helpers/-normalize-class', ['exports', 'ember-runtime/system/string', 'ember-metal/path_cache'], function (exports, _emberRuntimeSystemString, _emberMetalPath_cache) { + exports.default = normalizeClass; - exports["default"] = normalizeClass; - /* This private helper is used by ComponentNode to convert the classNameBindings microsyntax into a class name. When a component or view is created, we normalize class name bindings into a @@ -7013,180 +6664,50 @@ } // If value is a Boolean and true, return the dasherized property // name. } else if (value === true) { - // Only apply to last segment in the path - if (propName && _emberMetalPath_cache.isPath(propName)) { - var segments = propName.split('.'); - propName = segments[segments.length - 1]; - } + // Only apply to last segment in the path + if (propName && _emberMetalPath_cache.isPath(propName)) { + var segments = propName.split('.'); + propName = segments[segments.length - 1]; + } - return _emberRuntimeSystemString.dasherize(propName); + return _emberRuntimeSystemString.dasherize(propName); - // If the value is not false, undefined, or null, return the current - // value of the property. - } else if (value !== false && value != null) { - return value; + // If the value is not false, undefined, or null, return the current + // value of the property. + } else if (value !== false && value != null) { + return value; - // Nothing to display. Return null so that the old class is removed - // but no new class is added. - } else { - return null; - } + // Nothing to display. Return null so that the old class is removed + // but no new class is added. + } else { + return null; + } } }); -enifed("ember-htmlbars/helpers/bind-attr", ["exports"], function (exports) { - "use strict"; +enifed('ember-htmlbars/helpers/each-in', ['exports', 'ember-metal/features', 'ember-views/streams/should_display'], function (exports, _emberMetalFeatures, _emberViewsStreamsShould_display) { + var eachInHelper = function (_ref, hash, blocks) { + var object = _ref[0]; + + var objKeys, prop, i; + objKeys = object ? Object.keys(object) : []; + if (_emberViewsStreamsShould_display.default(objKeys)) { + for (i = 0; i < objKeys.length; i++) { + prop = objKeys[i]; + blocks.template.yieldItem(prop, [prop, object[prop]]); + } + } else if (blocks.inverse.yield) { + blocks.inverse.yield(); + } + }; + exports.default = eachInHelper; }); -/** -@module ember -@submodule ember-htmlbars -*/ +enifed('ember-htmlbars/helpers/each', ['exports', 'ember-metal/core', 'ember-metal/error', 'ember-htmlbars/utils/normalize-self', 'ember-views/streams/should_display', 'ember-htmlbars/utils/decode-each-key'], function (exports, _emberMetalCore, _emberMetalError, _emberHtmlbarsUtilsNormalizeSelf, _emberViewsStreamsShould_display, _emberHtmlbarsUtilsDecodeEachKey) { + exports.default = eachHelper; -/** - `bind-attr` allows you to create a binding between DOM element attributes and - Ember objects. For example: - - ```handlebars - <img {{bind-attr src=imageUrl alt=imageTitle}}> - ``` - - The above handlebars template will fill the `<img>`'s `src` attribute with - the value of the property referenced with `imageUrl` and its `alt` - attribute with the value of the property referenced with `imageTitle`. - - If the rendering context of this template is the following object: - - ```javascript - { - imageUrl: 'http://lolcats.info/haz-a-funny', - imageTitle: 'A humorous image of a cat' - } - ``` - - The resulting HTML output will be: - - ```html - <img src="http://lolcats.info/haz-a-funny" alt="A humorous image of a cat"> - ``` - - `bind-attr` cannot redeclare existing DOM element attributes. The use of `src` - in the following `bind-attr` example will be ignored and the hard coded value - of `src="/failwhale.gif"` will take precedence: - - ```handlebars - <img src="/failwhale.gif" {{bind-attr src=imageUrl alt=imageTitle}}> - ``` - - ### `bind-attr` and the `class` attribute - - `bind-attr` supports a special syntax for handling a number of cases unique - to the `class` DOM element attribute. The `class` attribute combines - multiple discrete values into a single attribute as a space-delimited - list of strings. Each string can be: - - * a string return value of an object's property. - * a boolean return value of an object's property - * a hard-coded value - - A string return value works identically to other uses of `bind-attr`. The - return value of the property will become the value of the attribute. For - example, the following view and template: - - ```javascript - AView = View.extend({ - someProperty: function() { - return "aValue"; - }.property() - }) - ``` - - ```handlebars - <img {{bind-attr class=view.someProperty}}> - ``` - - Result in the following rendered output: - - ```html - <img class="aValue"> - ``` - - A boolean return value will insert a specified class name if the property - returns `true` and remove the class name if the property returns `false`. - - A class name is provided via the syntax - `somePropertyName:class-name-if-true`. - - ```javascript - AView = View.extend({ - someBool: true - }) - ``` - - ```handlebars - <img {{bind-attr class="view.someBool:class-name-if-true"}}> - ``` - - Result in the following rendered output: - - ```html - <img class="class-name-if-true"> - ``` - - An additional section of the binding can be provided if you want to - replace the existing class instead of removing it when the boolean - value changes: - - ```handlebars - <img {{bind-attr class="view.someBool:class-name-if-true:class-name-if-false"}}> - ``` - - A hard-coded value can be used by prepending `:` to the desired - class name: `:class-name-to-always-apply`. - - ```handlebars - <img {{bind-attr class=":class-name-to-always-apply"}}> - ``` - - Results in the following rendered output: - - ```html - <img class="class-name-to-always-apply"> - ``` - - All three strategies - string return value, boolean return value, and - hard-coded value – can be combined in a single declaration: - - ```handlebars - <img {{bind-attr class=":class-name-to-always-apply view.someBool:class-name-if-true view.someProperty"}}> - ``` - - @method bind-attr - @for Ember.Handlebars.helpers - @deprecated - @param {Object} options - @return {String} HTML string - @public -*/ - -/** - See `bind-attr` - - @method bindAttr - @for Ember.Handlebars.helpers - @deprecated - @param {Function} context - @param {Object} options - @return {String} HTML string - @public -*/ -enifed("ember-htmlbars/helpers/each", ["exports", "ember-metal/enumerable_utils", "ember-htmlbars/utils/normalize-self", "ember-views/streams/should_display", "ember-htmlbars/utils/decode-each-key"], function (exports, _emberMetalEnumerable_utils, _emberHtmlbarsUtilsNormalizeSelf, _emberViewsStreamsShould_display, _emberHtmlbarsUtilsDecodeEachKey) { - "use strict"; - - exports["default"] = eachHelper; - /** The `{{#each}}` helper loops over elements in a collection. It is an extension of the base Handlebars `{{#each}}` helper. The default behavior of `{{#each}}` is to yield its inner block once for every @@ -7258,37 +6779,42 @@ var keyPath = hash.key; if (blocks.template.arity === 0) { } - if (_emberViewsStreamsShould_display["default"](list)) { - _emberMetalEnumerable_utils.forEach(list, function (item, i) { - var self; - if (blocks.template.arity === 0) { - self = _emberHtmlbarsUtilsNormalizeSelf["default"](item); - } + if (_emberViewsStreamsShould_display.default(list)) { + (function () { + var seenKeys = {}; + forEach(list, function (item, i) { + var self; + if (blocks.template.arity === 0) { + self = _emberHtmlbarsUtilsNormalizeSelf.default(item); + } - var key = _emberHtmlbarsUtilsDecodeEachKey["default"](item, keyPath, i); - - blocks.template.yieldItem(key, [item, i], self); - }); - } else if (blocks.inverse["yield"]) { - blocks.inverse["yield"](); + var key = _emberHtmlbarsUtilsDecodeEachKey.default(item, keyPath, i); + if (seenKeys[key] === true) { + throw new _emberMetalError.default('Duplicate key found (\'' + key + '\') for \'{{each}}\' helper, please use a unique key or switch to \'{{#each model key="@index"}}{{/each}}\'.'); + } else { + seenKeys[key] = true; + } + blocks.template.yieldItem(key, [item, i], self); + }); + })(); + } else if (blocks.inverse.yield) { + blocks.inverse.yield(); } } - var deprecation = "Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead."; + function forEach(iterable, cb) { + return iterable.forEach ? iterable.forEach(cb) : Array.prototype.forEach.call(iterable, cb); + } + + var deprecation = 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead.'; exports.deprecation = deprecation; }); -enifed("ember-htmlbars/helpers/if_unless", ["exports", "ember-metal/core", "ember-views/streams/should_display"], function (exports, _emberMetalCore, _emberViewsStreamsShould_display) { - /** - @module ember - @submodule ember-templates - */ +enifed('ember-htmlbars/helpers/if_unless', ['exports', 'ember-metal/core', 'ember-views/streams/should_display'], function (exports, _emberMetalCore, _emberViewsStreamsShould_display) { - "use strict"; - /** Use the `if` block helper to conditionally render a block depending on a property. If the property is "falsey", for example: `false`, `undefined `null`, `""`, `0` or an empty array, the block will not be rendered. @@ -7342,11 +6868,11 @@ @method if @for Ember.Templates.helpers @public */ function ifHelper(params, hash, options) { - return ifUnless(params, hash, options, _emberViewsStreamsShould_display["default"](params[0])); + return ifUnless(params, hash, options, _emberViewsStreamsShould_display.default(params[0])); } /** The `unless` helper is the inverse of the `if` helper. Its block will be rendered if the expression contains a falsey value. All forms of the `if` @@ -7355,40 +6881,43 @@ @method unless @for Ember.Templates.helpers @public */ function unlessHelper(params, hash, options) { - return ifUnless(params, hash, options, !_emberViewsStreamsShould_display["default"](params[0])); + return ifUnless(params, hash, options, !_emberViewsStreamsShould_display.default(params[0])); } function ifUnless(params, hash, options, truthy) { if (truthy) { - if (options.template["yield"]) { - options.template["yield"](); + if (options.template.yield) { + options.template.yield(); } else { return params[1]; } } else { - if (options.inverse["yield"]) { - options.inverse["yield"](); + if (options.inverse.yield) { + options.inverse.yield(); } else { return params[2]; } } } exports.ifHelper = ifHelper; exports.unlessHelper = unlessHelper; }); +/** +@module ember +@submodule ember-templates +*/ + // Ember.assert enifed('ember-htmlbars/helpers/loc', ['exports', 'ember-runtime/system/string'], function (exports, _emberRuntimeSystemString) { - 'use strict'; + exports.default = locHelper; - exports["default"] = locHelper; - /** @module ember @submodule ember-templates */ @@ -7427,20 +6956,13 @@ function locHelper(params) { return _emberRuntimeSystemString.loc.apply(null, params); } }); -enifed("ember-htmlbars/helpers/log", ["exports", "ember-metal/logger"], function (exports, _emberMetalLogger) { - /** - @module ember - @submodule ember-templates - */ +enifed('ember-htmlbars/helpers/log', ['exports', 'ember-metal/logger'], function (exports, _emberMetalLogger) { + exports.default = logHelper; - "use strict"; - - exports["default"] = logHelper; - /** `log` allows you to output the value of variables in the current rendering context. `log` also accepts primitive types such as strings or numbers. ```handlebars @@ -7452,23 +6974,20 @@ @param {*} values @public */ function logHelper(values) { - _emberMetalLogger["default"].log.apply(null, values); + _emberMetalLogger.default.log.apply(null, values); } }); -enifed("ember-htmlbars/helpers/with", ["exports", "ember-htmlbars/utils/normalize-self", "ember-views/streams/should_display"], function (exports, _emberHtmlbarsUtilsNormalizeSelf, _emberViewsStreamsShould_display) { - /** - @module ember - @submodule ember-templates - */ +/** +@module ember +@submodule ember-templates +*/ +enifed('ember-htmlbars/helpers/with', ['exports', 'ember-htmlbars/utils/normalize-self', 'ember-views/streams/should_display'], function (exports, _emberHtmlbarsUtilsNormalizeSelf, _emberViewsStreamsShould_display) { + exports.default = withHelper; - "use strict"; - - exports["default"] = withHelper; - /** Use the `{{with}}` helper when you want to alias a property to a new name. This is helpful for semantic clarity as it allows you to retain default scope or to reference a property from another `{{with}}` block. @@ -7499,83 +7018,74 @@ @return {String} HTML string @public */ function withHelper(params, hash, options) { - if (_emberViewsStreamsShould_display["default"](params[0])) { + if (_emberViewsStreamsShould_display.default(params[0])) { var preserveContext = false; if (options.template.arity !== 0) { preserveContext = true; } if (preserveContext) { - this["yield"]([params[0]]); + this.yield([params[0]]); } else { - var _self = _emberHtmlbarsUtilsNormalizeSelf["default"](params[0]); + var _self = _emberHtmlbarsUtilsNormalizeSelf.default(params[0]); if (hash.controller) { _self = { hasBoundController: true, controller: hash.controller, self: _self }; } - this["yield"]([], _self); + this.yield([], _self); } - } else if (options.inverse && options.inverse["yield"]) { - options.inverse["yield"]([]); + } else if (options.inverse && options.inverse.yield) { + options.inverse.yield([]); } } }); -enifed("ember-htmlbars/hooks/bind-local", ["exports", "ember-metal/streams/stream", "ember-metal/streams/proxy-stream"], function (exports, _emberMetalStreamsStream, _emberMetalStreamsProxyStream) { - /** - @module ember - @submodule ember-htmlbars - */ +/** +@module ember +@submodule ember-templates +*/ +enifed('ember-htmlbars/hooks/bind-local', ['exports', 'ember-metal/streams/stream', 'ember-metal/streams/proxy-stream'], function (exports, _emberMetalStreamsStream, _emberMetalStreamsProxyStream) { + exports.default = bindLocal; - "use strict"; - - exports["default"] = bindLocal; - function bindLocal(env, scope, key, value) { var isExisting = scope.locals.hasOwnProperty(key); if (isExisting) { var existing = scope.locals[key]; if (existing !== value) { existing.setSource(value); } } else { - var newValue = _emberMetalStreamsStream["default"].wrap(value, _emberMetalStreamsProxyStream["default"], key); + var newValue = _emberMetalStreamsStream.default.wrap(value, _emberMetalStreamsProxyStream.default, key); scope.locals[key] = newValue; } } }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed("ember-htmlbars/hooks/bind-scope", ["exports"], function (exports) { - "use strict"; + exports.default = bindScope; - exports["default"] = bindScope; - function bindScope(env, scope) {} }); -enifed("ember-htmlbars/hooks/bind-self", ["exports", "ember-metal/streams/proxy-stream", "ember-htmlbars/utils/subscribe"], function (exports, _emberMetalStreamsProxyStream, _emberHtmlbarsUtilsSubscribe) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/hooks/bind-self', ['exports', 'ember-metal/streams/proxy-stream', 'ember-htmlbars/utils/subscribe'], function (exports, _emberMetalStreamsProxyStream, _emberHtmlbarsUtilsSubscribe) { + exports.default = bindSelf; - "use strict"; - - exports["default"] = bindSelf; - function bindSelf(env, scope, _self) { var self = _self; if (self && self.hasBoundController) { - var _self2 = self; - var controller = _self2.controller; + var controller = self.controller; self = self.self; newStream(scope.locals, 'controller', controller || self); } @@ -7593,27 +7103,24 @@ scope.locals.controller = scope.self; } } function newStream(scope, key, newValue, renderNode, isSelf) { - var stream = new _emberMetalStreamsProxyStream["default"](newValue, isSelf ? '' : key); + var stream = new _emberMetalStreamsProxyStream.default(newValue, isSelf ? '' : key); if (renderNode) { - _emberHtmlbarsUtilsSubscribe["default"](renderNode, scope, stream); + _emberHtmlbarsUtilsSubscribe.default(renderNode, scope, stream); } scope[key] = stream; } }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed('ember-htmlbars/hooks/bind-shadow-scope', ['exports', 'ember-views/views/component', 'ember-metal/streams/proxy-stream', 'ember-htmlbars/utils/subscribe'], function (exports, _emberViewsViewsComponent, _emberMetalStreamsProxyStream, _emberHtmlbarsUtilsSubscribe) { - /** - @module ember - @submodule ember-htmlbars - */ + exports.default = bindShadowScope; - 'use strict'; - - exports["default"] = bindShadowScope; - function bindShadowScope(env, parentScope, shadowScope, options) { if (!options) { return; } @@ -7623,11 +7130,11 @@ didOverrideController = true; shadowScope.locals.controller = parentScope.locals.controller; } var view = options.view; - if (view && !(view instanceof _emberViewsViewsComponent["default"])) { + if (view && !(view instanceof _emberViewsViewsComponent.default)) { newStream(shadowScope.locals, 'view', view, null); if (!didOverrideController) { newStream(shadowScope.locals, 'controller', shadowScope.locals.view.getKey('controller')); } @@ -7649,56 +7156,52 @@ return shadowScope; } function newStream(scope, key, newValue, renderNode, isSelf) { - var stream = new _emberMetalStreamsProxyStream["default"](newValue, isSelf ? '' : key); + var stream = new _emberMetalStreamsProxyStream.default(newValue, isSelf ? '' : key); if (renderNode) { - _emberHtmlbarsUtilsSubscribe["default"](renderNode, scope, stream); + _emberHtmlbarsUtilsSubscribe.default(renderNode, scope, stream); } scope[key] = stream; } }); -enifed("ember-htmlbars/hooks/classify", ["exports", "ember-htmlbars/utils/is-component"], function (exports, _emberHtmlbarsUtilsIsComponent) { - /** - @module ember - @submodule ember-htmlbars - */ +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/hooks/classify', ['exports', 'ember-htmlbars/utils/is-component'], function (exports, _emberHtmlbarsUtilsIsComponent) { + exports.default = classify; - "use strict"; - - exports["default"] = classify; - function classify(env, scope, path) { - if (_emberHtmlbarsUtilsIsComponent["default"](env, scope, path)) { + if (_emberHtmlbarsUtilsIsComponent.default(env, scope, path)) { return 'component'; } return null; } }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed("ember-htmlbars/hooks/cleanup-render-node", ["exports"], function (exports) { + exports.default = cleanupRenderNode; /** @module ember @submodule ember-htmlbars */ - "use strict"; - - exports["default"] = cleanupRenderNode; - function cleanupRenderNode(renderNode) { if (renderNode.cleanup) { renderNode.cleanup(); } } }); -enifed("ember-htmlbars/hooks/component", ["exports", "ember-htmlbars/node-managers/component-node-manager"], function (exports, _emberHtmlbarsNodeManagersComponentNodeManager) { - "use strict"; +enifed('ember-htmlbars/hooks/component', ['exports', 'ember-htmlbars/node-managers/component-node-manager'], function (exports, _emberHtmlbarsNodeManagersComponentNodeManager) { + exports.default = componentHook; - exports["default"] = componentHook; - function componentHook(renderNode, env, scope, _tagName, params, attrs, templates, visitor) { var state = renderNode.state; // Determine if this is an initial render or a re-render if (state.manager) { @@ -7714,11 +7217,11 @@ isAngleBracket = true; } var parentView = env.view; - var manager = _emberHtmlbarsNodeManagersComponentNodeManager["default"].create(renderNode, env, { + var manager = _emberHtmlbarsNodeManagersComponentNodeManager.default.create(renderNode, env, { tagName: tagName, params: params, attrs: attrs, parentView: parentView, templates: templates, @@ -7729,25 +7232,23 @@ state.manager = manager; manager.render(env, visitor); } }); -enifed("ember-htmlbars/hooks/concat", ["exports", "ember-metal/streams/utils"], function (exports, _emberMetalStreamsUtils) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/hooks/concat', ['exports', 'ember-metal/streams/utils'], function (exports, _emberMetalStreamsUtils) { + exports.default = concat; - "use strict"; - - exports["default"] = concat; - function concat(env, parts) { return _emberMetalStreamsUtils.concat(parts, ''); } }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed("ember-htmlbars/hooks/create-fresh-scope", ["exports"], function (exports) { + exports.default = createFreshScope; /* Ember's implementation of HTMLBars creates an enriched scope. * self: same as HTMLBars, this field represents the dynamic lookup of root keys that are not special keywords or block arguments. @@ -7792,14 +7293,10 @@ view-less templates and the legacy `controller=foo` semantics, the controller hierarchy is managed dynamically by looking at the current view's `controller`. */ - "use strict"; - - exports["default"] = createFreshScope; - function createFreshScope() { return { self: null, blocks: {}, component: null, @@ -7808,19 +7305,16 @@ localPresent: {} }; } }); enifed("ember-htmlbars/hooks/destroy-render-node", ["exports"], function (exports) { + exports.default = destroyRenderNode; /** @module ember @submodule ember-htmlbars */ - "use strict"; - - exports["default"] = destroyRenderNode; - function destroyRenderNode(renderNode) { if (renderNode.emberView) { renderNode.emberView.destroy(); } @@ -7831,39 +7325,28 @@ } } } }); enifed("ember-htmlbars/hooks/did-cleanup-tree", ["exports"], function (exports) { - "use strict"; + exports.default = didCleanupTree; - exports["default"] = didCleanupTree; - function didCleanupTree(env) { // Once we have finsihed cleaning up the render node and sub-nodes, reset // state tracking which view those render nodes belonged to. env.view.ownerView._destroyingSubtreeForView = null; } }); enifed("ember-htmlbars/hooks/did-render-node", ["exports"], function (exports) { - "use strict"; + exports.default = didRenderNode; - exports["default"] = didRenderNode; - function didRenderNode(morph, env) { env.renderedNodes[morph.guid] = true; } }); -enifed("ember-htmlbars/hooks/element", ["exports", "ember-htmlbars/system/lookup-helper", "htmlbars-runtime/hooks", "ember-htmlbars/system/invoke-helper"], function (exports, _emberHtmlbarsSystemLookupHelper, _htmlbarsRuntimeHooks, _emberHtmlbarsSystemInvokeHelper) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/hooks/element', ['exports', 'ember-metal/core', 'ember-htmlbars/system/lookup-helper', 'htmlbars-runtime/hooks', 'ember-htmlbars/system/invoke-helper'], function (exports, _emberMetalCore, _emberHtmlbarsSystemLookupHelper, _htmlbarsRuntimeHooks, _emberHtmlbarsSystemInvokeHelper) { + exports.default = emberElement; - "use strict"; - - exports["default"] = emberElement; - var fakeElement; function updateElementAttributesFromString(element, string) { if (!fakeElement) { fakeElement = document.createElement('div'); @@ -7886,11 +7369,11 @@ } var result; var helper = _emberHtmlbarsSystemLookupHelper.findHelper(path, scope.self, env); if (helper) { - var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, { element: morph.element }, env, scope); + var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, { element: morph.element }, env, scope, null, path); result = helperStream.value(); } else { result = env.hooks.get(env, scope, path); } @@ -7898,35 +7381,30 @@ if (value) { updateElementAttributesFromString(morph.element, value); } } }); -enifed("ember-htmlbars/hooks/get-cell-or-value", ["exports", "ember-metal/streams/utils", "ember-htmlbars/keywords/mut"], function (exports, _emberMetalStreamsUtils, _emberHtmlbarsKeywordsMut) { - "use strict"; +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/hooks/get-cell-or-value', ['exports', 'ember-metal/streams/utils', 'ember-htmlbars/keywords/mut'], function (exports, _emberMetalStreamsUtils, _emberHtmlbarsKeywordsMut) { + exports.default = getCellOrValue; - exports["default"] = getCellOrValue; - function getCellOrValue(ref) { if (ref && ref[_emberHtmlbarsKeywordsMut.MUTABLE_REFERENCE]) { // reify the mutable reference into a mutable cell return ref.cell(); } // get the value out of the reference return _emberMetalStreamsUtils.read(ref); } }); -enifed("ember-htmlbars/hooks/get-child", ["exports", "ember-metal/streams/utils"], function (exports, _emberMetalStreamsUtils) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/hooks/get-child', ['exports', 'ember-metal/streams/utils'], function (exports, _emberMetalStreamsUtils) { + exports.default = getChild; - "use strict"; - - exports["default"] = getChild; - function getChild(parent, key) { if (_emberMetalStreamsUtils.isStream(parent)) { return parent.getKey(key); } @@ -7934,28 +7412,25 @@ // That might change if it is possible to pass object literals // through the templating system. return parent[key]; } }); -enifed("ember-htmlbars/hooks/get-root", ["exports", "ember-metal/core", "ember-metal/path_cache", "ember-metal/streams/proxy-stream"], function (exports, _emberMetalCore, _emberMetalPath_cache, _emberMetalStreamsProxyStream) { - /** - @module ember - @submodule ember-htmlbars - */ +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/hooks/get-root', ['exports', 'ember-metal/core', 'ember-metal/path_cache', 'ember-metal/streams/proxy-stream'], function (exports, _emberMetalCore, _emberMetalPath_cache, _emberMetalStreamsProxyStream) { + exports.default = getRoot; - "use strict"; - - exports["default"] = getRoot; - function getRoot(scope, key) { if (key === 'this') { return [scope.self]; } else if (key === 'hasBlock') { - return [!!scope.blocks["default"]]; + return [!!scope.blocks.default]; } else if (key === 'hasBlockParams') { - return [!!(scope.blocks["default"] && scope.blocks["default"].arity)]; - } else if (_emberMetalPath_cache.isGlobal(key) && _emberMetalCore["default"].lookup[key]) { + return [!!(scope.blocks.default && scope.blocks.default.arity)]; + } else if (_emberMetalPath_cache.isGlobal(key) && _emberMetalCore.default.lookup[key]) { return [getGlobal(key)]; } else if (key in scope.locals) { return [scope.locals[key]]; } else { return [getKey(scope, key)]; @@ -7980,38 +7455,37 @@ function getGlobal(name) { // This stream should be memoized, but this path is deprecated and // will be removed soon so it's not worth the trouble. - return new _emberMetalStreamsProxyStream["default"](_emberMetalCore["default"].lookup[name], name); + return new _emberMetalStreamsProxyStream.default(_emberMetalCore.default.lookup[name], name); } }); -enifed("ember-htmlbars/hooks/get-value", ["exports", "ember-metal/streams/utils", "ember-views/compat/attrs-proxy"], function (exports, _emberMetalStreamsUtils, _emberViewsCompatAttrsProxy) { - /** - @module ember - @submodule ember-htmlbars - */ +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/hooks/get-value', ['exports', 'ember-metal/streams/utils', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalStreamsUtils, _emberViewsCompatAttrsProxy) { + exports.default = getValue; - "use strict"; - - exports["default"] = getValue; - function getValue(ref) { var value = _emberMetalStreamsUtils.read(ref); if (value && value[_emberViewsCompatAttrsProxy.MUTABLE_CELL]) { return value.value; } return value; } }); -enifed("ember-htmlbars/hooks/has-helper", ["exports", "ember-htmlbars/system/lookup-helper"], function (exports, _emberHtmlbarsSystemLookupHelper) { - "use strict"; +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/hooks/has-helper', ['exports', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberHtmlbarsSystemLookupHelper) { + exports.default = hasHelperHook; - exports["default"] = hasHelperHook; - function hasHelperHook(env, scope, helperName) { if (env.helpers[helperName]) { return true; } @@ -8024,15 +7498,13 @@ } return false; } }); -enifed("ember-htmlbars/hooks/invoke-helper", ["exports", "ember-metal/core", "ember-htmlbars/system/invoke-helper", "ember-htmlbars/utils/subscribe"], function (exports, _emberMetalCore, _emberHtmlbarsSystemInvokeHelper, _emberHtmlbarsUtilsSubscribe) { - "use strict"; +enifed('ember-htmlbars/hooks/invoke-helper', ['exports', 'ember-metal/core', 'ember-htmlbars/system/invoke-helper', 'ember-htmlbars/utils/subscribe'], function (exports, _emberMetalCore, _emberHtmlbarsSystemInvokeHelper, _emberHtmlbarsUtilsSubscribe) { + exports.default = invokeHelper; - exports["default"] = invokeHelper; - function invokeHelper(morph, env, scope, visitor, params, hash, helper, templates, context) { if (helper.isLegacyViewHelper) { env.hooks.keyword('view', morph, env, scope, [helper.viewClass], hash, templates.template.raw, null, visitor); @@ -8058,11 +7530,11 @@ for (var key in hash) { addedDependency = true; helperStream.addDependency(hash[key]); } if (addedDependency) { - _emberHtmlbarsUtilsSubscribe["default"](morph, env, scope, helperStream); + _emberHtmlbarsUtilsSubscribe.default(morph, env, scope, helperStream); } } return { link: true, value: helperStream }; } @@ -8070,20 +7542,13 @@ // Legacy helpers are not linkable, they must run every rerender return { value: helperStream.value() }; } }); // Ember.assert -enifed("ember-htmlbars/hooks/link-render-node", ["exports", "ember-htmlbars/utils/subscribe", "ember-runtime/utils", "ember-metal/streams/utils", "ember-htmlbars/system/lookup-helper"], function (exports, _emberHtmlbarsUtilsSubscribe, _emberRuntimeUtils, _emberMetalStreamsUtils, _emberHtmlbarsSystemLookupHelper) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/hooks/link-render-node', ['exports', 'ember-htmlbars/utils/subscribe', 'ember-runtime/utils', 'ember-metal/streams/utils', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberHtmlbarsUtilsSubscribe, _emberRuntimeUtils, _emberMetalStreamsUtils, _emberHtmlbarsSystemLookupHelper) { + exports.default = linkRenderNode; - "use strict"; - - exports["default"] = linkRenderNode; - function linkRenderNode(renderNode, env, scope, path, params, hash) { if (renderNode.streamUnsubscribers) { return true; } @@ -8098,12 +7563,10 @@ case 'unless': case 'if': params[0] = shouldDisplay(params[0]);break; case 'each': params[0] = eachParam(params[0]);break; - case '@content-helper': - break; default: helper = _emberHtmlbarsSystemLookupHelper.findHelper(path, env.view, env); if (helper && helper.isHandlebarsCompat && params[0]) { params[0] = processHandlebarsCompatDepKeys(params[0], helper._dependentKeys); @@ -8111,17 +7574,17 @@ } } if (params && params.length) { for (var i = 0; i < params.length; i++) { - _emberHtmlbarsUtilsSubscribe["default"](renderNode, env, scope, params[i]); + _emberHtmlbarsUtilsSubscribe.default(renderNode, env, scope, params[i]); } } if (hash) { for (var key in hash) { - _emberHtmlbarsUtilsSubscribe["default"](renderNode, env, scope, hash[key]); + _emberHtmlbarsUtilsSubscribe.default(renderNode, env, scope, hash[key]); } } // The params and hash can be reused; they don't need to be // recomputed on subsequent re-renders because they are @@ -8196,41 +7659,36 @@ } return stream; } }); -enifed("ember-htmlbars/hooks/lookup-helper", ["exports", "ember-htmlbars/system/lookup-helper"], function (exports, _emberHtmlbarsSystemLookupHelper) { - "use strict"; +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/hooks/lookup-helper', ['exports', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberHtmlbarsSystemLookupHelper) { + exports.default = lookupHelperHook; - exports["default"] = lookupHelperHook; - function lookupHelperHook(env, scope, helperName) { - return _emberHtmlbarsSystemLookupHelper["default"](helperName, scope.self, env); + return _emberHtmlbarsSystemLookupHelper.default(helperName, scope.self, env); } }); -enifed("ember-htmlbars/hooks/subexpr", ["exports", "ember-htmlbars/system/lookup-helper", "ember-htmlbars/system/invoke-helper", "ember-metal/streams/utils"], function (exports, _emberHtmlbarsSystemLookupHelper, _emberHtmlbarsSystemInvokeHelper, _emberMetalStreamsUtils) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/hooks/subexpr', ['exports', 'ember-htmlbars/system/lookup-helper', 'ember-htmlbars/system/invoke-helper', 'ember-metal/streams/utils'], function (exports, _emberHtmlbarsSystemLookupHelper, _emberHtmlbarsSystemInvokeHelper, _emberMetalStreamsUtils) { + exports.default = subexpr; - "use strict"; - - exports["default"] = subexpr; - function subexpr(env, scope, helperName, params, hash) { // TODO: Keywords and helper invocation should be integrated into // the subexpr hook upstream in HTMLBars. var keyword = env.hooks.keywords[helperName]; if (keyword) { return keyword(null, env, scope, params, hash, null, null); } var label = labelForSubexpr(params, hash, helperName); - var helper = _emberHtmlbarsSystemLookupHelper["default"](helperName, scope.self, env); + var helper = _emberHtmlbarsSystemLookupHelper.default(helperName, scope.self, env); - var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, { template: {}, inverse: {} }, env, scope, label); + var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, { template: {}, inverse: {} }, env, scope, null, label); for (var i = 0, l = params.length; i < l; i++) { helperStream.addDependency(params[i]); } @@ -8240,75 +7698,73 @@ return helperStream; } function labelForSubexpr(params, hash, helperName) { - return function () { - var paramsLabels = labelsForParams(params); - var hashLabels = labelsForHash(hash); - var label = "(" + helperName; - if (paramsLabels) { - label += " " + paramsLabels; - } - if (hashLabels) { - label += " " + hashLabels; - } - return label + ")"; - }; + var paramsLabels = labelsForParams(params); + var hashLabels = labelsForHash(hash); + var label = '(' + helperName; + + if (paramsLabels) { + label += ' ' + paramsLabels; + } + if (hashLabels) { + label += ' ' + hashLabels; + } + + return label + ')'; } function labelsForParams(params) { - return _emberMetalStreamsUtils.labelsFor(params).join(" "); + return _emberMetalStreamsUtils.labelsFor(params).join(' '); } function labelsForHash(hash) { var out = []; for (var prop in hash) { - out.push(prop + "=" + _emberMetalStreamsUtils.labelFor(hash[prop])); + out.push(prop + '=' + _emberMetalStreamsUtils.labelFor(hash[prop])); } - return out.join(" "); + return out.join(' '); } }); -enifed("ember-htmlbars/hooks/update-self", ["exports", "ember-metal/property_get", "ember-htmlbars/utils/update-scope"], function (exports, _emberMetalProperty_get, _emberHtmlbarsUtilsUpdateScope) { - /** - @module ember - @submodule ember-htmlbars - */ +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/hooks/update-self', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-htmlbars/utils/update-scope'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberHtmlbarsUtilsUpdateScope) { + exports.default = updateSelf; - "use strict"; - - exports["default"] = updateSelf; - function updateSelf(env, scope, _self) { var self = _self; if (self && self.hasBoundController) { - var _self2 = self; - var controller = _self2.controller; + var controller = self.controller; self = self.self; - _emberHtmlbarsUtilsUpdateScope["default"](scope.locals, 'controller', controller || self); + _emberHtmlbarsUtilsUpdateScope.default(scope.locals, 'controller', controller || self); } if (self && self.isView) { - _emberHtmlbarsUtilsUpdateScope["default"](scope.locals, 'view', self, null); - _emberHtmlbarsUtilsUpdateScope["default"](scope, 'self', _emberMetalProperty_get.get(self, 'context'), null, true); + _emberHtmlbarsUtilsUpdateScope.default(scope.locals, 'view', self, null); + _emberHtmlbarsUtilsUpdateScope.default(scope, 'self', _emberMetalProperty_get.get(self, 'context'), null, true); return; } - _emberHtmlbarsUtilsUpdateScope["default"](scope, 'self', self, null); + _emberHtmlbarsUtilsUpdateScope.default(scope, 'self', self, null); } }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed("ember-htmlbars/hooks/will-cleanup-tree", ["exports"], function (exports) { - "use strict"; + exports.default = willCleanupTree; - exports["default"] = willCleanupTree; - function willCleanupTree(env) { var view = env.view; // When we go to clean up the render node and all of its children, we may // encounter views/components associated with those nodes along the way. In @@ -8338,25 +7794,18 @@ // untouched. This view is then cleared once cleanup is complete in // `didCleanupTree`. view.ownerView._destroyingSubtreeForView = view; } }); -enifed("ember-htmlbars/keywords", ["exports", "htmlbars-runtime", "ember-metal/platform/create"], function (exports, _htmlbarsRuntime, _emberMetalPlatformCreate) { - /** - @module ember - @submodule ember-htmlbars - */ - - "use strict"; - +enifed('ember-htmlbars/keywords', ['exports', 'htmlbars-runtime'], function (exports, _htmlbarsRuntime) { exports.registerKeyword = registerKeyword; /** @private @property helpers */ - var keywords = _emberMetalPlatformCreate["default"](_htmlbarsRuntime.hooks.keywords); + var keywords = Object.create(_htmlbarsRuntime.hooks.keywords); /** @module ember @submodule ember-htmlbars */ @@ -8371,145 +7820,18 @@ function registerKeyword(name, keyword) { keywords[name] = keyword; } - exports["default"] = keywords; + exports.default = keywords; }); -enifed("ember-htmlbars/keywords/collection", ["exports", "ember-views/streams/utils", "ember-views/views/collection_view", "ember-htmlbars/node-managers/view-node-manager", "ember-metal/keys", "ember-metal/merge"], function (exports, _emberViewsStreamsUtils, _emberViewsViewsCollection_view, _emberHtmlbarsNodeManagersViewNodeManager, _emberMetalKeys, _emberMetalMerge) { - /** - @module ember - @submodule ember-templates - */ - - "use strict"; - - /** - `{{collection}}` is a template helper for adding instances of - `Ember.CollectionView` to a template. See [Ember.CollectionView](/api/classes/Ember.CollectionView.html) - for additional information on how a `CollectionView` functions. - - `{{collection}}`'s primary use is as a block helper with a `contentBinding` - option pointing towards an `Ember.Array`-compatible object. An `Ember.View` - instance will be created for each item in its `content` property. Each view - will have its own `content` property set to the appropriate item in the - collection. - - The provided block will be applied as the template for each item's view. - - Given an empty `<body>` the following template: - - ```handlebars - {{! application.hbs }} - {{#collection content=model}} - Hi {{view.content.name}} - {{/collection}} - ``` - - And the following application code - - ```javascript - App = Ember.Application.create(); - App.ApplicationRoute = Ember.Route.extend({ - model: function() { - return [{name: 'Yehuda'},{name: 'Tom'},{name: 'Peter'}]; - } - }); - ``` - - The following HTML will result: - - ```html - <div class="ember-view"> - <div class="ember-view">Hi Yehuda</div> - <div class="ember-view">Hi Tom</div> - <div class="ember-view">Hi Peter</div> - </div> - ``` - - ### Non-block version of collection - - If you provide an `itemViewClass` option that has its own `template` you may - omit the block. - - The following template: - - ```handlebars - {{! application.hbs }} - {{collection content=model itemViewClass="an-item"}} - ``` - - And application code - - ```javascript - App = Ember.Application.create(); - App.ApplicationRoute = Ember.Route.extend({ - model: function() { - return [{name: 'Yehuda'},{name: 'Tom'},{name: 'Peter'}]; - } - }); - - App.AnItemView = Ember.View.extend({ - template: Ember.Handlebars.compile("Greetings {{view.content.name}}") - }); - ``` - - Will result in the HTML structure below - - ```html - <div class="ember-view"> - <div class="ember-view">Greetings Yehuda</div> - <div class="ember-view">Greetings Tom</div> - <div class="ember-view">Greetings Peter</div> - </div> - ``` - - ### Specifying a CollectionView subclass - - By default the `{{collection}}` helper will create an instance of - `Ember.CollectionView`. You can supply a `Ember.CollectionView` subclass to - the helper by passing it as the first argument: - - ```handlebars - {{#collection "my-custom-collection" content=model}} - Hi {{view.content.name}} - {{/collection}} - ``` - - This example would look for the class `App.MyCustomCollection`. - - ### Forwarded `item.*`-named Options - - As with the `{{view}}`, helper options passed to the `{{collection}}` will be - set on the resulting `Ember.CollectionView` as properties. Additionally, - options prefixed with `item` will be applied to the views rendered for each - item (note the camelcasing): - - ```handlebars - {{#collection content=model - itemTagName="p" - itemClassNames="greeting"}} - Howdy {{view.content.name}} - {{/collection}} - ``` - - Will result in the following HTML structure: - - ```html - <div class="ember-view"> - <p class="ember-view greeting">Howdy Yehuda</p> - <p class="ember-view greeting">Howdy Tom</p> - <p class="ember-view greeting">Howdy Peter</p> - </div> - ``` - - @method collection - @for Ember.Templates.helpers - @deprecated Use `{{each}}` helper instead. - @public - */ - exports["default"] = { +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/keywords/collection', ['exports', 'ember-views/streams/utils', 'ember-views/views/collection_view', 'ember-htmlbars/node-managers/view-node-manager', 'ember-metal/merge'], function (exports, _emberViewsStreamsUtils, _emberViewsViewsCollection_view, _emberHtmlbarsNodeManagersViewNodeManager, _emberMetalMerge) { + exports.default = { setupState: function (state, env, scope, params, hash) { var read = env.hooks.getValue; return _emberMetalMerge.assign({}, state, { parentView: env.view, @@ -8519,11 +7841,11 @@ rerender: function (morph, env, scope, params, hash, template, inverse, visitor) { // If the hash is empty, the component cannot have extracted a part // of a mutable param and used it in its layout, because there are // no params at all. - if (_emberMetalKeys["default"](hash).length) { + if (Object.keys(hash).length) { return morph.state.manager.rerender(env, hash, visitor, true); } }, render: function (node, env, scope, params, hash, template, inverse, visitor) { @@ -8544,86 +7866,35 @@ if (hash.emptyView) { hash.emptyViewClass = hash.emptyView; } - var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager["default"].create(node, env, hash, options, parentView, null, scope, template); + var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager.default.create(node, env, hash, options, parentView, null, scope, template); state.manager = nodeManager; nodeManager.render(env, hash, visitor); } }; function getView(viewPath, container) { var viewClassOrInstance; if (!viewPath) { - viewClassOrInstance = _emberViewsViewsCollection_view["default"]; + viewClassOrInstance = _emberViewsViewsCollection_view.default; } else { viewClassOrInstance = _emberViewsStreamsUtils.readViewFactory(viewPath, container); } return viewClassOrInstance; } }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed('ember-htmlbars/keywords/component', ['exports', 'ember-metal/merge'], function (exports, _emberMetalMerge) { - /** - @module ember - @submodule ember-templates - @public - */ - - 'use strict'; - - /** - The `{{component}}` helper lets you add instances of `Ember.Component` to a - template. See [Ember.Component](/api/classes/Ember.Component.html) for - additional information on how a `Component` functions. - `{{component}}`'s primary use is for cases where you want to dynamically - change which type of component is rendered as the state of your application - changes. The provided block will be applied as the template for the component. - Given an empty `<body>` the following template: - - ```handlebars - {{! application.hbs }} - {{component infographicComponentName}} - ``` - - And the following application code: - - ```javascript - export default Ember.Controller.extend({ - infographicComponentName: computed('isMarketOpen', { - get() { - if (this.get('isMarketOpen')) { - return 'live-updating-chart'; - } else { - return 'market-close-summary'; - } - } - }) - }); - ``` - - The `live-updating-chart` component will be appended when `isMarketOpen` is - `true`, and the `market-close-summary` component will be appended when - `isMarketOpen` is `false`. If the value changes while the app is running, - the component will be automatically swapped out accordingly. - Note: You should not use this helper when you are consistently rendering the same - component. In that case, use standard component syntax, for example: - - ```handlebars - {{! application.hbs }} - {{live-updating-chart}} - ``` - - @method component - @since 1.11.0 - @for Ember.Templates.helpers - @public - */ - exports["default"] = { + exports.default = { setupState: function (lastState, env, scope, params, hash) { var componentPath = env.hooks.getValue(params[0]); return _emberMetalMerge.assign({}, lastState, { componentPath: componentPath, isComponentHelper: true }); }, @@ -8654,22 +7925,15 @@ // don't create a new ComponentNode. if (componentPath === undefined || componentPath === null) { return; } - env.hooks.component(morph, env, scope, componentPath, params, hash, { "default": template, inverse: inverse }, visitor); + env.hooks.component(morph, env, scope, componentPath, params, hash, { default: template, inverse: inverse }, visitor); } }); -enifed("ember-htmlbars/keywords/customized_outlet", ["exports", "ember-htmlbars/node-managers/view-node-manager", "ember-views/streams/utils", "ember-metal/streams/utils"], function (exports, _emberHtmlbarsNodeManagersViewNodeManager, _emberViewsStreamsUtils, _emberMetalStreamsUtils) { - /** - @module ember - @submodule ember-htmlbars - */ - - "use strict"; - - exports["default"] = { +enifed('ember-htmlbars/keywords/customized_outlet', ['exports', 'ember-metal/core', 'ember-htmlbars/node-managers/view-node-manager', 'ember-views/streams/utils', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberHtmlbarsNodeManagersViewNodeManager, _emberViewsStreamsUtils, _emberMetalStreamsUtils) { + exports.default = { setupState: function (state, env, scope, params, hash) { var read = env.hooks.getValue; var viewClass = read(hash.viewClass) || _emberViewsStreamsUtils.readViewFactory(read(hash.view), env.container); return { viewClass: viewClass }; }, @@ -8678,28 +7942,24 @@ var parentView = env.view; var options = { component: state.viewClass }; - var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager["default"].create(renderNode, env, hash, options, parentView, null, null, null); + var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager.default.create(renderNode, env, hash, options, parentView, null, null, null); state.manager = nodeManager; nodeManager.render(env, hash, visitor); } }; }); -enifed("ember-htmlbars/keywords/debugger", ["exports", "ember-metal/logger"], function (exports, _emberMetalLogger) { - /*jshint debug:true*/ +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/keywords/debugger', ['exports', 'ember-metal/logger'], function (exports, _emberMetalLogger) { + exports.default = debuggerKeyword; /** - @module ember - @submodule ember-htmlbars - */ - "use strict"; - - exports["default"] = debuggerKeyword; - - /** Execute the `debugger` statement in the current template's context. ```handlebars {{debugger}} ``` @@ -8748,33 +8008,32 @@ function get(path) { return env.hooks.getValue(env.hooks.get(env, scope, path)); } - _emberMetalLogger["default"].info('Use `view`, `context`, and `get(<path>)` to debug this template.'); + _emberMetalLogger.default.info('Use `view`, `context`, and `get(<path>)` to debug this template.'); debugger; return true; } }); +/*jshint debug:true*/ + +/** +@module ember +@submodule ember-htmlbars +*/ enifed('ember-htmlbars/keywords/each', ['exports', 'ember-runtime/controllers/array_controller'], function (exports, _emberRuntimeControllersArray_controller) { - /** - @module ember - @submodule ember-htmlbars - */ + exports.default = each; - 'use strict'; - - exports["default"] = each; - function each(morph, env, scope, params, hash, template, inverse, visitor) { var getValue = env.hooks.getValue; var firstParam = params[0] && getValue(params[0]); var keyword = hash['-legacy-keyword'] && getValue(hash['-legacy-keyword']); - if (firstParam && firstParam instanceof _emberRuntimeControllersArray_controller["default"]) { + if (firstParam && firstParam instanceof _emberRuntimeControllersArray_controller.default) { env.hooks.block(morph, env, scope, '-legacy-each-with-controller', params, hash, template, inverse, visitor); return true; } if (keyword) { @@ -8783,264 +8042,137 @@ } return false; } }); -enifed("ember-htmlbars/keywords/input", ["exports", "ember-metal/core", "ember-metal/merge"], function (exports, _emberMetalCore, _emberMetalMerge) { - /** - @module ember - @submodule ember-templates - */ +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/keywords/get', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/streams/stream', 'ember-metal/streams/utils', 'ember-metal/merge'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberMetalMerge) { - "use strict"; + var getKeyword = function getKeyword(morph, env, scope, params, hash, template, inverse, visitor) { + var objParam = params[0]; + var pathParam = params[1]; - /** - The `{{input}}` helper lets you create an HTML `<input />` component. - It causes an `Ember.TextField` component to be rendered. For more info, - see the [Ember.TextField](/api/classes/Ember.TextField.html) docs and - the [templates guide](http://emberjs.com/guides/templates/input-helpers/). - - ```handlebars - {{input value="987"}} - ``` - - renders as: - - ```HTML - <input type="text" value="987" /> - ``` - - ### Text field - - If no `type` option is specified, a default of type 'text' is used. - - Many of the standard HTML attributes may be passed to this helper. - - <table> - <tr><td>`readonly`</td><td>`required`</td><td>`autofocus`</td></tr> - <tr><td>`value`</td><td>`placeholder`</td><td>`disabled`</td></tr> - <tr><td>`size`</td><td>`tabindex`</td><td>`maxlength`</td></tr> - <tr><td>`name`</td><td>`min`</td><td>`max`</td></tr> - <tr><td>`pattern`</td><td>`accept`</td><td>`autocomplete`</td></tr> - <tr><td>`autosave`</td><td>`formaction`</td><td>`formenctype`</td></tr> - <tr><td>`formmethod`</td><td>`formnovalidate`</td><td>`formtarget`</td></tr> - <tr><td>`height`</td><td>`inputmode`</td><td>`multiple`</td></tr> - <tr><td>`step`</td><td>`width`</td><td>`form`</td></tr> - <tr><td>`selectionDirection`</td><td>`spellcheck`</td><td>&nbsp;</td></tr> - </table> - - - When set to a quoted string, these values will be directly applied to the HTML - element. When left unquoted, these values will be bound to a property on the - template's current rendering context (most typically a controller instance). - - - A very common use of this helper is to bind the `value` of an input to an Object's attribute: - - ```handlebars - Search: - {{input value=searchWord}} - ``` - - In this example, the inital value in the `<input />` will be set to the value of `searchWord`. - If the user changes the text, the value of `searchWord` will also be updated. - - ### Actions - The helper can send multiple actions based on user events. - The action property defines the action which is sent when - the user presses the return key. - - ```handlebars - {{input action="submit"}} - ``` - - The helper allows some user events to send actions. - - * `enter` - * `insert-newline` - * `escape-press` - * `focus-in` - * `focus-out` - * `key-press` - * `key-up` - - - For example, if you desire an action to be sent when the input is blurred, - you only need to setup the action name to the event name property. - - ```handlebars - {{input focus-in="alertMessage"}} - ``` - - See more about [Text Support Actions](/api/classes/Ember.TextField.html) - - - ### Extending `Ember.TextField` - - Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing - arguments from the helper to `Ember.TextField`'s `create` method. You can extend the - capabilities of text inputs in your applications by reopening this class. For example, - if you are building a Bootstrap project where `data-*` attributes are used, you - can add one to the `TextField`'s `attributeBindings` property: - - - ```javascript - Ember.TextField.reopen({ - attributeBindings: ['data-error'] - }); - ``` - - Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField` - itself extends `Ember.Component`. Expect isolated component semantics, not - legacy 1.x view semantics (like `controller` being present). - - See more about [Ember components](/api/classes/Ember.Component.html) - - - ### Checkbox - - Checkboxes are special forms of the `{{input}}` helper. To create a `<checkbox />`: - - ```handlebars - Emberize Everything: - {{input type="checkbox" name="isEmberized" checked=isEmberized}} - ``` - - This will bind checked state of this checkbox to the value of `isEmberized` -- if either one changes, - it will be reflected in the other. - - - The following HTML attributes can be set via the helper: - - * `checked` - * `disabled` - * `tabindex` - * `indeterminate` - * `name` - * `autofocus` - * `form` - - - ### Extending `Ember.Checkbox` - - Internally, `{{input type="checkbox"}}` creates an instance of `Ember.Checkbox`, passing - arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the - capablilties of checkbox inputs in your applications by reopening this class. For example, - if you wanted to add a css class to all checkboxes in your application: - - ```javascript - Ember.Checkbox.reopen({ - classNames: ['my-app-checkbox'] - }); - ``` - - - @method input - @for Ember.Templates.helpers - @param {Hash} options - @public - */ - exports["default"] = { + + var getStream = new GetStream(objParam, pathParam); + + if (morph === null) { + return getStream; + } else { + env.hooks.inline(morph, env, scope, '-get', [getStream], hash, visitor); + } + + return true; + }; + + var GetStream = function GetStream(obj, path) { + this.init('(get ' + _emberMetalStreamsUtils.labelFor(obj) + ' ' + _emberMetalStreamsUtils.labelFor(path) + ')'); + + this.objectParam = obj; + this.pathParam = path; + this.lastPathValue = undefined; + this.valueDep = this.addMutableDependency(); + + this.addDependency(path); + + // This next line is currently only required when the keyword + // is executed in a subexpression. More investigation required + // to remove the additional dependency + this.addDependency(obj); + }; + + GetStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); + + _emberMetalMerge.default(GetStream.prototype, { + updateValueDependency: function () { + var pathValue = _emberMetalStreamsUtils.read(this.pathParam); + + if (this.lastPathValue !== pathValue) { + if (typeof pathValue === 'string') { + this.valueDep.replace(this.objectParam.get(pathValue)); + } else { + this.valueDep.replace(); + } + + this.lastPathValue = pathValue; + } + }, + + compute: function () { + this.updateValueDependency(); + return this.valueDep.getValue(); + }, + + setValue: function (value) { + this.updateValueDependency(); + this.valueDep.setValue(value); + } + + }); + + exports.default = getKeyword; +}); +enifed('ember-htmlbars/keywords/input', ['exports', 'ember-metal/core', 'ember-metal/merge'], function (exports, _emberMetalCore, _emberMetalMerge) { + exports.default = { setupState: function (lastState, env, scope, params, hash) { var type = env.hooks.getValue(hash.type); var componentName = componentNameMap[type] || defaultComponentName; return _emberMetalMerge.assign({}, lastState, { componentName: componentName }); }, render: function (morph, env, scope, params, hash, template, inverse, visitor) { - env.hooks.component(morph, env, scope, morph.state.componentName, params, hash, { "default": template, inverse: inverse }, visitor); + env.hooks.component(morph, env, scope, morph.state.componentName, params, hash, { default: template, inverse: inverse }, visitor); }, rerender: function () { this.render.apply(this, arguments); } }; - var defaultComponentName = "-text-field"; + var defaultComponentName = '-text-field'; var componentNameMap = { 'checkbox': '-checkbox' }; }); -enifed("ember-htmlbars/keywords/legacy-yield", ["exports", "ember-metal/streams/proxy-stream"], function (exports, _emberMetalStreamsProxyStream) { - "use strict"; +enifed('ember-htmlbars/keywords/legacy-yield', ['exports', 'ember-metal/streams/proxy-stream'], function (exports, _emberMetalStreamsProxyStream) { + exports.default = legacyYield; - exports["default"] = legacyYield; - function legacyYield(morph, env, _scope, params, hash, template, inverse, visitor) { var scope = _scope; - if (scope.blocks["default"].arity === 0) { + if (scope.blocks.default.arity === 0) { // Typically, the `controller` local is persists through lexical scope. // However, in this case, the `{{legacy-yield}}` in the legacy each view // needs to override the controller local for the template it is yielding. // This megahaxx allows us to override the controller, and most importantly, // prevents the downstream scope from attempting to bind the `controller` local. if (hash.controller) { scope = env.hooks.createChildScope(scope); - scope.locals.controller = new _emberMetalStreamsProxyStream["default"](hash.controller, "controller"); + scope.locals.controller = new _emberMetalStreamsProxyStream.default(hash.controller, 'controller'); scope.overrideController = true; } - scope.blocks["default"](env, [], params[0], morph, scope, visitor); + scope.blocks.default(env, [], params[0], morph, scope, visitor); } else { - scope.blocks["default"](env, params, undefined, morph, scope, visitor); + scope.blocks.default(env, params, undefined, morph, scope, visitor); } return true; } }); -enifed("ember-htmlbars/keywords/mut", ["exports", "ember-metal/core", "ember-metal/platform/create", "ember-metal/merge", "ember-metal/utils", "ember-metal/streams/proxy-stream", "ember-metal/streams/utils", "ember-metal/streams/stream", "ember-views/compat/attrs-proxy", "ember-routing-htmlbars/keywords/closure-action"], function (exports, _emberMetalCore, _emberMetalPlatformCreate, _emberMetalMerge, _emberMetalUtils, _emberMetalStreamsProxyStream, _emberMetalStreamsUtils, _emberMetalStreamsStream, _emberViewsCompatAttrsProxy, _emberRoutingHtmlbarsKeywordsClosureAction) { - "use strict"; - +enifed('ember-htmlbars/keywords/mut', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/utils', 'ember-metal/streams/proxy-stream', 'ember-metal/streams/utils', 'ember-metal/streams/stream', 'ember-views/compat/attrs-proxy', 'ember-routing-htmlbars/keywords/closure-action'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalUtils, _emberMetalStreamsProxyStream, _emberMetalStreamsUtils, _emberMetalStreamsStream, _emberViewsCompatAttrsProxy, _emberRoutingHtmlbarsKeywordsClosureAction) { var _merge; - exports["default"] = mut; + exports.default = mut; exports.privateMut = privateMut; + var MUTABLE_REFERENCE = _emberMetalUtils.symbol('MUTABLE_REFERENCE'); - /** - @module ember - @submodule ember-templates - */ - - var MUTABLE_REFERENCE = _emberMetalUtils.symbol("MUTABLE_REFERENCE"); - exports.MUTABLE_REFERENCE = MUTABLE_REFERENCE; - /** - The `mut` helper lets you __clearly specify__ that a child `Component` can update the - (mutable) value passed to it, which will __change the value of the parent component__. - - This is very helpful for passing mutable values to a `Component` of any size, but - critical to understanding the logic of a large/complex `Component`. - - To specify that a parameter is mutable, when invoking the child `Component`: - - ```handlebars - <my-child child-click-count={{mut totalClicks}} /> - ``` - - The child `Component` can then modify the parent's value as needed: - - ```javascript - // my-child.js - export default Component.extend({ - click: function() { - this.attrs.childClickCount.update(this.attrs.childClickCount.value + 1); - } - }); - ``` - - See a [2.0 blog post](http://emberjs.com/blog/2015/05/10/run-up-to-two-oh.html#toc_the-code-mut-code-helper) for - additional information on using `{{mut}}`. - - @public - @method mut - @param {Object} [attr] the "two-way" attribute that can be modified. - @for Ember.Templates.helpers - @public - */ function mut(morph, env, scope, originalParams, hash, template, inverse) { // If `morph` is `null` the keyword is being invoked as a subexpression. if (morph === null) { var valueStream = originalParams[0]; @@ -9063,13 +8195,13 @@ function mutParam(read, stream, internal) { if (internal) { if (!_emberMetalStreamsUtils.isStream(stream)) { (function () { var literal = stream; - stream = new _emberMetalStreamsStream["default"](function () { + stream = new _emberMetalStreamsStream.default(function () { return literal; - }, "(literal " + literal + ")"); + }, '(literal ' + literal + ')'); stream.setValue = function (newValue) { literal = newValue; stream.notify(); }; })(); @@ -9083,19 +8215,19 @@ return new MutStream(stream); } function MutStream(stream) { - this.init("(mut " + stream.label + ")"); + this.init('(mut ' + stream.label + ')'); this.path = stream.path; this.sourceDep = this.addMutableDependency(stream); this[MUTABLE_REFERENCE] = true; } - MutStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsProxyStream["default"].prototype); + MutStream.prototype = Object.create(_emberMetalStreamsProxyStream.default.prototype); - _emberMetalMerge["default"](MutStream.prototype, (_merge = { + _emberMetalMerge.default(MutStream.prototype, (_merge = { cell: function () { var source = this; var value = source.value(); if (value && value[_emberRoutingHtmlbarsKeywordsClosureAction.ACTION]) { @@ -9114,158 +8246,61 @@ } }, _merge[_emberRoutingHtmlbarsKeywordsClosureAction.INVOKE] = function (val) { this.setValue(val); }, _merge)); }); -enifed('ember-htmlbars/keywords/outlet', ['exports', 'htmlbars-runtime/hooks'], function (exports, _htmlbarsRuntimeHooks) { - /** - @module ember - @submodule ember-templates - */ +enifed('ember-htmlbars/keywords/outlet', ['exports', 'ember-metal/core', 'htmlbars-runtime/hooks'], function (exports, _emberMetalCore, _htmlbarsRuntimeHooks) { - 'use strict'; - - /** - The `{{outlet}}` helper lets you specify where a child routes will render in - your template. An important use of the `{{outlet}}` helper is in your - application's `application.hbs` file: - ```handlebars - {{! app/templates/application.hbs }} - <!-- header content goes here, and will always display --> - {{my-header}} - <div class="my-dynamic-content"> - <!-- this content will change based on the current route, which depends on the current URL --> - {{outlet}} - </div> - <!-- footer content goes here, and will always display --> - {{my-footer}} - ``` - See [templates guide](http://emberjs.com/guides/templates/the-application-template/) for - additional information on using `{{outlet}}` in `application.hbs`. - You may also specify a name for the `{{outlet}}`, which is useful when using more than one - `{{outlet}}` in a template: - ```handlebars - {{outlet "menu"}} - {{outlet "sidebar"}} - {{outlet "main"}} - ``` - Your routes can then render into a specific one of these `outlet`s by specifying the `outlet` - attribute in your `renderTemplate` function: - ```javascript - // app/routes/menu.js - export default Ember.Route.extend({ - renderTemplate() { - this.render({ outlet: 'menu' }); - } - }); - ``` - See the [routing guide](http://emberjs.com/guides/routing/rendering-a-template/) for more - information on how your `route` interacts with the `{{outlet}}` helper. - Note: Your content __will not render__ if there isn't an `{{outlet}}` for it. - @public - @method outlet - @param {String} [name] - @for Ember.Templates.helpers - @public - */ - /* This level of delegation handles backward-compatibility with the `view` parameter to {{outlet}}. When we drop support for the `view` parameter in 2.0, this keyword should just get replaced directly with @real_outlet. */ - exports["default"] = function (morph, env, scope, params, hash, template, inverse, visitor) { + exports.default = function (morph, env, scope, params, hash, template, inverse, visitor) { if (hash.hasOwnProperty('view') || hash.hasOwnProperty('viewClass')) { _htmlbarsRuntimeHooks.keyword('@customized_outlet', morph, env, scope, params, hash, template, inverse, visitor); } else { _htmlbarsRuntimeHooks.keyword('@real_outlet', morph, env, scope, params, hash, template, inverse, visitor); } return true; }; }); -enifed("ember-htmlbars/keywords/partial", ["exports", "ember-views/system/lookup_partial", "htmlbars-runtime"], function (exports, _emberViewsSystemLookup_partial, _htmlbarsRuntime) { - /** - @module ember - @submodule ember-templates - */ - - "use strict"; - - /** - The `partial` helper renders another template without - changing the template context: - - ```handlebars - {{foo}} - {{partial "nav"}} - ``` - - The above example template will render a template named - "_nav", which has the same context as the parent template - it's rendered into, so if the "_nav" template also referenced - `{{foo}}`, it would print the same thing as the `{{foo}}` - in the above example. - - If a "_nav" template isn't found, the `partial` helper will - fall back to a template named "nav". - - ### Bound template names - - The parameter supplied to `partial` can also be a path - to a property containing a template name, e.g.: - - ```handlebars - {{partial someTemplateName}} - ``` - - The above example will look up the value of `someTemplateName` - on the template context (e.g. a controller) and use that - value as the name of the template to render. If the resolved - value is falsy, nothing will be rendered. If `someTemplateName` - changes, the partial will be re-rendered using the new template - name. - - - @method partial - @for Ember.Templates.helpers - @param {String} partialName the name of the template to render minus the leading underscore - @public - */ - - exports["default"] = { +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/keywords/partial', ['exports', 'ember-views/system/lookup_partial', 'htmlbars-runtime'], function (exports, _emberViewsSystemLookup_partial, _htmlbarsRuntime) { + exports.default = { setupState: function (state, env, scope, params, hash) { return { partialName: env.hooks.getValue(params[0]) }; }, render: function (renderNode, env, scope, params, hash, template, inverse, visitor) { var state = renderNode.state; if (!state.partialName) { return true; } - var found = _emberViewsSystemLookup_partial["default"](env, state.partialName); + var found = _emberViewsSystemLookup_partial.default(env, state.partialName); if (!found) { return true; } _htmlbarsRuntime.internal.hostBlock(renderNode, env, scope, found.raw, null, null, visitor, function (options) { - options.templates.template["yield"](); + options.templates.template.yield(); }); } }; }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed('ember-htmlbars/keywords/readonly', ['exports', 'ember-htmlbars/keywords/mut'], function (exports, _emberHtmlbarsKeywordsMut) { - /** - @module ember - @submodule ember-templates - */ + exports.default = readonly; - 'use strict'; - - exports["default"] = readonly; - function readonly(morph, env, scope, originalParams, hash, template, inverse) { // If `morph` is `null` the keyword is being invoked as a subexpression. if (morph === null) { var stream = originalParams[0]; if (stream && stream[_emberHtmlbarsKeywordsMut.MUTABLE_REFERENCE]) { @@ -9275,21 +8310,14 @@ } return true; } }); -enifed("ember-htmlbars/keywords/real_outlet", ["exports", "ember-metal/property_get", "ember-htmlbars/node-managers/view-node-manager", "ember-htmlbars/templates/top-level-view"], function (exports, _emberMetalProperty_get, _emberHtmlbarsNodeManagersViewNodeManager, _emberHtmlbarsTemplatesTopLevelView) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/keywords/real_outlet', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-htmlbars/node-managers/view-node-manager', 'ember-htmlbars/templates/top-level-view'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberHtmlbarsNodeManagersViewNodeManager, _emberHtmlbarsTemplatesTopLevelView) { + _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.2'; - "use strict"; - - _emberHtmlbarsTemplatesTopLevelView["default"].meta.revision = 'Ember@1.13.13'; - - exports["default"] = { + exports.default = { willRender: function (renderNode, env) { env.view.ownerView._outlets.push(renderNode); }, setupState: function (state, env, scope, params, hash) { @@ -9298,11 +8326,11 @@ var outletName = read(params[0]) || 'main'; var selectedOutletState = outletState[outletName]; var toRender = selectedOutletState && selectedOutletState.render; if (toRender && !toRender.template && !toRender.ViewClass) { - toRender.template = _emberHtmlbarsTemplatesTopLevelView["default"]; + toRender.template = _emberHtmlbarsTemplatesTopLevelView.default; } return { outletState: selectedOutletState, hasParentOutlet: env.hasParentOutlet, @@ -9345,23 +8373,19 @@ }; template = template || toRender.template && toRender.template.raw; if (LOG_VIEW_LOOKUPS && ViewClass) { - } - - if (state.manager) { - state.manager.destroy(); - state.manager = null; + _emberMetalCore.default.Logger.info('Rendering ' + toRender.name + ' with ' + ViewClass, { fullName: 'view:' + toRender.name }); } if (state.manager) { state.manager.destroy(); state.manager = null; } - var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager["default"].create(renderNode, env, {}, options, parentView, null, null, template); + var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager.default.create(renderNode, env, {}, options, parentView, null, null, template); state.manager = nodeManager; nodeManager.render(env, hash, visitor); } }; @@ -9390,262 +8414,44 @@ } } return true; } }); -enifed("ember-htmlbars/keywords/template", ["exports", "ember-metal/core"], function (exports, _emberMetalCore) { - "use strict"; +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/keywords/template', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + exports.default = templateKeyword; + var deprecation = 'The `template` helper has been deprecated in favor of the `partial` helper.'; - exports["default"] = templateKeyword; - var deprecation = "The `template` helper has been deprecated in favor of the `partial` helper."; - exports.deprecation = deprecation; function templateKeyword(morph, env, scope, params, hash, template, inverse, visitor) { env.hooks.keyword('partial', morph, env, scope, params, hash, template, inverse, visitor); return true; } }); enifed('ember-htmlbars/keywords/textarea', ['exports'], function (exports) { + exports.default = textarea; /** @module ember - @submodule ember-templates + @submodule ember-htmlbars */ - /** - `{{textarea}}` inserts a new instance of `<textarea>` tag into the template. - The attributes of `{{textarea}}` match those of the native HTML tags as - closely as possible. - - The following HTML attributes can be set: - - * `value` - * `name` - * `rows` - * `cols` - * `placeholder` - * `disabled` - * `maxlength` - * `tabindex` - * `selectionEnd` - * `selectionStart` - * `selectionDirection` - * `wrap` - * `readonly` - * `autofocus` - * `form` - * `spellcheck` - * `required` - - When set to a quoted string, these value will be directly applied to the HTML - element. When left unquoted, these values will be bound to a property on the - template's current rendering context (most typically a controller instance). - - Unbound: - - ```handlebars - {{textarea value="Lots of static text that ISN'T bound"}} - ``` - - Would result in the following HTML: - - ```html - <textarea class="ember-text-area"> - Lots of static text that ISN'T bound - </textarea> - ``` - - Bound: - - In the following example, the `writtenWords` property on `App.ApplicationController` - will be updated live as the user types 'Lots of text that IS bound' into - the text area of their browser's window. - - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound" - }); - ``` - - ```handlebars - {{textarea value=writtenWords}} - ``` - - Would result in the following HTML: - - ```html - <textarea class="ember-text-area"> - Lots of text that IS bound - </textarea> - ``` - - If you wanted a one way binding between the text area and a div tag - somewhere else on your screen, you could use `Ember.computed.oneWay`: - - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound", - outputWrittenWords: Ember.computed.oneWay("writtenWords") - }); - ``` - - ```handlebars - {{textarea value=writtenWords}} - - <div> - {{outputWrittenWords}} - </div> - ``` - - Would result in the following HTML: - - ```html - <textarea class="ember-text-area"> - Lots of text that IS bound - </textarea> - - <-- the following div will be updated in real time as you type --> - - <div> - Lots of text that IS bound - </div> - ``` - - Finally, this example really shows the power and ease of Ember when two - properties are bound to eachother via `Ember.computed.alias`. Type into - either text area box and they'll both stay in sync. Note that - `Ember.computed.alias` costs more in terms of performance, so only use it when - your really binding in both directions: - - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound", - twoWayWrittenWords: Ember.computed.alias("writtenWords") - }); - ``` - - ```handlebars - {{textarea value=writtenWords}} - {{textarea value=twoWayWrittenWords}} - ``` - - ```html - <textarea id="ember1" class="ember-text-area"> - Lots of text that IS bound - </textarea> - - <-- both updated in real time --> - - <textarea id="ember2" class="ember-text-area"> - Lots of text that IS bound - </textarea> - ``` - - ### Actions - - The helper can send multiple actions based on user events. - - The action property defines the action which is send when - the user presses the return key. - - ```handlebars - {{input action="submit"}} - ``` - - The helper allows some user events to send actions. - - * `enter` - * `insert-newline` - * `escape-press` - * `focus-in` - * `focus-out` - * `key-press` - - For example, if you desire an action to be sent when the input is blurred, - you only need to setup the action name to the event name property. - - ```handlebars - {{textarea focus-in="alertMessage"}} - ``` - - See more about [Text Support Actions](/api/classes/Ember.TextArea.html) - - ### Extension - - Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing - arguments from the helper to `Ember.TextArea`'s `create` method. You can - extend the capabilities of text areas in your application by reopening this - class. For example, if you are building a Bootstrap project where `data-*` - attributes are used, you can globally add support for a `data-*` attribute - on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or - `Ember.TextSupport` and adding it to the `attributeBindings` concatenated - property: - - ```javascript - Ember.TextArea.reopen({ - attributeBindings: ['data-error'] - }); - ``` - - Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea` - itself extends `Ember.Component`. Expect isolated component semantics, not - legacy 1.x view semantics (like `controller` being present). - - See more about [Ember components](/api/classes/Ember.Component.html) - - @method textarea - @for Ember.Templates.helpers - @param {Hash} options - @public - */ - 'use strict'; - - exports["default"] = textarea; - function textarea(morph, env, scope, originalParams, hash, template, inverse, visitor) { - env.hooks.component(morph, env, scope, '-text-area', originalParams, hash, { "default": template, inverse: inverse }, visitor); + env.hooks.component(morph, env, scope, '-text-area', originalParams, hash, { default: template, inverse: inverse }, visitor); return true; } }); -enifed("ember-htmlbars/keywords/unbound", ["exports", "ember-metal/merge", "ember-metal/platform/create", "ember-metal/streams/stream", "ember-metal/streams/utils"], function (exports, _emberMetalMerge, _emberMetalPlatformCreate, _emberMetalStreamsStream, _emberMetalStreamsUtils) { +enifed('ember-htmlbars/keywords/unbound', ['exports', 'ember-metal/merge', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalMerge, _emberMetalStreamsStream, _emberMetalStreamsUtils) { + exports.default = unbound; /** @module ember - @submodule ember-templates + @submodule ember-htmlbars */ - /** - The `{{unbound}}` helper disconnects the one-way binding of a property, - essentially freezing its value at the moment of rendering. For example, - in this example the display of the variable `name` will not change even - if it is set with a new value: - - ```handlebars - {{unbound name}} - ``` - - Like any helper, the `unbound` helper can accept a nested helper expression. - This allows for custom helpers to be rendered unbound: - - ```handlebars - {{unbound (some-custom-helper)}} - {{unbound (capitalize name)}} - {{! You can use any helper, including unbound, in a nested expression }} - {{capitalize (unbound name)}} - ``` - - The `unbound` helper only accepts a single argument, and it return an - unbound value. - - @method unbound - @for Ember.Templates.helpers - @public - */ - - "use strict"; - - exports["default"] = unbound; - function unbound(morph, env, scope, originalParams, hash, template, inverse) { // Since we already got the params as a set of streams, we need to extract the key from // the first param instead of (incorrectly) trying to read from it. If this was a call // to `{{unbound foo.bar}}`, then we pass along the original stream to `hooks.range`. var params = originalParams.slice(); @@ -9663,221 +8469,35 @@ if (params.length === 0) { env.hooks.range(morph, env, scope, null, valueStream); } else if (template === null) { env.hooks.inline(morph, env, scope, valueStream.key, params, hash); } else { - // deprecated via AST transform env.hooks.block(morph, env, scope, valueStream.key, params, hash, template, inverse); } return true; } function VolatileStream(source) { - this.init("(volatile " + source.label + ")"); + this.init('(volatile ' + source.label + ')'); this.source = source; this.addDependency(source); } - VolatileStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsStream["default"].prototype); + VolatileStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); - _emberMetalMerge["default"](VolatileStream.prototype, { + _emberMetalMerge.default(VolatileStream.prototype, { value: function () { return _emberMetalStreamsUtils.read(this.source); }, notify: function () {} }); }); -enifed("ember-htmlbars/keywords/view", ["exports", "ember-views/streams/utils", "ember-views/views/view", "ember-htmlbars/node-managers/view-node-manager", "ember-metal/keys"], function (exports, _emberViewsStreamsUtils, _emberViewsViewsView, _emberHtmlbarsNodeManagersViewNodeManager, _emberMetalKeys) { - /** - @module ember - @submodule ember-templates - */ - - "use strict"; - - /** - `{{view}}` inserts a new instance of an `Ember.View` into a template passing its - options to the `Ember.View`'s `create` method and using the supplied block as - the view's own template. - - An empty `<body>` and the following template: - - ```handlebars - A span: - {{#view tagName="span"}} - hello. - {{/view}} - ``` - - Will result in HTML structure: - - ```html - <body> - <!-- Note: the handlebars template script - also results in a rendered Ember.View - which is the outer <div> here --> - - <div class="ember-view"> - A span: - <span id="ember1" class="ember-view"> - Hello. - </span> - </div> - </body> - ``` - - ### `parentView` setting - - The `parentView` property of the new `Ember.View` instance created through - `{{view}}` will be set to the `Ember.View` instance of the template where - `{{view}}` was called. - - ```javascript - aView = Ember.View.create({ - template: Ember.Handlebars.compile("{{#view}} my parent: {{parentView.elementId}} {{/view}}") - }); - - aView.appendTo('body'); - ``` - - Will result in HTML structure: - - ```html - <div id="ember1" class="ember-view"> - <div id="ember2" class="ember-view"> - my parent: ember1 - </div> - </div> - ``` - - ### Setting CSS id and class attributes - - The HTML `id` attribute can be set on the `{{view}}`'s resulting element with - the `id` option. This option will _not_ be passed to `Ember.View.create`. - - ```handlebars - {{#view tagName="span" id="a-custom-id"}} - hello. - {{/view}} - ``` - - Results in the following HTML structure: - - ```html - <div class="ember-view"> - <span id="a-custom-id" class="ember-view"> - hello. - </span> - </div> - ``` - - The HTML `class` attribute can be set on the `{{view}}`'s resulting element - with the `class` or `classNameBindings` options. The `class` option will - directly set the CSS `class` attribute and will not be passed to - `Ember.View.create`. `classNameBindings` will be passed to `create` and use - `Ember.View`'s class name binding functionality: - - ```handlebars - {{#view tagName="span" class="a-custom-class"}} - hello. - {{/view}} - ``` - - Results in the following HTML structure: - - ```html - <div class="ember-view"> - <span id="ember2" class="ember-view a-custom-class"> - hello. - </span> - </div> - ``` - - ### Supplying a different view class - - `{{view}}` can take an optional first argument before its supplied options to - specify a path to a custom view class. - - ```handlebars - {{#view "custom"}}{{! will look up App.CustomView }} - hello. - {{/view}} - ``` - - The first argument can also be a relative path accessible from the current - context. - - ```javascript - MyApp = Ember.Application.create({}); - MyApp.OuterView = Ember.View.extend({ - innerViewClass: Ember.View.extend({ - classNames: ['a-custom-view-class-as-property'] - }), - template: Ember.Handlebars.compile('{{#view view.innerViewClass}} hi {{/view}}') - }); - - MyApp.OuterView.create().appendTo('body'); - ``` - - Will result in the following HTML: - - ```html - <div id="ember1" class="ember-view"> - <div id="ember2" class="ember-view a-custom-view-class-as-property"> - hi - </div> - </div> - ``` - - ### Blockless use - - If you supply a custom `Ember.View` subclass that specifies its own template - or provide a `templateName` option to `{{view}}` it can be used without - supplying a block. Attempts to use both a `templateName` option and supply a - block will throw an error. - - ```javascript - var App = Ember.Application.create(); - App.WithTemplateDefinedView = Ember.View.extend({ - templateName: 'defined-template' - }); - ``` - - ```handlebars - {{! application.hbs }} - {{view 'with-template-defined'}} - ``` - - ```handlebars - {{! defined-template.hbs }} - Some content for the defined template view. - ``` - - ### `viewName` property - - You can supply a `viewName` option to `{{view}}`. The `Ember.View` instance - will be referenced as a property of its parent view by this name. - - ```javascript - aView = Ember.View.create({ - template: Ember.Handlebars.compile('{{#view viewName="aChildByName"}} hi {{/view}}') - }); - - aView.appendTo('body'); - aView.get('aChildByName') // the instance of Ember.View created by {{view}} helper - ``` - - @method view - @for Ember.Templates.helpers - @public - @deprecated - */ - - exports["default"] = { +enifed('ember-htmlbars/keywords/view', ['exports', 'ember-views/streams/utils', 'ember-views/views/view', 'ember-htmlbars/node-managers/view-node-manager'], function (exports, _emberViewsStreamsUtils, _emberViewsViewsView, _emberHtmlbarsNodeManagersViewNodeManager) { + exports.default = { setupState: function (state, env, scope, params, hash) { var read = env.hooks.getValue; var targetObject = read(scope.self); var viewClassOrInstance = state.viewClassOrInstance; if (!viewClassOrInstance) { @@ -9899,11 +8519,11 @@ rerender: function (morph, env, scope, params, hash, template, inverse, visitor) { // If the hash is empty, the component cannot have extracted a part // of a mutable param and used it in its layout, because there are // no params at all. - if (_emberMetalKeys["default"](hash).length) { + if (Object.keys(hash).length) { return morph.state.manager.rerender(env, hash, visitor, true); } }, render: function (node, env, scope, params, hash, template, inverse, visitor) { @@ -9939,11 +8559,11 @@ if (state.manager) { state.manager.destroy(); state.manager = null; } - var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager["default"].create(node, env, hash, options, parentView, null, scope, template); + var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager.default.create(node, env, hash, options, parentView, null, scope, template); state.manager = nodeManager; nodeManager.render(env, hash, visitor); } }; @@ -9953,11 +8573,11 @@ if (!viewPath) { if (container) { viewClassOrInstance = container.lookupFactory('view:toplevel'); } else { - viewClassOrInstance = _emberViewsViewsView["default"]; + viewClassOrInstance = _emberViewsViewsView.default; } } else { viewClassOrInstance = _emberViewsStreamsUtils.readViewFactory(viewPath, container); } @@ -9976,19 +8596,16 @@ } return newHash; } }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed('ember-htmlbars/keywords/with', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'htmlbars-runtime', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalProperty_get, _htmlbarsRuntime, _emberMetalStreamsUtils) { - /** - @module ember - @submodule ember-templates - */ - - 'use strict'; - - exports["default"] = { + exports.default = { setupState: function (state, env, scope, params, hash) { var controller = hash.controller; if (controller) { if (!state.controller) { @@ -10043,41 +8660,39 @@ rerender: function (morph, env, scope, params, hash, template, inverse, visitor) { _htmlbarsRuntime.internal.continueBlock(morph, env, scope, 'with', params, hash, template, inverse, visitor); } }; }); -enifed("ember-htmlbars/morphs/attr-morph", ["exports", "ember-metal/core", "dom-helper", "ember-metal/platform/create"], function (exports, _emberMetalCore, _domHelper, _emberMetalPlatformCreate) { - "use strict"; +enifed('ember-htmlbars/morphs/attr-morph', ['exports', 'ember-metal/core', 'dom-helper'], function (exports, _emberMetalCore, _domHelper) { - var HTMLBarsAttrMorph = _domHelper["default"].prototype.AttrMorphClass; + var HTMLBarsAttrMorph = _domHelper.default.prototype.AttrMorphClass; var styleWarning = '' + 'Binding style attributes may introduce cross-site scripting vulnerabilities; ' + 'please ensure that values being bound are properly escaped. For more information, ' + 'including how to disable this warning, see ' + 'http://emberjs.com/deprecations/v1.x/#toc_binding-style-attributes.'; exports.styleWarning = styleWarning; function EmberAttrMorph(element, attrName, domHelper, namespace) { HTMLBarsAttrMorph.call(this, element, attrName, domHelper, namespace); this.streamUnsubscribers = null; } - var proto = EmberAttrMorph.prototype = _emberMetalPlatformCreate["default"](HTMLBarsAttrMorph.prototype); + var proto = EmberAttrMorph.prototype = Object.create(HTMLBarsAttrMorph.prototype); proto.HTMLBarsAttrMorph$setContent = HTMLBarsAttrMorph.prototype.setContent; proto._deprecateEscapedStyle = function EmberAttrMorph_deprecateEscapedStyle(value) { }; proto.setContent = function EmberAttrMorph_setContent(value) { this._deprecateEscapedStyle(value); this.HTMLBarsAttrMorph$setContent(value); }; - exports["default"] = EmberAttrMorph; + exports.default = EmberAttrMorph; }); -enifed("ember-htmlbars/morphs/morph", ["exports", "dom-helper", "ember-metal/platform/create"], function (exports, _domHelper, _emberMetalPlatformCreate) { - "use strict"; +enifed('ember-htmlbars/morphs/morph', ['exports', 'dom-helper'], function (exports, _domHelper) { - var HTMLBarsMorph = _domHelper["default"].prototype.MorphClass; + var HTMLBarsMorph = _domHelper.default.prototype.MorphClass; var guid = 1; function EmberMorph(DOMHelper, contextualElement) { this.HTMLBarsMorph$constructor(DOMHelper, contextualElement); @@ -10094,11 +8709,11 @@ // one of its attributes changed, which also triggers the attribute // update flag (didUpdateAttrs). this.shouldReceiveAttrs = false; } - var proto = EmberMorph.prototype = _emberMetalPlatformCreate["default"](HTMLBarsMorph.prototype); + var proto = EmberMorph.prototype = Object.create(HTMLBarsMorph.prototype); proto.HTMLBarsMorph$constructor = HTMLBarsMorph; proto.HTMLBarsMorph$clear = HTMLBarsMorph.prototype.clear; proto.addDestruction = function (toDestroy) { this.emberToDestroy = this.emberToDestroy || []; @@ -10128,15 +8743,13 @@ proto.didRender = function (env, scope) { env.renderedNodes[this.guid] = true; }; - exports["default"] = EmberMorph; + exports.default = EmberMorph; }); -enifed("ember-htmlbars/node-managers/component-node-manager", ["exports", "ember-metal/core", "ember-metal/merge", "ember-views/system/build-component-template", "ember-htmlbars/utils/lookup-component", "ember-htmlbars/hooks/get-cell-or-value", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/set_properties", "ember-views/compat/attrs-proxy", "htmlbars-util/safe-string", "ember-htmlbars/system/instrumentation-support", "ember-views/views/component", "ember-metal/streams/stream", "ember-metal/streams/utils", "ember-htmlbars/hooks/get-value"], function (exports, _emberMetalCore, _emberMetalMerge, _emberViewsSystemBuildComponentTemplate, _emberHtmlbarsUtilsLookupComponent, _emberHtmlbarsHooksGetCellOrValue, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties, _emberViewsCompatAttrsProxy, _htmlbarsUtilSafeString, _emberHtmlbarsSystemInstrumentationSupport, _emberViewsViewsComponent, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberHtmlbarsHooksGetValue) { - "use strict"; - +enifed('ember-htmlbars/node-managers/component-node-manager', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-views/system/build-component-template', 'ember-htmlbars/utils/lookup-component', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/set_properties', 'ember-views/compat/attrs-proxy', 'htmlbars-util/safe-string', 'ember-htmlbars/system/instrumentation-support', 'ember-views/views/component', 'ember-metal/streams/stream', 'ember-metal/streams/utils', 'ember-htmlbars/hooks/get-value'], function (exports, _emberMetalCore, _emberMetalMerge, _emberViewsSystemBuildComponentTemplate, _emberHtmlbarsUtilsLookupComponent, _emberHtmlbarsHooksGetCellOrValue, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties, _emberViewsCompatAttrsProxy, _htmlbarsUtilSafeString, _emberHtmlbarsSystemInstrumentationSupport, _emberViewsViewsComponent, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberHtmlbarsHooksGetValue) { exports.handleLegacyRender = handleLegacyRender; exports.createComponent = createComponent; function ComponentNodeManager(component, isAngleBracket, scope, renderNode, attrs, block, expectElement) { this.component = component; @@ -10146,11 +8759,11 @@ this.attrs = attrs; this.block = block; this.expectElement = expectElement; } - exports["default"] = ComponentNodeManager; + exports.default = ComponentNodeManager; ComponentNodeManager.create = function (renderNode, env, options) { var tagName = options.tagName; var params = options.params; var attrs = options.attrs; @@ -10162,17 +8775,17 @@ attrs = attrs || {}; // Try to find the Component class and/or template for this component name in // the container. - var _lookupComponent = _emberHtmlbarsUtilsLookupComponent["default"](env.container, tagName); + var _lookupComponent = _emberHtmlbarsUtilsLookupComponent.default(env.container, tagName); var component = _lookupComponent.component; var layout = _lookupComponent.layout; - component = component || _emberViewsViewsComponent["default"]; + component = component || _emberViewsViewsComponent.default; var createOptions = { parentView: parentView }; configureTagName(attrs, tagName, component, isAngleBracket, createOptions); @@ -10182,93 +8795,76 @@ // If there is a controller on the scope, pluck it off and save it on the // component. This allows the component to target actions sent via // `sendAction` correctly. if (parentScope.locals.controller) { - createOptions._controller = _emberHtmlbarsHooksGetValue["default"](parentScope.locals.controller); + createOptions._controller = _emberHtmlbarsHooksGetValue.default(parentScope.locals.controller); } // this flag is set when a block was provided so that components can see if // `this.get('template')` is truthy. this is added for backwards compat only // and accessing `template` prop on a component will trigger a deprecation // 2.0TODO: remove - if (templates["default"]) { + if (templates.default) { createOptions._deprecatedFlagForBlockProvided = true; } - var proto = extractPositionalParams(renderNode, component, params, attrs); - // Instantiate the component - component = createComponent(component, isAngleBracket, createOptions, renderNode, env, attrs, proto); + component = createComponent(component, isAngleBracket, createOptions, renderNode, env, attrs); // If the component specifies its template via the `layout` or `template` // properties instead of using the template looked up in the container, get // them now that we have the component instance. - var result = extractComponentTemplates(component, templates, layout); + var result = extractComponentTemplates(component, templates); layout = result.layout || layout; templates = result.templates || templates; - var results = _emberViewsSystemBuildComponentTemplate["default"]({ layout: layout, component: component, isAngleBracket: isAngleBracket }, attrs, { templates: templates, scope: parentScope }); + extractPositionalParams(renderNode, component, params, attrs); + var results = _emberViewsSystemBuildComponentTemplate.default({ layout: layout, component: component, isAngleBracket: isAngleBracket }, attrs, { templates: templates, scope: parentScope }); + return new ComponentNodeManager(component, isAngleBracket, parentScope, renderNode, attrs, results.block, results.createdElement); }; function extractPositionalParams(renderNode, component, params, attrs) { - var positionalParams = component.positionalParams; - var proto = undefined; + if (component.positionalParams) { + (function () { + // if the component is rendered via {{component}} helper, the first + // element of `params` is the name of the component, so we need to + // skip that when the positional parameters are constructed + var paramsStartIndex = renderNode.state.isComponentHelper ? 1 : 0; + var positionalParams = component.positionalParams; + var isNamed = typeof positionalParams === 'string'; + var paramsStream = undefined; - if (!positionalParams) { - proto = component.proto(); - positionalParams = proto.positionalParams; + if (isNamed) { + paramsStream = new _emberMetalStreamsStream.default(function () { + return _emberMetalStreamsUtils.readArray(params.slice(paramsStartIndex)); + }, 'params'); - } + attrs[positionalParams] = paramsStream; + } - if (positionalParams) { - processPositionalParams(renderNode, positionalParams, params, attrs); + for (var i = 0; i < positionalParams.length; i++) { + var param = params[paramsStartIndex + i]; + if (isNamed) { + paramsStream.addDependency(param); + } else { + attrs[positionalParams[i]] = param; + } + } + })(); } - - // returns `proto` here so that we can avoid doing this - // twice for each initial render per component (it is also needed in `createComponent`) - return proto; } - function processPositionalParams(renderNode, positionalParams, params, attrs) { - // if the component is rendered via {{component}} helper, the first - // element of `params` is the name of the component, so we need to - // skip that when the positional parameters are constructed - var paramsStartIndex = renderNode.state.isComponentHelper ? 1 : 0; - var isNamed = typeof positionalParams === 'string'; - var paramsStream = undefined; - - if (isNamed) { - paramsStream = new _emberMetalStreamsStream["default"](function () { - return _emberMetalStreamsUtils.readArray(params.slice(paramsStartIndex)); - }, 'params'); - - attrs[positionalParams] = paramsStream; - } - - if (isNamed) { - for (var i = paramsStartIndex; i < params.length; i++) { - var param = params[i]; - paramsStream.addDependency(param); - } - } else { - for (var i = 0; i < positionalParams.length; i++) { - var param = params[paramsStartIndex + i]; - attrs[positionalParams[i]] = param; - } - } - } - - function extractComponentTemplates(component, _templates, _layout) { + function extractComponentTemplates(component, _templates) { // Even though we looked up a layout from the container earlier, the // component may specify a `layout` property that overrides that. // The component may also provide a `template` property we should // respect (though this behavior is deprecated). var componentLayout = _emberMetalProperty_get.get(component, 'layout'); - var hasBlock = _templates && _templates["default"]; + var hasBlock = _templates && _templates.default; var layout = undefined, templates = undefined, componentTemplate = undefined; if (hasBlock) { componentTemplate = null; @@ -10280,33 +8876,27 @@ if (componentLayout) { layout = componentLayout; templates = extractLegacyTemplate(_templates, componentTemplate); } else if (componentTemplate) { - if (_layout) { - // If the component has no `layout`, but one was found during - // `lookupComponent` in calling `create` function, use that - layout = _layout; - } else { - // If the component has a `template` but no `layout`, use the template - // as the layout. - layout = componentTemplate; - } + // If the component has a `template` but no `layout`, use the template + // as the layout. + layout = componentTemplate; templates = _templates; - } + } return { layout: layout, templates: templates }; } // 2.0TODO: Remove legacy behavior function extractLegacyTemplate(_templates, componentTemplate) { var templates = undefined; // There is no block template provided but the component has a // `template` property. - if ((!_templates || !_templates["default"]) && componentTemplate) { - templates = { "default": componentTemplate.raw }; + if ((!_templates || !_templates.default) && componentTemplate) { + templates = { default: componentTemplate.raw }; } else { templates = _templates; } return templates; @@ -10314,35 +8904,38 @@ function configureTagName(attrs, tagName, component, isAngleBracket, createOptions) { if (isAngleBracket) { createOptions.tagName = tagName; } else if (attrs.tagName) { - createOptions.tagName = _emberHtmlbarsHooksGetValue["default"](attrs.tagName); + createOptions.tagName = _emberHtmlbarsHooksGetValue.default(attrs.tagName); } } function configureCreateOptions(attrs, createOptions) { // Some attrs are special and need to be set as properties on the component // instance. Make sure we use getValue() to get them from `attrs` since // they are still streams. if (attrs.id) { - createOptions.elementId = _emberHtmlbarsHooksGetValue["default"](attrs.id); + createOptions.elementId = _emberHtmlbarsHooksGetValue.default(attrs.id); } if (attrs._defaultTagName) { - createOptions._defaultTagName = _emberHtmlbarsHooksGetValue["default"](attrs._defaultTagName); + createOptions._defaultTagName = _emberHtmlbarsHooksGetValue.default(attrs._defaultTagName); } if (attrs.viewName) { - createOptions.viewName = _emberHtmlbarsHooksGetValue["default"](attrs.viewName); + createOptions.viewName = _emberHtmlbarsHooksGetValue.default(attrs.viewName); } } ComponentNodeManager.prototype.render = function (_env, visitor) { var component = this.component; + var attrs = this.attrs; return _emberHtmlbarsSystemInstrumentationSupport.instrument(component, function () { var env = _env.childWithView(component); + var snapshot = takeSnapshot(attrs); + env.renderer.componentInitAttrs(this.component, snapshot); env.renderer.componentWillRender(component); env.renderedViews.push(component.elementId); if (this.block) { this.block(env, [], undefined, this.renderNode, this.scope, visitor); @@ -10373,11 +8966,11 @@ lastChildIndex = renderNode.childNodes.length - 1; node = renderNode.childNodes[lastChildIndex]; } else { node = renderNode; } - node.setContent(new _htmlbarsUtilSafeString["default"](content)); + node.setContent(new _htmlbarsUtilSafeString.default(content)); } ComponentNodeManager.prototype.rerender = function (_env, attrs, visitor) { var component = this.component; @@ -10388,11 +8981,11 @@ if (component._renderNode.shouldReceiveAttrs) { env.renderer.componentUpdateAttrs(component, snapshot); if (!component._isAngleBracket) { - _emberMetalSet_properties["default"](component, mergeBindings({}, shadowedAttrs(component, snapshot))); + _emberMetalSet_properties.default(component, mergeBindings({}, shadowedAttrs(component, snapshot))); } component._renderNode.shouldReceiveAttrs = false; } @@ -10422,46 +9015,45 @@ component.destroy(); }; function createComponent(_component, isAngleBracket, _props, renderNode, env) { var attrs = arguments.length <= 5 || arguments[5] === undefined ? {} : arguments[5]; - var proto = arguments.length <= 6 || arguments[6] === undefined ? _component.proto() : arguments[6]; - return (function () { - var props = _emberMetalMerge.assign({}, _props); - if (!isAngleBracket) { - var hasSuppliedController = ('controller' in attrs); // 2.0TODO remove - - var snapshot = takeSnapshot(attrs); - props.attrs = snapshot; + var props = _emberMetalMerge.assign({}, _props); - mergeBindings(props, shadowedAttrs(proto, snapshot)); - } else { - props._isAngleBracket = true; - } + if (!isAngleBracket) { + var hasSuppliedController = ('controller' in attrs); // 2.0TODO remove + + var snapshot = takeSnapshot(attrs); + props.attrs = snapshot; - props.renderer = props.parentView ? props.parentView.renderer : env.container.lookup('renderer:-dom'); - props._viewRegistry = props.parentView ? props.parentView._viewRegistry : env.container.lookup('-view-registry:main'); + var proto = _component.proto(); + mergeBindings(props, shadowedAttrs(proto, snapshot)); + } else { + props._isAngleBracket = true; + } - var component = _component.create(props); + props.renderer = props.parentView ? props.parentView.renderer : env.container.lookup('renderer:-dom'); + props._viewRegistry = props.parentView ? props.parentView._viewRegistry : env.container.lookup('-view-registry:main'); - // for the fallback case - component.container = component.container || env.container; + var component = _component.create(props); - if (props.parentView) { - props.parentView.appendChild(component); + // for the fallback case + component.container = component.container || env.container; - if (props.viewName) { - _emberMetalProperty_set.set(props.parentView, props.viewName, component); - } + if (props.parentView) { + props.parentView.appendChild(component); + + if (props.viewName) { + _emberMetalProperty_set.set(props.parentView, props.viewName, component); } + } - component._renderNode = renderNode; - renderNode.emberView = component; - renderNode.buildChildEnv = buildChildEnv; - return component; - })(); + component._renderNode = renderNode; + renderNode.emberView = component; + renderNode.buildChildEnv = buildChildEnv; + return component; } function shadowedAttrs(target, attrs) { var shadowed = {}; @@ -10481,11 +9073,11 @@ function takeSnapshot(attrs) { var hash = {}; for (var prop in attrs) { - hash[prop] = _emberHtmlbarsHooksGetCellOrValue["default"](attrs[prop]); + hash[prop] = _emberHtmlbarsHooksGetCellOrValue.default(attrs[prop]); } return hash; } @@ -10520,52 +9112,50 @@ // In theory this should come through the env, but it should // be safe to import this until we make the hook system public // and it gets actively used in addons or other downstream // libraries. -enifed("ember-htmlbars/node-managers/view-node-manager", ["exports", "ember-metal/merge", "ember-metal/core", "ember-views/system/build-component-template", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/set_properties", "ember-views/views/view", "ember-views/compat/attrs-proxy", "ember-htmlbars/hooks/get-cell-or-value", "ember-htmlbars/system/instrumentation-support", "ember-htmlbars/node-managers/component-node-manager", "ember-htmlbars/hooks/get-value"], function (exports, _emberMetalMerge, _emberMetalCore, _emberViewsSystemBuildComponentTemplate, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties, _emberViewsViewsView, _emberViewsCompatAttrsProxy, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsSystemInstrumentationSupport, _emberHtmlbarsNodeManagersComponentNodeManager, _emberHtmlbarsHooksGetValue) { - "use strict"; - +enifed('ember-htmlbars/node-managers/view-node-manager', ['exports', 'ember-metal/merge', 'ember-metal/core', 'ember-views/system/build-component-template', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/set_properties', 'ember-views/views/view', 'ember-views/compat/attrs-proxy', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-htmlbars/system/instrumentation-support', 'ember-htmlbars/node-managers/component-node-manager', 'ember-htmlbars/hooks/get-value'], function (exports, _emberMetalMerge, _emberMetalCore, _emberViewsSystemBuildComponentTemplate, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties, _emberViewsViewsView, _emberViewsCompatAttrsProxy, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsSystemInstrumentationSupport, _emberHtmlbarsNodeManagersComponentNodeManager, _emberHtmlbarsHooksGetValue) { exports.createOrUpdateComponent = createOrUpdateComponent; function ViewNodeManager(component, scope, renderNode, block, expectElement) { this.component = component; this.scope = scope; this.renderNode = renderNode; this.block = block; this.expectElement = expectElement; } - exports["default"] = ViewNodeManager; + exports.default = ViewNodeManager; ViewNodeManager.create = function (renderNode, env, attrs, found, parentView, path, contentScope, contentTemplate) { var component; var componentInfo = { layout: found.layout }; if (found.component) { var options = { parentView: parentView }; if (attrs && attrs.id) { - options.elementId = _emberHtmlbarsHooksGetValue["default"](attrs.id); + options.elementId = _emberHtmlbarsHooksGetValue.default(attrs.id); } if (attrs && attrs.tagName) { - options.tagName = _emberHtmlbarsHooksGetValue["default"](attrs.tagName); + options.tagName = _emberHtmlbarsHooksGetValue.default(attrs.tagName); } if (attrs && attrs._defaultTagName) { - options._defaultTagName = _emberHtmlbarsHooksGetValue["default"](attrs._defaultTagName); + options._defaultTagName = _emberHtmlbarsHooksGetValue.default(attrs._defaultTagName); } if (attrs && attrs.viewName) { - options.viewName = _emberHtmlbarsHooksGetValue["default"](attrs.viewName); + options.viewName = _emberHtmlbarsHooksGetValue.default(attrs.viewName); } if (found.component.create && contentScope && contentScope.self) { - options._context = _emberHtmlbarsHooksGetValue["default"](contentScope.self); + options._context = _emberHtmlbarsHooksGetValue.default(contentScope.self); } if (found.self) { - options._context = _emberHtmlbarsHooksGetValue["default"](found.self); + options._context = _emberHtmlbarsHooksGetValue.default(found.self); } component = componentInfo.component = createOrUpdateComponent(found.component, options, found.createOptions, renderNode, env, attrs); var layout = _emberMetalProperty_get.get(component, 'layout'); @@ -10584,12 +9174,12 @@ renderNode.emberView = component; } - var results = _emberViewsSystemBuildComponentTemplate["default"](componentInfo, attrs, { - templates: { "default": contentTemplate }, + var results = _emberViewsSystemBuildComponentTemplate.default(componentInfo, attrs, { + templates: { default: contentTemplate }, scope: contentScope, self: found.self }); return new ViewNodeManager(component, contentScope, renderNode, results.block, results.createdElement); @@ -10604,10 +9194,12 @@ if (component) { newEnv = env.childWithView(component); } if (component) { + var snapshot = takeSnapshot(attrs); + env.renderer.setAttrs(this.component, snapshot); env.renderer.willRender(component); env.renderedViews.push(component.elementId); } if (this.block) { @@ -10637,12 +9229,12 @@ // Notify component that it has become dirty and is about to change. env.renderer.willUpdate(component, snapshot); if (component._renderNode.shouldReceiveAttrs) { - env.renderer.componentUpdateAttrs(component, snapshot); - _emberMetalSet_properties["default"](component, mergeBindings({}, shadowedAttrs(component, snapshot))); + env.renderer.updateAttrs(component, snapshot); + _emberMetalSet_properties.default(component, mergeBindings({}, shadowedAttrs(component, snapshot))); component._renderNode.shouldReceiveAttrs = false; } env.renderer.willRender(component); @@ -10669,12 +9261,12 @@ function createOrUpdateComponent(component, options, createOptions, renderNode, env) { var attrs = arguments.length <= 5 || arguments[5] === undefined ? {} : arguments[5]; var snapshot = takeSnapshot(attrs); - var props = _emberMetalMerge["default"]({}, options); - var defaultController = _emberViewsViewsView["default"].proto().controller; + var props = _emberMetalMerge.default({}, options); + var defaultController = _emberViewsViewsView.default.proto().controller; var hasSuppliedController = 'controller' in attrs || 'controller' in props; if (!props.ownerView && options.parentView) { props.ownerView = options.parentView.ownerView; } @@ -10682,11 +9274,11 @@ props.attrs = snapshot; if (component.create) { var proto = component.proto(); if (createOptions) { - _emberMetalMerge["default"](props, createOptions); + _emberMetalMerge.default(props, createOptions); } mergeBindings(props, shadowedAttrs(proto, snapshot)); props.container = options.parentView ? options.parentView.container : env.container; props.renderer = options.parentView ? options.parentView.renderer : props.container && props.container.lookup('renderer:-dom'); @@ -10696,13 +9288,12 @@ delete props._context; } component = component.create(props); } else { - env.renderer.componentUpdateAttrs(component, snapshot); mergeBindings(props, shadowedAttrs(component, snapshot)); - _emberMetalSet_properties["default"](component, props); + _emberMetalSet_properties.default(component, props); } if (options.parentView) { options.parentView.appendChild(component); @@ -10710,10 +9301,11 @@ _emberMetalProperty_set.set(options.parentView, options.viewName, component); } } component._renderNode = renderNode; + renderNode.emberView = component; return component; } function shadowedAttrs(target, attrs) { @@ -10735,11 +9327,11 @@ function takeSnapshot(attrs) { var hash = {}; for (var prop in attrs) { - hash[prop] = _emberHtmlbarsHooksGetCellOrValue["default"](attrs[prop]); + hash[prop] = _emberHtmlbarsHooksGetCellOrValue.default(attrs[prop]); } return hash; } @@ -10770,15 +9362,13 @@ // In theory this should come through the env, but it should // be safe to import this until we make the hook system public // and it gets actively used in addons or other downstream // libraries. -enifed("ember-htmlbars/streams/built-in-helper", ["exports", "ember-metal/streams/stream", "ember-metal/platform/create", "ember-metal/merge", "ember-htmlbars/streams/utils"], function (exports, _emberMetalStreamsStream, _emberMetalPlatformCreate, _emberMetalMerge, _emberHtmlbarsStreamsUtils) { - "use strict"; +enifed('ember-htmlbars/streams/built-in-helper', ['exports', 'ember-metal/streams/stream', 'ember-metal/merge', 'ember-htmlbars/streams/utils'], function (exports, _emberMetalStreamsStream, _emberMetalMerge, _emberHtmlbarsStreamsUtils) { + exports.default = BuiltInHelperStream; - exports["default"] = BuiltInHelperStream; - function BuiltInHelperStream(helper, params, hash, templates, env, scope, context, label) { this.init(label); this.helper = helper; this.params = params; this.templates = templates; @@ -10786,60 +9376,56 @@ this.scope = scope; this.hash = hash; this.context = context; } - BuiltInHelperStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsStream["default"].prototype); + BuiltInHelperStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); - _emberMetalMerge["default"](BuiltInHelperStream.prototype, { + _emberMetalMerge.default(BuiltInHelperStream.prototype, { compute: function () { // Using call and undefined is probably not needed, these are only internal return this.helper.call(this.context, _emberHtmlbarsStreamsUtils.getArrayValues(this.params), _emberHtmlbarsStreamsUtils.getHashValues(this.hash), this.templates, this.env, this.scope); } }); }); -enifed("ember-htmlbars/streams/compat-helper", ["exports", "ember-metal/streams/stream", "ember-metal/platform/create", "ember-metal/merge"], function (exports, _emberMetalStreamsStream, _emberMetalPlatformCreate, _emberMetalMerge) { - "use strict"; +enifed('ember-htmlbars/streams/compat-helper', ['exports', 'ember-metal/streams/stream', 'ember-metal/merge'], function (exports, _emberMetalStreamsStream, _emberMetalMerge) { + exports.default = CompatHelperStream; - exports["default"] = CompatHelperStream; - function CompatHelperStream(helper, params, hash, templates, env, scope, label) { this.init(label); this.helper = helper.helperFunction; this.params = params; this.templates = templates; this.env = env; this.scope = scope; this.hash = hash; } - CompatHelperStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsStream["default"].prototype); + CompatHelperStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); - _emberMetalMerge["default"](CompatHelperStream.prototype, { + _emberMetalMerge.default(CompatHelperStream.prototype, { compute: function () { // Using call and undefined is probably not needed, these are only internal return this.helper.call(undefined, this.params, this.hash, this.templates, this.env, this.scope); } }); }); -enifed("ember-htmlbars/streams/helper-factory", ["exports", "ember-metal/streams/stream", "ember-metal/platform/create", "ember-metal/merge", "ember-htmlbars/streams/utils"], function (exports, _emberMetalStreamsStream, _emberMetalPlatformCreate, _emberMetalMerge, _emberHtmlbarsStreamsUtils) { - "use strict"; +enifed('ember-htmlbars/streams/helper-factory', ['exports', 'ember-metal/streams/stream', 'ember-metal/merge', 'ember-htmlbars/streams/utils'], function (exports, _emberMetalStreamsStream, _emberMetalMerge, _emberHtmlbarsStreamsUtils) { + exports.default = HelperFactoryStream; - exports["default"] = HelperFactoryStream; - function HelperFactoryStream(helperFactory, params, hash, label) { this.init(label); this.helperFactory = helperFactory; this.params = params; this.hash = hash; this.linkable = true; this.helper = null; } - HelperFactoryStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsStream["default"].prototype); + HelperFactoryStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); - _emberMetalMerge["default"](HelperFactoryStream.prototype, { + _emberMetalMerge.default(HelperFactoryStream.prototype, { compute: function () { if (!this.helper) { this.helper = this.helperFactory.create({ _stream: this }); } return this.helper.compute(_emberHtmlbarsStreamsUtils.getArrayValues(this.params), _emberHtmlbarsStreamsUtils.getHashValues(this.hash)); @@ -10852,71 +9438,61 @@ } }, super$deactivate: HelperFactoryStream.prototype.deactivate }); }); -enifed("ember-htmlbars/streams/helper-instance", ["exports", "ember-metal/streams/stream", "ember-metal/platform/create", "ember-metal/merge", "ember-htmlbars/streams/utils"], function (exports, _emberMetalStreamsStream, _emberMetalPlatformCreate, _emberMetalMerge, _emberHtmlbarsStreamsUtils) { - "use strict"; +enifed('ember-htmlbars/streams/helper-instance', ['exports', 'ember-metal/streams/stream', 'ember-metal/merge', 'ember-htmlbars/streams/utils'], function (exports, _emberMetalStreamsStream, _emberMetalMerge, _emberHtmlbarsStreamsUtils) { + exports.default = HelperInstanceStream; - exports["default"] = HelperInstanceStream; - function HelperInstanceStream(helper, params, hash, label) { this.init(label); this.helper = helper; this.params = params; this.hash = hash; this.linkable = true; } - HelperInstanceStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsStream["default"].prototype); + HelperInstanceStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); - _emberMetalMerge["default"](HelperInstanceStream.prototype, { + _emberMetalMerge.default(HelperInstanceStream.prototype, { compute: function () { return this.helper.compute(_emberHtmlbarsStreamsUtils.getArrayValues(this.params), _emberHtmlbarsStreamsUtils.getHashValues(this.hash)); } }); }); -enifed("ember-htmlbars/streams/utils", ["exports", "ember-htmlbars/hooks/get-value"], function (exports, _emberHtmlbarsHooksGetValue) { - "use strict"; - +enifed('ember-htmlbars/streams/utils', ['exports', 'ember-htmlbars/hooks/get-value'], function (exports, _emberHtmlbarsHooksGetValue) { exports.getArrayValues = getArrayValues; exports.getHashValues = getHashValues; // We don't want to leak mutable cells into helpers, which // are pure functions that can only work with values. function getArrayValues(params) { - var out = []; - for (var i = 0, l = params.length; i < l; i++) { - out.push(_emberHtmlbarsHooksGetValue["default"](params[i])); + var l = params.length; + var out = new Array(l); + for (var i = 0; i < l; i++) { + out[i] = _emberHtmlbarsHooksGetValue.default(params[i]); } return out; } function getHashValues(hash) { var out = {}; for (var prop in hash) { - out[prop] = _emberHtmlbarsHooksGetValue["default"](hash[prop]); + out[prop] = _emberHtmlbarsHooksGetValue.default(hash[prop]); } return out; } }); -enifed("ember-htmlbars/system/append-templated-view", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-views/views/view"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberViewsViewsView) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/system/append-templated-view', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-views/views/view'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberViewsViewsView) { + exports.default = appendTemplatedView; - "use strict"; - - exports["default"] = appendTemplatedView; - function appendTemplatedView(parentView, morph, viewClassOrInstance, props) { var viewProto; - if (_emberViewsViewsView["default"].detectInstance(viewClassOrInstance)) { + if (_emberViewsViewsView.default.detectInstance(viewClassOrInstance)) { viewProto = viewClassOrInstance; } else { viewProto = viewClassOrInstance.proto(); } @@ -10935,27 +9511,24 @@ props._morph = morph; return parentView.appendChild(viewClassOrInstance, props); } }); +/** +@module ember +@submodule ember-htmlbars +*/ + // Ember.assert -enifed("ember-htmlbars/system/bootstrap", ["exports", "ember-metal/core", "ember-views/component_lookup", "ember-views/system/jquery", "ember-metal/error", "ember-runtime/system/lazy_load", "ember-template-compiler/system/compile", "ember-metal/environment"], function (exports, _emberMetalCore, _emberViewsComponent_lookup, _emberViewsSystemJquery, _emberMetalError, _emberRuntimeSystemLazy_load, _emberTemplateCompilerSystemCompile, _emberMetalEnvironment) { - /*globals Handlebars */ +enifed('ember-htmlbars/system/bootstrap', ['exports', 'ember-metal/core', 'ember-views/component_lookup', 'ember-views/system/jquery', 'ember-metal/error', 'ember-runtime/system/lazy_load', 'ember-template-compiler/system/compile', 'ember-metal/environment'], function (exports, _emberMetalCore, _emberViewsComponent_lookup, _emberViewsSystemJquery, _emberMetalError, _emberRuntimeSystemLazy_load, _emberTemplateCompilerSystemCompile, _emberMetalEnvironment) { /** @module ember @submodule ember-htmlbars */ - "use strict"; - /** - @module ember - @submodule ember-htmlbars - */ - - /** Find templates stored in the head tag as script tags and make them available to `Ember.CoreView` in the global `Ember.TEMPLATES` object. This will be run as as jQuery DOM-ready callback. Script tags with `text/x-handlebars` will be compiled @@ -10970,48 +9543,48 @@ @param ctx */ function bootstrap(ctx) { var selectors = 'script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]'; - _emberViewsSystemJquery["default"](selectors, ctx).each(function () { + _emberViewsSystemJquery.default(selectors, ctx).each(function () { // Get a reference to the script tag - var script = _emberViewsSystemJquery["default"](this); + var script = _emberViewsSystemJquery.default(this); // Get the name of the script, used by Ember.View's templateName property. // First look for data-template-name attribute, then fall back to its // id if no name is found. var templateName = script.attr('data-template-name') || script.attr('id') || 'application'; var template, compile; if (script.attr('type') === 'text/x-raw-handlebars') { - compile = _emberViewsSystemJquery["default"].proxy(Handlebars.compile, Handlebars); + compile = _emberViewsSystemJquery.default.proxy(Handlebars.compile, Handlebars); template = compile(script.html()); } else { - template = _emberTemplateCompilerSystemCompile["default"](script.html(), { + template = _emberTemplateCompilerSystemCompile.default(script.html(), { moduleName: templateName }); } // Check if template of same name already exists - if (_emberMetalCore["default"].TEMPLATES[templateName] !== undefined) { - throw new _emberMetalError["default"]('Template named "' + templateName + '" already exists.'); + if (_emberMetalCore.default.TEMPLATES[templateName] !== undefined) { + throw new _emberMetalError.default('Template named "' + templateName + '" already exists.'); } // For templates which have a name, we save them and then remove them from the DOM - _emberMetalCore["default"].TEMPLATES[templateName] = template; + _emberMetalCore.default.TEMPLATES[templateName] = template; // Remove script tag from DOM script.remove(); }); } function _bootstrap() { - bootstrap(_emberViewsSystemJquery["default"](document)); + bootstrap(_emberViewsSystemJquery.default(document)); } function registerComponentLookup(app) { - app.registry.register('component-lookup:main', _emberViewsComponent_lookup["default"]); + app.registry.register('component-lookup:main', _emberViewsComponent_lookup.default); } /* We tie this to application.load to ensure that we've at least attempted to bootstrap at the point that the application is loaded. @@ -11024,82 +9597,79 @@ */ _emberRuntimeSystemLazy_load.onLoad('Ember.Application', function (Application) { Application.initializer({ name: 'domTemplates', - initialize: _emberMetalEnvironment["default"].hasDOM ? _bootstrap : function () {} + initialize: _emberMetalEnvironment.default.hasDOM ? _bootstrap : function () {} }); Application.instanceInitializer({ name: 'registerComponentLookup', initialize: registerComponentLookup }); }); - exports["default"] = bootstrap; + exports.default = bootstrap; }); -enifed('ember-htmlbars/system/discover-known-helpers', ['exports', 'ember-metal/core', 'ember-metal/dictionary', 'ember-metal/keys'], function (exports, _emberMetalCore, _emberMetalDictionary, _emberMetalKeys) { - 'use strict'; +/*globals Handlebars */ - exports["default"] = discoverKnownHelpers; +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/system/discover-known-helpers', ['exports', 'ember-metal/features', 'ember-metal/dictionary'], function (exports, _emberMetalFeatures, _emberMetalDictionary) { + exports.default = discoverKnownHelpers; function discoverKnownHelpers(container) { var registry = container && container._registry; - var helpers = _emberMetalDictionary["default"](null); + var helpers = _emberMetalDictionary.default(null); - - if (!registry) { - return helpers; - } + if (!registry) { + return helpers; + } - var known = registry.knownForType('helper'); - var knownContainerKeys = _emberMetalKeys["default"](known); + var known = registry.knownForType('helper'); + var knownContainerKeys = Object.keys(known); - for (var index = 0, _length = knownContainerKeys.length; index < _length; index++) { - var fullName = knownContainerKeys[index]; - var _name = fullName.slice(7); // remove `helper:` from fullName + for (var index = 0, _length = knownContainerKeys.length; index < _length; index++) { + var fullName = knownContainerKeys[index]; + var _name = fullName.slice(7); // remove `helper:` from fullName - helpers[_name] = true; - } - + helpers[_name] = true; + } return helpers; } }); -enifed("ember-htmlbars/system/dom-helper", ["exports", "dom-helper", "ember-htmlbars/morphs/morph", "ember-htmlbars/morphs/attr-morph", "ember-metal/platform/create"], function (exports, _domHelper, _emberHtmlbarsMorphsMorph, _emberHtmlbarsMorphsAttrMorph, _emberMetalPlatformCreate) { - "use strict"; +enifed('ember-htmlbars/system/dom-helper', ['exports', 'dom-helper', 'ember-htmlbars/morphs/morph', 'ember-htmlbars/morphs/attr-morph'], function (exports, _domHelper, _emberHtmlbarsMorphsMorph, _emberHtmlbarsMorphsAttrMorph) { function EmberDOMHelper(_document) { - _domHelper["default"].call(this, _document); + _domHelper.default.call(this, _document); } - var proto = EmberDOMHelper.prototype = _emberMetalPlatformCreate["default"](_domHelper["default"].prototype); - proto.MorphClass = _emberHtmlbarsMorphsMorph["default"]; - proto.AttrMorphClass = _emberHtmlbarsMorphsAttrMorph["default"]; + var proto = EmberDOMHelper.prototype = Object.create(_domHelper.default.prototype); + proto.MorphClass = _emberHtmlbarsMorphsMorph.default; + proto.AttrMorphClass = _emberHtmlbarsMorphsAttrMorph.default; - exports["default"] = EmberDOMHelper; + exports.default = EmberDOMHelper; }); enifed("ember-htmlbars/system/helper", ["exports"], function (exports) { /** @module ember @submodule ember-templates */ - "use strict"; - function Helper(helper) { this.helperFunction = helper; this.isHelper = true; this.isHTMLBars = true; } - exports["default"] = Helper; + exports.default = Helper; }); enifed('ember-htmlbars/system/instrumentation-support', ['exports', 'ember-metal/instrumentation'], function (exports, _emberMetalInstrumentation) { - 'use strict'; - exports.instrument = instrument; /** Provides instrumentation for node managers. @@ -11137,39 +9707,30 @@ } else { return callback.call(context); } } }); -enifed("ember-htmlbars/system/invoke-helper", ["exports", "ember-htmlbars/streams/helper-instance", "ember-htmlbars/streams/helper-factory", "ember-htmlbars/streams/built-in-helper", "ember-htmlbars/streams/compat-helper"], function (exports, _emberHtmlbarsStreamsHelperInstance, _emberHtmlbarsStreamsHelperFactory, _emberHtmlbarsStreamsBuiltInHelper, _emberHtmlbarsStreamsCompatHelper) { - "use strict"; - +enifed('ember-htmlbars/system/invoke-helper', ['exports', 'ember-metal/core', 'ember-htmlbars/streams/helper-instance', 'ember-htmlbars/streams/helper-factory', 'ember-htmlbars/streams/built-in-helper', 'ember-htmlbars/streams/compat-helper'], function (exports, _emberMetalCore, _emberHtmlbarsStreamsHelperInstance, _emberHtmlbarsStreamsHelperFactory, _emberHtmlbarsStreamsBuiltInHelper, _emberHtmlbarsStreamsCompatHelper) { exports.buildHelperStream = buildHelperStream; function buildHelperStream(helper, params, hash, templates, env, scope, context, label) { if (helper.isHelperFactory) { - return new _emberHtmlbarsStreamsHelperFactory["default"](helper, params, hash, label); + return new _emberHtmlbarsStreamsHelperFactory.default(helper, params, hash, label); } else if (helper.isHelperInstance) { - return new _emberHtmlbarsStreamsHelperInstance["default"](helper, params, hash, label); + return new _emberHtmlbarsStreamsHelperInstance.default(helper, params, hash, label); } else if (helper.helperFunction) { - return new _emberHtmlbarsStreamsCompatHelper["default"](helper, params, hash, templates, env, scope, label); + return new _emberHtmlbarsStreamsCompatHelper.default(helper, params, hash, templates, env, scope, label); } else { - return new _emberHtmlbarsStreamsBuiltInHelper["default"](helper, params, hash, templates, env, scope, context, label); + return new _emberHtmlbarsStreamsBuiltInHelper.default(helper, params, hash, templates, env, scope, context, label); } } }); -enifed("ember-htmlbars/system/lookup-helper", ["exports", "ember-metal/core", "ember-metal/cache", "ember-htmlbars/compat/helper"], function (exports, _emberMetalCore, _emberMetalCache, _emberHtmlbarsCompatHelper) { - /** - @module ember - @submodule ember-htmlbars - */ - - "use strict"; - +enifed('ember-htmlbars/system/lookup-helper', ['exports', 'ember-metal/core', 'ember-metal/cache', 'ember-htmlbars/compat/helper'], function (exports, _emberMetalCore, _emberMetalCache, _emberHtmlbarsCompatHelper) { exports.validateLazyHelperName = validateLazyHelperName; exports.findHelper = findHelper; - exports["default"] = lookupHelper; - var CONTAINS_DASH_CACHE = new _emberMetalCache["default"](1000, function (key) { + exports.default = lookupHelper; + var CONTAINS_DASH_CACHE = new _emberMetalCache.default(1000, function (key) { return key.indexOf('-') !== -1; }); exports.CONTAINS_DASH_CACHE = CONTAINS_DASH_CACHE; @@ -11182,11 +9743,11 @@ return true; } } function isLegacyBareHelper(helper) { - return helper && !helper.isHelperFactory && !helper.isHelperInstance && !helper.isHTMLBars; + return helper && (!helper.isHelperFactory && !helper.isHelperInstance && !helper.isHTMLBars); } /** Used to lookup/resolve handlebars helpers. The lookup order is: @@ -11210,11 +9771,11 @@ if (validateLazyHelperName(name, container, env.hooks.keywords, env.knownHelpers)) { var helperName = 'helper:' + name; if (container._registry.has(helperName)) { helper = container.lookupFactory(helperName); if (isLegacyBareHelper(helper)) { - helper = new _emberHtmlbarsCompatHelper["default"](helper); + helper = new _emberHtmlbarsCompatHelper.default(helper); } } } } @@ -11226,15 +9787,16 @@ return helper; } }); -enifed('ember-htmlbars/system/make-view-helper', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { - 'use strict'; - - exports["default"] = makeViewHelper; - +/** +@module ember +@submodule ember-htmlbars +*/ +enifed("ember-htmlbars/system/make-view-helper", ["exports"], function (exports) { + exports.default = makeViewHelper; /** @module ember @submodule ember-htmlbars */ @@ -11249,27 +9811,20 @@ @param {Function} ViewClass view class constructor @since 1.2.0 */ function makeViewHelper(ViewClass) { - return { isLegacyViewHelper: true, isHTMLBars: true, viewClass: ViewClass }; } }); -enifed('ember-htmlbars/system/make_bound_helper', ['exports', 'ember-metal/core', 'ember-htmlbars/helper'], function (exports, _emberMetalCore, _emberHtmlbarsHelper) { - /** - @module ember - @submodule ember-htmlbars - */ - 'use strict'; +enifed('ember-htmlbars/system/make_bound_helper', ['exports', 'ember-htmlbars/helper'], function (exports, _emberHtmlbarsHelper) { + exports.default = makeBoundHelper; - exports["default"] = makeBoundHelper; - /** Create a bound helper. Accepts a function that receives the ordered and hash parameters from the template. If a bound property was provided in the template it will be resolved to its value and any changes to the bound property cause the helper function to be re-run with the updated values. @@ -11311,18 +9866,20 @@ @param {Function} fn @since 1.10.0 */ function makeBoundHelper(fn) { - return _emberHtmlbarsHelper.helper(fn); + return _emberHtmlbarsHelper.helper(fn); } }); -enifed("ember-htmlbars/system/render-env", ["exports", "ember-htmlbars/env", "ember-htmlbars/system/discover-known-helpers"], function (exports, _emberHtmlbarsEnv, _emberHtmlbarsSystemDiscoverKnownHelpers) { - "use strict"; +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/system/render-env', ['exports', 'ember-htmlbars/env', 'ember-htmlbars/system/discover-known-helpers'], function (exports, _emberHtmlbarsEnv, _emberHtmlbarsSystemDiscoverKnownHelpers) { + exports.default = RenderEnv; - exports["default"] = RenderEnv; - function RenderEnv(options) { this.lifecycleHooks = options.lifecycleHooks || []; this.renderedViews = options.renderedViews || []; this.renderedNodes = options.renderedNodes || {}; this.hasParentOutlet = options.hasParentOutlet || false; @@ -11330,15 +9887,15 @@ this.view = options.view; this.outletState = options.outletState; this.container = options.container; this.renderer = options.renderer; this.dom = options.dom; - this.knownHelpers = options.knownHelpers || _emberHtmlbarsSystemDiscoverKnownHelpers["default"](options.container); + this.knownHelpers = options.knownHelpers || _emberHtmlbarsSystemDiscoverKnownHelpers.default(options.container); - this.hooks = _emberHtmlbarsEnv["default"].hooks; - this.helpers = _emberHtmlbarsEnv["default"].helpers; - this.useFragmentCache = _emberHtmlbarsEnv["default"].useFragmentCache; + this.hooks = _emberHtmlbarsEnv.default.hooks; + this.helpers = _emberHtmlbarsEnv.default.helpers; + this.useFragmentCache = _emberHtmlbarsEnv.default.useFragmentCache; } RenderEnv.build = function (view) { return new RenderEnv({ view: view, @@ -11379,32 +9936,28 @@ hasParentOutlet: hasParentOutlet, knownHelpers: this.knownHelpers }); }; }); -enifed("ember-htmlbars/system/render-view", ["exports", "ember-htmlbars/node-managers/view-node-manager", "ember-htmlbars/system/render-env"], function (exports, _emberHtmlbarsNodeManagersViewNodeManager, _emberHtmlbarsSystemRenderEnv) { - "use strict"; - +enifed('ember-htmlbars/system/render-view', ['exports', 'ember-htmlbars/node-managers/view-node-manager', 'ember-htmlbars/system/render-env'], function (exports, _emberHtmlbarsNodeManagersViewNodeManager, _emberHtmlbarsSystemRenderEnv) { exports.renderHTMLBarsBlock = renderHTMLBarsBlock; // This function only gets called once per render of a "root view" (`appendTo`). Otherwise, // HTMLBars propagates the existing env and renders templates for a given render node. function renderHTMLBarsBlock(view, block, renderNode) { - var env = _emberHtmlbarsSystemRenderEnv["default"].build(view); + var env = _emberHtmlbarsSystemRenderEnv.default.build(view); view.env = env; _emberHtmlbarsNodeManagersViewNodeManager.createOrUpdateComponent(view, {}, null, renderNode, env); - var nodeManager = new _emberHtmlbarsNodeManagersViewNodeManager["default"](view, null, renderNode, block, view.tagName !== ''); + var nodeManager = new _emberHtmlbarsNodeManagersViewNodeManager.default(view, null, renderNode, block, view.tagName !== ''); nodeManager.render(env, {}); } }); enifed("ember-htmlbars/templates/component", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, hasRendered: false, @@ -11426,13 +9979,11 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/container-view", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { return { meta: {}, arity: 1, cachedFragment: null, @@ -11526,13 +10077,11 @@ templates: [child0, child1] }; })()); }); enifed("ember-htmlbars/templates/empty", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, hasRendered: false, @@ -11548,13 +10097,11 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/legacy-each", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { var child0 = (function () { var child0 = (function () { var child0 = (function () { return { @@ -11840,13 +10387,11 @@ templates: [child0, child1] }; })()); }); enifed("ember-htmlbars/templates/link-to-escaped", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, hasRendered: false, @@ -11868,13 +10413,11 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/link-to-unescaped", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, hasRendered: false, @@ -11896,13 +10439,11 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/link-to", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { var child0 = (function () { return { meta: {}, arity: 0, @@ -12020,13 +10561,11 @@ templates: [child0, child1] }; })()); }); enifed("ember-htmlbars/templates/select-optgroup", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { return { meta: {}, arity: 1, cachedFragment: null, @@ -12072,13 +10611,11 @@ templates: [child0] }; })()); }); enifed("ember-htmlbars/templates/select-option", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, hasRendered: false, @@ -12100,13 +10637,11 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/select", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { return { meta: {}, arity: 0, cachedFragment: null, @@ -12253,13 +10788,11 @@ templates: [child0, child1, child2] }; })()); }); enifed("ember-htmlbars/templates/top-level-view", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { - "use strict"; - - exports["default"] = _emberTemplateCompilerSystemTemplate["default"]((function () { + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, hasRendered: false, @@ -12280,15 +10813,13 @@ locals: [], templates: [] }; })()); }); -enifed("ember-htmlbars/utils/decode-each-key", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/utils"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils) { - "use strict"; +enifed('ember-htmlbars/utils/decode-each-key', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils) { + exports.default = decodeEachKey; - exports["default"] = decodeEachKey; - function identity(item) { var key = undefined; var type = typeof item; if (type === 'string' || type === 'number') { @@ -12333,19 +10864,12 @@ return key; } }); enifed('ember-htmlbars/utils/is-component', ['exports', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberHtmlbarsSystemLookupHelper) { - /** - @module ember - @submodule ember-htmlbars - */ + exports.default = isComponent; - 'use strict'; - - exports["default"] = isComponent; - /* Given a path name, returns whether or not a component with that name was found in the container. */ @@ -12358,46 +10882,39 @@ return false; } return container._registry.has('component:' + path) || container._registry.has('template:components/' + path); } }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed('ember-htmlbars/utils/lookup-component', ['exports'], function (exports) { - 'use strict'; + exports.default = lookupComponent; - exports["default"] = lookupComponent; - function lookupComponent(container, tagName) { var componentLookup = container.lookup('component-lookup:main'); return { component: componentLookup.componentFor(tagName, container), layout: componentLookup.layoutFor(tagName, container) }; } }); enifed("ember-htmlbars/utils/normalize-self", ["exports"], function (exports) { - "use strict"; + exports.default = normalizeSelf; - exports["default"] = normalizeSelf; - function normalizeSelf(self) { if (self === undefined) { return null; } else { return self; } } }); -enifed("ember-htmlbars/utils/string", ["exports", "htmlbars-util", "ember-runtime/system/string"], function (exports, _htmlbarsUtil, _emberRuntimeSystemString) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-htmlbars/utils/string', ['exports', 'ember-metal/core', 'ember-runtime/system/string', 'htmlbars-util'], function (exports, _emberMetalCore, _emberRuntimeSystemString, _htmlbarsUtil) { - // required so we can extend this object. - "use strict"; - /** Mark a string as safe for unescaped output with Ember templates. If you return HTML from a helper, use this function to ensure Ember's rendering layer does not escape the HTML. @@ -12411,35 +10928,37 @@ @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars @public */ function htmlSafe(str) { if (str === null || str === undefined) { - return ""; + return ''; } if (typeof str !== 'string') { str = '' + str; } return new _htmlbarsUtil.SafeString(str); } - _emberRuntimeSystemString["default"].htmlSafe = htmlSafe; - if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) { + _emberRuntimeSystemString.default.htmlSafe = htmlSafe; + if (_emberMetalCore.default.EXTEND_PROTOTYPES === true || _emberMetalCore.default.EXTEND_PROTOTYPES.String) { String.prototype.htmlSafe = function () { return htmlSafe(this); }; } exports.SafeString = _htmlbarsUtil.SafeString; exports.htmlSafe = htmlSafe; exports.escapeExpression = _htmlbarsUtil.escapeExpression; }); -enifed("ember-htmlbars/utils/subscribe", ["exports", "ember-metal/streams/utils"], function (exports, _emberMetalStreamsUtils) { - "use strict"; +/** +@module ember +@submodule ember-htmlbars +*/ +enifed('ember-htmlbars/utils/subscribe', ['exports', 'ember-metal/streams/utils'], function (exports, _emberMetalStreamsUtils) { + exports.default = subscribe; - exports["default"] = subscribe; - function subscribe(node, env, scope, stream) { if (!_emberMetalStreamsUtils.isStream(stream)) { return; } var component = scope.component; @@ -12463,58 +10982,51 @@ node.ownerNode.emberView.scheduleRevalidate(node, _emberMetalStreamsUtils.labelFor(stream)); })); } }); -enifed("ember-htmlbars/utils/update-scope", ["exports", "ember-metal/streams/proxy-stream", "ember-htmlbars/utils/subscribe"], function (exports, _emberMetalStreamsProxyStream, _emberHtmlbarsUtilsSubscribe) { - "use strict"; +enifed('ember-htmlbars/utils/update-scope', ['exports', 'ember-metal/streams/proxy-stream', 'ember-htmlbars/utils/subscribe'], function (exports, _emberMetalStreamsProxyStream, _emberHtmlbarsUtilsSubscribe) { + exports.default = updateScope; - exports["default"] = updateScope; - function updateScope(scope, key, newValue, renderNode, isSelf) { var existing = scope[key]; if (existing) { existing.setSource(newValue); } else { - var stream = new _emberMetalStreamsProxyStream["default"](newValue, isSelf ? null : key); + var stream = new _emberMetalStreamsProxyStream.default(newValue, isSelf ? null : key); if (renderNode) { - _emberHtmlbarsUtilsSubscribe["default"](renderNode, scope, stream); + _emberHtmlbarsUtilsSubscribe.default(renderNode, scope, stream); } scope[key] = stream; } } }); enifed('ember-metal-views', ['exports', 'ember-metal-views/renderer'], function (exports, _emberMetalViewsRenderer) { - 'use strict'; - - exports.Renderer = _emberMetalViewsRenderer["default"]; + exports.Renderer = _emberMetalViewsRenderer.default; }); -enifed("ember-metal-views/renderer", ["exports", "ember-metal/run_loop", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/merge", "ember-metal/set_properties", "ember-views/system/build-component-template", "ember-metal/enumerable_utils"], function (exports, _emberMetalRun_loop, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMerge, _emberMetalSet_properties, _emberViewsSystemBuildComponentTemplate, _emberMetalEnumerable_utils) { - "use strict"; +enifed('ember-metal-views/renderer', ['exports', 'ember-metal/run_loop', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/merge', 'ember-metal/set_properties', 'ember-views/system/build-component-template'], function (exports, _emberMetalRun_loop, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMerge, _emberMetalSet_properties, _emberViewsSystemBuildComponentTemplate) { - //import { deprecation } from "ember-views/compat/attrs-proxy"; - function Renderer(_helper) { this._dom = _helper; } Renderer.prototype.prerenderTopLevelView = function Renderer_prerenderTopLevelView(view, renderNode) { if (view._state === 'inDOM') { - throw new Error("You cannot insert a View that has already been rendered"); + throw new Error('You cannot insert a View that has already been rendered'); } view.ownerView = renderNode.emberView = view; view._renderNode = renderNode; var layout = _emberMetalProperty_get.get(view, 'layout'); var template = view.isComponent ? _emberMetalProperty_get.get(view, '_template') : _emberMetalProperty_get.get(view, 'template'); var componentInfo = { component: view, layout: layout }; - var block = _emberViewsSystemBuildComponentTemplate["default"](componentInfo, {}, { + var block = _emberViewsSystemBuildComponentTemplate.default(componentInfo, {}, { self: view, - templates: template ? { "default": template.raw } : undefined + templates: template ? { default: template.raw } : undefined }).block; view.renderBlock(block, renderNode); view.lastResult = renderNode.lastResult; this.clearRenderedViews(view.env); @@ -12566,11 +11078,11 @@ env.lifecycleHooks.length = 0; }; Renderer.prototype.ensureViewNotRendering = function Renderer_ensureViewNotRendering(view) { var env = view.ownerView.env; - if (env && _emberMetalEnumerable_utils.indexOf(env.renderedViews, view.elementId) !== -1) { + if (env && env.renderedViews.indexOf(view.elementId) !== -1) { throw new Error('Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.'); } }; Renderer.prototype.clearRenderedViews = function Renderer_clearRenderedViews(env) { @@ -12581,18 +11093,18 @@ // This entry point is called from top-level `view.appendTo` Renderer.prototype.appendTo = function Renderer_appendTo(view, target) { var morph = this._dom.appendMorph(target); morph.ownerNode = morph; view._willInsert = true; - _emberMetalRun_loop["default"].schedule('render', this, this.renderTopLevelView, view, morph); + _emberMetalRun_loop.default.schedule('render', this, this.renderTopLevelView, view, morph); }; Renderer.prototype.replaceIn = function Renderer_replaceIn(view, target) { var morph = this._dom.replaceContentWithMorph(target); morph.ownerNode = morph; view._willInsert = true; - _emberMetalRun_loop["default"].scheduleOnce('render', this, this.renderTopLevelView, view, morph); + _emberMetalRun_loop.default.scheduleOnce('render', this, this.renderTopLevelView, view, morph); }; Renderer.prototype.createElement = function Renderer_createElement(view) { var morph = this._dom.createFragmentMorph(); morph.ownerNode = morph; @@ -12618,12 +11130,11 @@ Renderer.prototype.setAttrs = function (view, attrs) { _emberMetalProperty_set.set(view, 'attrs', attrs); }; // set attrs the first time Renderer.prototype.componentInitAttrs = function (component, attrs) { - // for attrs-proxy support - component.trigger('_internalDidReceiveAttrs'); + _emberMetalProperty_set.set(component, 'attrs', attrs); component.trigger('didInitAttrs', { attrs: attrs }); component.trigger('didReceiveAttrs', { newAttrs: attrs }); }; // set attrs the first time Renderer.prototype.didInsertElement = function (view) { @@ -12655,17 +11166,15 @@ Renderer.prototype.componentUpdateAttrs = function (component, newAttrs) { var oldAttrs = null; if (component.attrs) { oldAttrs = _emberMetalMerge.assign({}, component.attrs); - _emberMetalSet_properties["default"](component.attrs, newAttrs); + _emberMetalSet_properties.default(component.attrs, newAttrs); } else { _emberMetalProperty_set.set(component, 'attrs', newAttrs); } - // for attrs-proxy support - component.trigger('_internalDidReceiveAttrs'); component.trigger('didUpdateAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); component.trigger('didReceiveAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); }; Renderer.prototype.willUpdate = function (view, attrs) { @@ -12690,11 +11199,11 @@ Renderer.prototype.remove = function (view, shouldDestroy) { this.willDestroyElement(view); view._willRemoveElement = true; - _emberMetalRun_loop["default"].schedule('render', this, this.renderElementRemoval, view); + _emberMetalRun_loop.default.schedule('render', this, this.renderElementRemoval, view); }; Renderer.prototype.renderElementRemoval = function Renderer_renderElementRemoval(view) { // Use the _willRemoveElement flag to avoid mulitple removal attempts in // case many have been scheduled. This should be more performant than using @@ -12707,11 +11216,11 @@ } this.didDestroyElement(view); } }; - Renderer.prototype.willRemoveElement = function () /*view*/{}; + Renderer.prototype.willRemoveElement = function () {}; Renderer.prototype.willDestroyElement = function (view) { if (view._willDestroyElement) { view._willDestroyElement(); } @@ -12730,30 +11239,24 @@ // Views that are being destroyed should never go back to the preRender state. // However if we're just destroying an element on a view (as is the case when // using View#remove) then the view should go to a preRender state so that // it can be rendered again later. - if (view._state !== 'destroying') { + if (view._state !== 'destroying' && view._transitionTo) { view._transitionTo('preRender'); } if (view.trigger) { view.trigger('didDestroyElement'); } }; // element destroyed so view.destroy shouldn't try to remove it removedFromDOM - exports["default"] = Renderer; + exports.default = Renderer; }); -enifed("ember-metal", ["exports", "ember-metal/core", "ember-metal/merge", "ember-metal/instrumentation", "ember-metal/utils", "ember-metal/error", "ember-metal/enumerable_utils", "ember-metal/cache", "ember-metal/platform/define_property", "ember-metal/platform/create", "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/alias", "ember-metal/computed_macros", "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", "ember-metal/is_present", "ember-metal/keys", "backburner", "ember-metal/streams/utils", "ember-metal/streams/stream"], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalInstrumentation, _emberMetalUtils, _emberMetalError, _emberMetalEnumerable_utils, _emberMetalCache, _emberMetalPlatformDefine_property, _emberMetalPlatformCreate, _emberMetalArray, _emberMetalLogger, _emberMetalProperty_get, _emberMetalEvents, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalProperty_set, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalExpand_properties, _emberMetalComputed, _emberMetalAlias, _emberMetalComputed_macros, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalRun_loop, _emberMetalLibraries, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _emberMetalKeys, _backburner, _emberMetalStreamsUtils, _emberMetalStreamsStream) { - /** - @module ember - @submodule ember-metal - */ +/*view*/ +enifed('ember-metal', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/merge', 'ember-metal/instrumentation', 'ember-metal/utils', 'ember-metal/error', 'ember-metal/cache', '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/alias', 'ember-metal/computed_macros', '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', 'ember-metal/is_present', 'backburner', 'ember-metal/streams/utils', 'ember-metal/streams/stream'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalMerge, _emberMetalInstrumentation, _emberMetalUtils, _emberMetalError, _emberMetalCache, _emberMetalLogger, _emberMetalProperty_get, _emberMetalEvents, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalProperty_set, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalExpand_properties, _emberMetalComputed, _emberMetalAlias, _emberMetalComputed_macros, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalRun_loop, _emberMetalLibraries, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _backburner, _emberMetalStreamsUtils, _emberMetalStreamsStream) { - // BEGIN IMPORTS - "use strict"; - _emberMetalComputed.computed.empty = _emberMetalComputed_macros.empty; _emberMetalComputed.computed.notEmpty = _emberMetalComputed_macros.notEmpty; _emberMetalComputed.computed.none = _emberMetalComputed_macros.none; _emberMetalComputed.computed.not = _emberMetalComputed_macros.not; _emberMetalComputed.computed.bool = _emberMetalComputed_macros.bool; @@ -12761,11 +11264,11 @@ _emberMetalComputed.computed.equal = _emberMetalComputed_macros.equal; _emberMetalComputed.computed.gt = _emberMetalComputed_macros.gt; _emberMetalComputed.computed.gte = _emberMetalComputed_macros.gte; _emberMetalComputed.computed.lt = _emberMetalComputed_macros.lt; _emberMetalComputed.computed.lte = _emberMetalComputed_macros.lte; - _emberMetalComputed.computed.alias = _emberMetalAlias["default"]; + _emberMetalComputed.computed.alias = _emberMetalAlias.default; _emberMetalComputed.computed.oneWay = _emberMetalComputed_macros.oneWay; _emberMetalComputed.computed.reads = _emberMetalComputed_macros.oneWay; _emberMetalComputed.computed.readOnly = _emberMetalComputed_macros.readOnly; _emberMetalComputed.computed.defaultTo = _emberMetalComputed_macros.defaultTo; _emberMetalComputed.computed.deprecatingAlias = _emberMetalComputed_macros.deprecatingAlias; @@ -12775,162 +11278,158 @@ _emberMetalComputed.computed.collect = _emberMetalComputed_macros.collect; // END IMPORTS // BEGIN EXPORTS - var EmberInstrumentation = _emberMetalCore["default"].Instrumentation = {}; + var EmberInstrumentation = _emberMetalCore.default.Instrumentation = {}; EmberInstrumentation.instrument = _emberMetalInstrumentation.instrument; EmberInstrumentation.subscribe = _emberMetalInstrumentation.subscribe; EmberInstrumentation.unsubscribe = _emberMetalInstrumentation.unsubscribe; EmberInstrumentation.reset = _emberMetalInstrumentation.reset; - _emberMetalCore["default"].instrument = _emberMetalInstrumentation.instrument; - _emberMetalCore["default"].subscribe = _emberMetalInstrumentation.subscribe; + _emberMetalCore.default.instrument = _emberMetalInstrumentation.instrument; + _emberMetalCore.default.subscribe = _emberMetalInstrumentation.subscribe; - _emberMetalCore["default"]._Cache = _emberMetalCache["default"]; + _emberMetalCore.default._Cache = _emberMetalCache.default; - _emberMetalCore["default"].generateGuid = _emberMetalUtils.generateGuid; - _emberMetalCore["default"].GUID_KEY = _emberMetalUtils.GUID_KEY; - _emberMetalCore["default"].platform = { - defineProperty: _emberMetalProperties.defineProperty, - hasPropertyAccessors: _emberMetalPlatformDefine_property.hasPropertyAccessors + _emberMetalCore.default.generateGuid = _emberMetalUtils.generateGuid; + _emberMetalCore.default.GUID_KEY = _emberMetalUtils.GUID_KEY; + _emberMetalCore.default.platform = { + defineProperty: true, + hasPropertyAccessors: true }; - var EmberArrayPolyfills = _emberMetalCore["default"].ArrayPolyfills = {}; + _emberMetalCore.default.Error = _emberMetalError.default; + _emberMetalCore.default.guidFor = _emberMetalUtils.guidFor; + _emberMetalCore.default.META_DESC = _emberMetalUtils.META_DESC; + _emberMetalCore.default.EMPTY_META = _emberMetalUtils.EMPTY_META; + _emberMetalCore.default.meta = _emberMetalUtils.meta; + _emberMetalCore.default.getMeta = _emberMetalUtils.getMeta; + _emberMetalCore.default.setMeta = _emberMetalUtils.setMeta; + _emberMetalCore.default.metaPath = _emberMetalUtils.metaPath; + _emberMetalCore.default.inspect = _emberMetalUtils.inspect; + _emberMetalCore.default.tryCatchFinally = _emberMetalUtils.deprecatedTryCatchFinally; + _emberMetalCore.default.makeArray = _emberMetalUtils.makeArray; + _emberMetalCore.default.canInvoke = _emberMetalUtils.canInvoke; + _emberMetalCore.default.tryInvoke = _emberMetalUtils.tryInvoke; + _emberMetalCore.default.wrap = _emberMetalUtils.wrap; + _emberMetalCore.default.apply = _emberMetalUtils.apply; + _emberMetalCore.default.applyStr = _emberMetalUtils.applyStr; + _emberMetalCore.default.uuid = _emberMetalUtils.uuid; - EmberArrayPolyfills.map = _emberMetalArray.map; - EmberArrayPolyfills.forEach = _emberMetalArray.forEach; - EmberArrayPolyfills.filter = _emberMetalArray.filter; - EmberArrayPolyfills.indexOf = _emberMetalArray.indexOf; + _emberMetalCore.default.Logger = _emberMetalLogger.default; - _emberMetalCore["default"].Error = _emberMetalError["default"]; - _emberMetalCore["default"].guidFor = _emberMetalUtils.guidFor; - _emberMetalCore["default"].META_DESC = _emberMetalUtils.META_DESC; - _emberMetalCore["default"].EMPTY_META = _emberMetalUtils.EMPTY_META; - _emberMetalCore["default"].meta = _emberMetalUtils.meta; - _emberMetalCore["default"].getMeta = _emberMetalUtils.getMeta; - _emberMetalCore["default"].setMeta = _emberMetalUtils.setMeta; - _emberMetalCore["default"].metaPath = _emberMetalUtils.metaPath; - _emberMetalCore["default"].inspect = _emberMetalUtils.inspect; - _emberMetalCore["default"].tryCatchFinally = _emberMetalUtils.deprecatedTryCatchFinally; - _emberMetalCore["default"].makeArray = _emberMetalUtils.makeArray; - _emberMetalCore["default"].canInvoke = _emberMetalUtils.canInvoke; - _emberMetalCore["default"].tryInvoke = _emberMetalUtils.tryInvoke; - _emberMetalCore["default"].tryFinally = _emberMetalUtils.deprecatedTryFinally; - _emberMetalCore["default"].wrap = _emberMetalUtils.wrap; - _emberMetalCore["default"].apply = _emberMetalUtils.apply; - _emberMetalCore["default"].applyStr = _emberMetalUtils.applyStr; - _emberMetalCore["default"].uuid = _emberMetalUtils.uuid; + _emberMetalCore.default.get = _emberMetalProperty_get.get; + _emberMetalCore.default.getWithDefault = _emberMetalProperty_get.getWithDefault; + _emberMetalCore.default.normalizeTuple = _emberMetalProperty_get.normalizeTuple; + _emberMetalCore.default._getPath = _emberMetalProperty_get._getPath; - _emberMetalCore["default"].Logger = _emberMetalLogger["default"]; + _emberMetalCore.default.on = _emberMetalEvents.on; + _emberMetalCore.default.addListener = _emberMetalEvents.addListener; + _emberMetalCore.default.removeListener = _emberMetalEvents.removeListener; + _emberMetalCore.default._suspendListener = _emberMetalEvents.suspendListener; + _emberMetalCore.default._suspendListeners = _emberMetalEvents.suspendListeners; + _emberMetalCore.default.sendEvent = _emberMetalEvents.sendEvent; + _emberMetalCore.default.hasListeners = _emberMetalEvents.hasListeners; + _emberMetalCore.default.watchedEvents = _emberMetalEvents.watchedEvents; + _emberMetalCore.default.listenersFor = _emberMetalEvents.listenersFor; + _emberMetalCore.default.accumulateListeners = _emberMetalEvents.accumulateListeners; - _emberMetalCore["default"].get = _emberMetalProperty_get.get; - _emberMetalCore["default"].getWithDefault = _emberMetalProperty_get.getWithDefault; - _emberMetalCore["default"].normalizeTuple = _emberMetalProperty_get.normalizeTuple; - _emberMetalCore["default"]._getPath = _emberMetalProperty_get._getPath; + _emberMetalCore.default._ObserverSet = _emberMetalObserver_set.default; - _emberMetalCore["default"].EnumerableUtils = _emberMetalEnumerable_utils["default"]; + _emberMetalCore.default.propertyWillChange = _emberMetalProperty_events.propertyWillChange; + _emberMetalCore.default.propertyDidChange = _emberMetalProperty_events.propertyDidChange; + _emberMetalCore.default.overrideChains = _emberMetalProperty_events.overrideChains; + _emberMetalCore.default.beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; + _emberMetalCore.default.endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; + _emberMetalCore.default.changeProperties = _emberMetalProperty_events.changeProperties; - _emberMetalCore["default"].on = _emberMetalEvents.on; - _emberMetalCore["default"].addListener = _emberMetalEvents.addListener; - _emberMetalCore["default"].removeListener = _emberMetalEvents.removeListener; - _emberMetalCore["default"]._suspendListener = _emberMetalEvents.suspendListener; - _emberMetalCore["default"]._suspendListeners = _emberMetalEvents.suspendListeners; - _emberMetalCore["default"].sendEvent = _emberMetalEvents.sendEvent; - _emberMetalCore["default"].hasListeners = _emberMetalEvents.hasListeners; - _emberMetalCore["default"].watchedEvents = _emberMetalEvents.watchedEvents; - _emberMetalCore["default"].listenersFor = _emberMetalEvents.listenersFor; - _emberMetalCore["default"].accumulateListeners = _emberMetalEvents.accumulateListeners; + _emberMetalCore.default.defineProperty = _emberMetalProperties.defineProperty; - _emberMetalCore["default"]._ObserverSet = _emberMetalObserver_set["default"]; + _emberMetalCore.default.set = _emberMetalProperty_set.set; + _emberMetalCore.default.trySet = _emberMetalProperty_set.trySet; - _emberMetalCore["default"].propertyWillChange = _emberMetalProperty_events.propertyWillChange; - _emberMetalCore["default"].propertyDidChange = _emberMetalProperty_events.propertyDidChange; - _emberMetalCore["default"].overrideChains = _emberMetalProperty_events.overrideChains; - _emberMetalCore["default"].beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; - _emberMetalCore["default"].endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; - _emberMetalCore["default"].changeProperties = _emberMetalProperty_events.changeProperties; + _emberMetalCore.default.OrderedSet = _emberMetalMap.OrderedSet; + _emberMetalCore.default.Map = _emberMetalMap.Map; + _emberMetalCore.default.MapWithDefault = _emberMetalMap.MapWithDefault; - _emberMetalCore["default"].defineProperty = _emberMetalProperties.defineProperty; + _emberMetalCore.default.getProperties = _emberMetalGet_properties.default; + _emberMetalCore.default.setProperties = _emberMetalSet_properties.default; - _emberMetalCore["default"].set = _emberMetalProperty_set.set; - _emberMetalCore["default"].trySet = _emberMetalProperty_set.trySet; + _emberMetalCore.default.watchKey = _emberMetalWatch_key.watchKey; + _emberMetalCore.default.unwatchKey = _emberMetalWatch_key.unwatchKey; - _emberMetalCore["default"].OrderedSet = _emberMetalMap.OrderedSet; - _emberMetalCore["default"].Map = _emberMetalMap.Map; - _emberMetalCore["default"].MapWithDefault = _emberMetalMap.MapWithDefault; + _emberMetalCore.default.flushPendingChains = _emberMetalChains.flushPendingChains; + _emberMetalCore.default.removeChainWatcher = _emberMetalChains.removeChainWatcher; + _emberMetalCore.default._ChainNode = _emberMetalChains.ChainNode; + _emberMetalCore.default.finishChains = _emberMetalChains.finishChains; - _emberMetalCore["default"].getProperties = _emberMetalGet_properties["default"]; - _emberMetalCore["default"].setProperties = _emberMetalSet_properties["default"]; + _emberMetalCore.default.watchPath = _emberMetalWatch_path.watchPath; + _emberMetalCore.default.unwatchPath = _emberMetalWatch_path.unwatchPath; - _emberMetalCore["default"].watchKey = _emberMetalWatch_key.watchKey; - _emberMetalCore["default"].unwatchKey = _emberMetalWatch_key.unwatchKey; + _emberMetalCore.default.watch = _emberMetalWatching.watch; + _emberMetalCore.default.isWatching = _emberMetalWatching.isWatching; + _emberMetalCore.default.unwatch = _emberMetalWatching.unwatch; + _emberMetalCore.default.rewatch = _emberMetalWatching.rewatch; + _emberMetalCore.default.destroy = _emberMetalWatching.destroy; - _emberMetalCore["default"].flushPendingChains = _emberMetalChains.flushPendingChains; - _emberMetalCore["default"].removeChainWatcher = _emberMetalChains.removeChainWatcher; - _emberMetalCore["default"]._ChainNode = _emberMetalChains.ChainNode; - _emberMetalCore["default"].finishChains = _emberMetalChains.finishChains; + _emberMetalCore.default.expandProperties = _emberMetalExpand_properties.default; - _emberMetalCore["default"].watchPath = _emberMetalWatch_path.watchPath; - _emberMetalCore["default"].unwatchPath = _emberMetalWatch_path.unwatchPath; + _emberMetalCore.default.ComputedProperty = _emberMetalComputed.ComputedProperty; + _emberMetalCore.default.computed = _emberMetalComputed.computed; + _emberMetalCore.default.cacheFor = _emberMetalComputed.cacheFor; - _emberMetalCore["default"].watch = _emberMetalWatching.watch; - _emberMetalCore["default"].isWatching = _emberMetalWatching.isWatching; - _emberMetalCore["default"].unwatch = _emberMetalWatching.unwatch; - _emberMetalCore["default"].rewatch = _emberMetalWatching.rewatch; - _emberMetalCore["default"].destroy = _emberMetalWatching.destroy; + _emberMetalCore.default.addObserver = _emberMetalObserver.addObserver; + _emberMetalCore.default.observersFor = _emberMetalObserver.observersFor; + _emberMetalCore.default.removeObserver = _emberMetalObserver.removeObserver; + _emberMetalCore.default.addBeforeObserver = _emberMetalCore.default.deprecateFunc('Ember.addBeforeObserver is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalObserver._addBeforeObserver); + _emberMetalCore.default._suspendBeforeObserver = _emberMetalObserver._suspendBeforeObserver; + _emberMetalCore.default._suspendBeforeObservers = _emberMetalObserver._suspendBeforeObservers; + _emberMetalCore.default._suspendObserver = _emberMetalObserver._suspendObserver; + _emberMetalCore.default._suspendObservers = _emberMetalObserver._suspendObservers; + _emberMetalCore.default.beforeObserversFor = _emberMetalCore.default.deprecateFunc('Ember.beforeObserversFor is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalObserver._beforeObserversFor); + _emberMetalCore.default.removeBeforeObserver = _emberMetalCore.default.deprecateFunc('Ember.removeBeforeObserver is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalObserver._removeBeforeObserver); - _emberMetalCore["default"].expandProperties = _emberMetalExpand_properties["default"]; + _emberMetalCore.default.IS_BINDING = _emberMetalMixin.IS_BINDING; + _emberMetalCore.default.required = _emberMetalMixin.required; + _emberMetalCore.default.aliasMethod = _emberMetalMixin.aliasMethod; + _emberMetalCore.default.observer = _emberMetalMixin.observer; + _emberMetalCore.default.immediateObserver = _emberMetalMixin._immediateObserver; + _emberMetalCore.default.beforeObserver = _emberMetalCore.default.deprecateFunc('Ember.beforeObserver is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalMixin._beforeObserver); + _emberMetalCore.default.mixin = _emberMetalMixin.mixin; + _emberMetalCore.default.Mixin = _emberMetalMixin.Mixin; - _emberMetalCore["default"].ComputedProperty = _emberMetalComputed.ComputedProperty; - _emberMetalCore["default"].computed = _emberMetalComputed.computed; - _emberMetalCore["default"].cacheFor = _emberMetalComputed.cacheFor; + _emberMetalCore.default.oneWay = _emberMetalBinding.oneWay; + _emberMetalCore.default.bind = _emberMetalBinding.bind; + _emberMetalCore.default.Binding = _emberMetalBinding.Binding; + _emberMetalCore.default.isGlobalPath = _emberMetalBinding.isGlobalPath; - _emberMetalCore["default"].addObserver = _emberMetalObserver.addObserver; - _emberMetalCore["default"].observersFor = _emberMetalObserver.observersFor; - _emberMetalCore["default"].removeObserver = _emberMetalObserver.removeObserver; - _emberMetalCore["default"]._suspendBeforeObserver = _emberMetalObserver._suspendBeforeObserver; - _emberMetalCore["default"]._suspendBeforeObservers = _emberMetalObserver._suspendBeforeObservers; - _emberMetalCore["default"]._suspendObserver = _emberMetalObserver._suspendObserver; - _emberMetalCore["default"]._suspendObservers = _emberMetalObserver._suspendObservers; + _emberMetalCore.default.run = _emberMetalRun_loop.default; - _emberMetalCore["default"].IS_BINDING = _emberMetalMixin.IS_BINDING; - _emberMetalCore["default"].required = _emberMetalMixin.required; - _emberMetalCore["default"].aliasMethod = _emberMetalMixin.aliasMethod; - _emberMetalCore["default"].observer = _emberMetalMixin.observer; - _emberMetalCore["default"].immediateObserver = _emberMetalMixin._immediateObserver; - _emberMetalCore["default"].mixin = _emberMetalMixin.mixin; - _emberMetalCore["default"].Mixin = _emberMetalMixin.Mixin; - - _emberMetalCore["default"].oneWay = _emberMetalBinding.oneWay; - _emberMetalCore["default"].bind = _emberMetalBinding.bind; - _emberMetalCore["default"].Binding = _emberMetalBinding.Binding; - _emberMetalCore["default"].isGlobalPath = _emberMetalBinding.isGlobalPath; - - _emberMetalCore["default"].run = _emberMetalRun_loop["default"]; - /** @class Backburner @for Ember @private */ - _emberMetalCore["default"].Backburner = _backburner["default"]; + _emberMetalCore.default.Backburner = _backburner.default; // this is the new go forward, once Ember Data updates to using `_Backburner` we // can remove the non-underscored version. - _emberMetalCore["default"]._Backburner = _backburner["default"]; + _emberMetalCore.default._Backburner = _backburner.default; - _emberMetalCore["default"].libraries = new _emberMetalLibraries["default"](); - _emberMetalCore["default"].libraries.registerCoreLibrary('Ember', _emberMetalCore["default"].VERSION); + _emberMetalCore.default.libraries = new _emberMetalLibraries.default(); + _emberMetalCore.default.libraries.registerCoreLibrary('Ember', _emberMetalCore.default.VERSION); - _emberMetalCore["default"].isNone = _emberMetalIs_none["default"]; - _emberMetalCore["default"].isEmpty = _emberMetalIs_empty["default"]; - _emberMetalCore["default"].isBlank = _emberMetalIs_blank["default"]; - _emberMetalCore["default"].isPresent = _emberMetalIs_present["default"]; + _emberMetalCore.default.isNone = _emberMetalIs_none.default; + _emberMetalCore.default.isEmpty = _emberMetalIs_empty.default; + _emberMetalCore.default.isBlank = _emberMetalIs_blank.default; + _emberMetalCore.default.isPresent = _emberMetalIs_present.default; - _emberMetalCore["default"].merge = _emberMetalMerge["default"]; + _emberMetalCore.default.merge = _emberMetalMerge.default; - + _emberMetalCore.default.FEATURES = _emberMetalFeatures.FEATURES; + _emberMetalCore.default.FEATURES.isEnabled = _emberMetalFeatures.default; + /** A function may be assigned to `Ember.onerror` to be called when Ember internals encounter an error. This is useful for specialized error handling and reporting code. @@ -12948,34 +11447,32 @@ @event onerror @for Ember @param {Exception} error the error object @public */ - _emberMetalCore["default"].onerror = null; + _emberMetalCore.default.onerror = null; // END EXPORTS // do this for side-effects of updating Ember.assert, warn, etc when // ember-debug is present - // This needs to be called before any deprecateFunc - if (_emberMetalCore["default"].__loader.registry['ember-debug']) { + if (_emberMetalCore.default.__loader.registry['ember-debug']) { requireModule('ember-debug'); } - _emberMetalCore["default"].create = _emberMetalCore["default"].deprecateFunc('Ember.create is deprecated in favor of Object.create', _emberMetalPlatformCreate["default"]); - _emberMetalCore["default"].keys = _emberMetalCore["default"].deprecateFunc('Ember.keys is deprecated in favor of Object.keys', _emberMetalKeys["default"]); + _emberMetalCore.default.create = _emberMetalCore.default.deprecateFunc('Ember.create is deprecated in favor of Object.create', Object.create); + _emberMetalCore.default.keys = _emberMetalCore.default.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', Object.keys); - _emberMetalCore["default"].addBeforeObserver = _emberMetalCore["default"].deprecateFunc('Ember.addBeforeObserver is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalObserver._addBeforeObserver); - _emberMetalCore["default"].removeBeforeObserver = _emberMetalCore["default"].deprecateFunc('Ember.removeBeforeObserver is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalObserver._removeBeforeObserver); - _emberMetalCore["default"].beforeObserversFor = _emberMetalCore["default"].deprecateFunc('Ember.beforeObserversFor is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalObserver._beforeObserversFor); - _emberMetalCore["default"].beforeObserver = _emberMetalCore["default"].deprecateFunc('Ember.beforeObserver is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalMixin._beforeObserver); - - exports["default"] = _emberMetalCore["default"]; + exports.default = _emberMetalCore.default; }); -enifed("ember-metal/alias", ["exports", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/core", "ember-metal/error", "ember-metal/properties", "ember-metal/computed", "ember-metal/platform/create", "ember-metal/utils", "ember-metal/dependent_keys"], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalCore, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalPlatformCreate, _emberMetalUtils, _emberMetalDependent_keys) { - "use strict"; +/** +@module ember +@submodule ember-metal +*/ - exports["default"] = alias; +// BEGIN IMPORTS +enifed('ember-metal/alias', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/core', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/utils', 'ember-metal/dependent_keys'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalCore, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalUtils, _emberMetalDependent_keys) { + exports.default = alias; exports.AliasedProperty = AliasedProperty; function alias(altKey) { return new AliasedProperty(altKey); } @@ -12984,11 +11481,11 @@ this.isDescriptor = true; this.altKey = altKey; this._dependentKeys = [altKey]; } - AliasedProperty.prototype = _emberMetalPlatformCreate["default"](_emberMetalProperties.Descriptor.prototype); + AliasedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { return _emberMetalProperty_get.get(obj, this.altKey); }; @@ -13022,11 +11519,11 @@ this.set = AliasedProperty_readOnlySet; return this; }; function AliasedProperty_readOnlySet(obj, keyName, value) { - throw new _emberMetalError["default"]("Cannot set read-only property '" + keyName + "' on object: " + _emberMetalUtils.inspect(obj)); + throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberMetalUtils.inspect(obj)); } AliasedProperty.prototype.oneWay = function () { this.set = AliasedProperty_oneWaySet; return this; @@ -13040,150 +11537,11 @@ // Backwards compatibility with Ember Data AliasedProperty.prototype._meta = undefined; AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; }); // Ember.assert -enifed("ember-metal/array", ["exports"], function (exports) { - /** - @module ember - @submodule ember-metal - */ - - "use strict"; - - var ArrayPrototype = Array.prototype; - - // Testing this is not ideal, but we want to use native functions - // if available, but not to use versions created by libraries like Prototype - var isNativeFunc = function (func) { - // This should probably work in all browsers likely to have ES5 array methods - return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1; - }; - - var defineNativeShim = function (nativeFunc, shim) { - if (isNativeFunc(nativeFunc)) { - return nativeFunc; - } - return shim; - }; - - // From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/map - var map = defineNativeShim(ArrayPrototype.map, function (fun) { - //"use strict"; - - if (this === void 0 || this === null || typeof fun !== "function") { - throw new TypeError(); - } - - var t = Object(this); - var len = t.length >>> 0; - var res = new Array(len); - - for (var i = 0; i < len; i++) { - if (i in t) { - res[i] = fun.call(arguments[1], t[i], i, t); - } - } - - return res; - }); - - // From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach - var forEach = defineNativeShim(ArrayPrototype.forEach, function (fun) { - //"use strict"; - - if (this === void 0 || this === null || typeof fun !== "function") { - throw new TypeError(); - } - - var t = Object(this); - var len = t.length >>> 0; - - for (var i = 0; i < len; i++) { - if (i in t) { - fun.call(arguments[1], t[i], i, t); - } - } - }); - - var indexOf = defineNativeShim(ArrayPrototype.indexOf, function (obj, fromIndex) { - if (fromIndex === null || fromIndex === undefined) { - fromIndex = 0; - } else if (fromIndex < 0) { - fromIndex = Math.max(0, this.length + fromIndex); - } - - for (var i = fromIndex, j = this.length; i < j; i++) { - if (this[i] === obj) { - return i; - } - } - return -1; - }); - - var lastIndexOf = defineNativeShim(ArrayPrototype.lastIndexOf, function (obj, fromIndex) { - var len = this.length; - var idx; - - if (fromIndex === undefined) { - fromIndex = len - 1; - } else { - fromIndex = fromIndex < 0 ? Math.ceil(fromIndex) : Math.floor(fromIndex); - } - - if (fromIndex < 0) { - fromIndex += len; - } - - for (idx = fromIndex; idx >= 0; idx--) { - if (this[idx] === obj) { - return idx; - } - } - return -1; - }); - - var filter = defineNativeShim(ArrayPrototype.filter, function (fn, context) { - var i, value; - var result = []; - var length = this.length; - - for (i = 0; i < length; i++) { - if (Object.prototype.hasOwnProperty.call(this, i)) { - value = this[i]; - if (fn.call(context, value, i, this)) { - result.push(value); - } - } - } - return result; - }); - - if (Ember.SHIM_ES5) { - ArrayPrototype.map = ArrayPrototype.map || map; - ArrayPrototype.forEach = ArrayPrototype.forEach || forEach; - ArrayPrototype.filter = ArrayPrototype.filter || filter; - ArrayPrototype.indexOf = ArrayPrototype.indexOf || indexOf; - ArrayPrototype.lastIndexOf = ArrayPrototype.lastIndexOf || lastIndexOf; - } - - /** - Array polyfills to support ES5 features in older browsers. - - @namespace Ember - @property ArrayPolyfills - @public - */ - exports.map = map; - exports.forEach = forEach; - exports.filter = filter; - exports.indexOf = indexOf; - exports.lastIndexOf = lastIndexOf; -}); -enifed("ember-metal/binding", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/utils", "ember-metal/observer", "ember-metal/run_loop", "ember-metal/path_cache"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalObserver, _emberMetalRun_loop, _emberMetalPath_cache) { - "use strict"; - +enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/observer', 'ember-metal/run_loop', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalObserver, _emberMetalRun_loop, _emberMetalPath_cache) { exports.bind = bind; exports.oneWay = oneWay; // ES6TODO: where is Ember.lookup defined? /** @@ -13204,11 +11562,11 @@ @for Ember @type Boolean @default false @public */ - _emberMetalCore["default"].LOG_BINDINGS = false || !!_emberMetalCore["default"].ENV.LOG_BINDINGS; + _emberMetalCore.default.LOG_BINDINGS = false || !!_emberMetalCore.default.ENV.LOG_BINDINGS; /** Returns true if the provided path is global (e.g., `MyApp.fooController.bar`) instead of local (`foo.bar.baz`). @@ -13218,11 +11576,11 @@ @param {String} path @return Boolean */ function getWithGlobals(obj, path) { - return _emberMetalProperty_get.get(_emberMetalPath_cache.isGlobal(path) ? _emberMetalCore["default"].lookup : obj, path); + return _emberMetalProperty_get.get(_emberMetalPath_cache.isGlobal(path) ? _emberMetalCore.default.lookup : obj, path); } // .......................................................... // BINDING // @@ -13313,11 +11671,11 @@ @return {String} string representation of binding @public */ toString: function () { var oneWay = this._oneWay ? '[oneWay]' : ''; - return "Ember.Binding<" + _emberMetalUtils.guidFor(this) + ">(" + this._from + " -> " + this._to + ")" + oneWay; + return 'Ember.Binding<' + _emberMetalUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; }, // .......................................................... // CONNECT AND SYNC // @@ -13392,11 +11750,11 @@ _scheduleSync: function (obj, dir) { var existingDir = this._direction; // if we haven't scheduled the binding yet, schedule it if (existingDir === undefined) { - _emberMetalRun_loop["default"].schedule('sync', this, this._sync, obj); + _emberMetalRun_loop.default.schedule('sync', this, this._sync, obj); this._direction = dir; } // If both a 'back' and 'fwd' sync have been scheduled on the same object, // default to a 'fwd' sync so that it remains deterministic. @@ -13404,11 +11762,11 @@ this._direction = 'fwd'; } }, _sync: function (obj) { - var log = _emberMetalCore["default"].LOG_BINDINGS; + var log = _emberMetalCore.default.LOG_BINDINGS; // don't synchronize destroyed objects or disconnected bindings if (obj.isDestroyed || !this._readyToSync) { return; } @@ -13424,29 +11782,29 @@ // if we're synchronizing from the remote object... if (direction === 'fwd') { var fromValue = getWithGlobals(obj, this._from); if (log) { - _emberMetalCore["default"].Logger.log(' ', this.toString(), '->', fromValue, obj); + _emberMetalCore.default.Logger.log(' ', this.toString(), '->', fromValue, obj); } if (this._oneWay) { _emberMetalProperty_set.trySet(obj, toPath, fromValue); } else { _emberMetalObserver._suspendObserver(obj, toPath, this, this.toDidChange, function () { _emberMetalProperty_set.trySet(obj, toPath, fromValue); }); } // if we're synchronizing *to* the remote object } else if (direction === 'back') { - var toValue = _emberMetalProperty_get.get(obj, this._to); - if (log) { - _emberMetalCore["default"].Logger.log(' ', this.toString(), '<-', toValue, obj); - } - _emberMetalObserver._suspendObserver(obj, fromPath, this, this.fromDidChange, function () { - _emberMetalProperty_set.trySet(_emberMetalPath_cache.isGlobal(fromPath) ? _emberMetalCore["default"].lookup : obj, fromPath, toValue); - }); + var toValue = _emberMetalProperty_get.get(obj, this._to); + if (log) { + _emberMetalCore.default.Logger.log(' ', this.toString(), '<-', toValue, obj); } + _emberMetalObserver._suspendObserver(obj, fromPath, this, this.fromDidChange, function () { + _emberMetalProperty_set.trySet(_emberMetalPath_cache.isGlobal(fromPath) ? _emberMetalCore.default.lookup : obj, fromPath, toValue); + }); + } } }; function mixinProperties(to, from) { @@ -13490,11 +11848,10 @@ @param {String} from from path. @param {Boolean} [flag] (Optional) passing nothing here will make the binding `oneWay`. You can instead pass `false` to disable `oneWay`, making the binding two way again. @return {Ember.Binding} `this` - @deprecated @public */ oneWay: function (from, flag) { var C = this; return new C(undefined, from).oneWay(flag); @@ -13671,16 +12028,14 @@ exports.Binding = Binding; exports.isGlobalPath = _emberMetalPath_cache.isGlobal; }); // Ember.Logger, Ember.LOG_BINDINGS, assert enifed('ember-metal/cache', ['exports', 'ember-metal/dictionary'], function (exports, _emberMetalDictionary) { - 'use strict'; + exports.default = Cache; - exports["default"] = Cache; - function Cache(limit, func) { - this.store = _emberMetalDictionary["default"](null); + this.store = _emberMetalDictionary.default(null); this.size = 0; this.misses = 0; this.hits = 0; this.limit = limit; this.func = func; @@ -13718,34 +12073,40 @@ return value; }, purge: function () { - this.store = _emberMetalDictionary["default"](null); + this.store = _emberMetalDictionary.default(null); this.size = 0; this.hits = 0; this.misses = 0; } }; }); -enifed("ember-metal/chains", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/utils", "ember-metal/array", "ember-metal/watch_key"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberMetalArray, _emberMetalWatch_key) { - "use strict"; - +enifed('ember-metal/chains', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/watch_key'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberMetalWatch_key) { exports.flushPendingChains = flushPendingChains; exports.finishChains = finishChains; - var warn = _emberMetalCore["default"].warn; + var warn = _emberMetalCore.default.warn; var FIRST_KEY = /^([^\.]+)/; function firstKey(path) { return path.match(FIRST_KEY)[0]; } function isObject(obj) { return obj && typeof obj === 'object'; } + function isVolatile(obj) { + return !(isObject(obj) && obj.isDescriptor && obj._cacheable); + } + + function Chains() {} + + Chains.prototype = Object.create(null); + var pendingQueue = []; // attempts to add the pendingQueue chains again. If some of them end up // back in the queue and reschedule is true, schedules a timeout to try // again. @@ -13756,12 +12117,12 @@ } var queue = pendingQueue; pendingQueue = []; - _emberMetalArray.forEach.call(queue, function (q) { - q[0].add(q[1]); + queue.forEach(function (q) { + return q[0].add(q[1]); }); 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); } @@ -13773,17 +12134,19 @@ var m = _emberMetalUtils.meta(obj); var nodes = m.chainWatchers; if (!m.hasOwnProperty('chainWatchers')) { // FIXME?! - nodes = m.chainWatchers = {}; + nodes = m.chainWatchers = new Chains(); } if (!nodes[keyName]) { - nodes[keyName] = []; + nodes[keyName] = [node]; + } else { + nodes[keyName].push(node); } - nodes[keyName].push(node); + _emberMetalWatch_key.watchKey(obj, keyName, m); } function removeChainWatcher(obj, keyName, node) { if (!isObject(obj)) { @@ -13822,10 +12185,14 @@ // It is false for the root of a chain (because we have no parent) // and for global paths (because the parent node is the object with // the observer on it) this._watching = value === undefined; + this._chains = undefined; + this._object = undefined; + this.count = 0; + this._value = value; this._paths = {}; if (this._watching) { this._object = parent.value(); if (this._object) { @@ -13847,31 +12214,25 @@ if (!obj) { return; } var meta = obj['__ember_meta__']; + // check if object meant only to be a prototype if (meta && meta.proto === obj) { return; } - if (key === "@each") { + // Use `get` if the return value is an EachProxy or an uncacheable value. + if (key === '@each' || isVolatile(obj[key])) { return _emberMetalProperty_get.get(obj, key); - } - - // if a CP only return cached value - var possibleDesc = obj[key]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - if (desc && desc._cacheable) { + // Otherwise attempt to get the cached value of the computed property + } else { if (meta.cache && key in meta.cache) { return meta.cache[key]; - } else { - return; } } - - return _emberMetalProperty_get.get(obj, key); } ChainNode.prototype = { value: function () { if (this._value === undefined && this._watching) { @@ -13925,20 +12286,20 @@ path = path.slice(key.length + 1); // global path, but object does not exist yet. // put into a queue and try to connect later. } else if (!tuple[0]) { - pendingQueue.push([this, path]); - tuple.length = 0; - return; + pendingQueue.push([this, path]); + tuple.length = 0; + return; - // global path, and object already exists - } else { - src = tuple[0]; - key = path.slice(0, 0 - (tuple[1].length + 1)); - path = tuple[1]; - } + // global path, and object already exists + } else { + src = tuple[0]; + key = path.slice(0, 0 - (tuple[1].length + 1)); + path = tuple[1]; + } tuple.length = 0; this.chain(key, path, src); }, @@ -13966,23 +12327,23 @@ tuple.length = 0; this.unchain(key, path); }, - count: 0, - chain: function (key, path, src) { var chains = this._chains; var node; - if (!chains) { - chains = this._chains = {}; + if (chains === undefined) { + chains = this._chains = new Chains(); + } else { + node = chains[key]; } - node = chains[key]; - if (!node) { + if (node === undefined) { node = chains[key] = new ChainNode(this, key, src); } + node.count++; // count chains... // chain rest of path if there is one if (path) { key = firstKey(path); @@ -14003,11 +12364,11 @@ } // delete node if needed. node.count--; if (node.count <= 0) { - delete chains[node._key]; + chains[node._key] = undefined; node.destroy(); } }, willChange: function (events) { @@ -14081,16 +12442,17 @@ } } // then notify chains... var chains = this._chains; + var node; if (chains) { for (var key in chains) { - if (!chains.hasOwnProperty(key)) { - continue; + node = chains[key]; + if (node !== undefined) { + node.didChange(events); } - chains[key].didChange(events); } } // if no events are passed in then we only care about the above wiring update if (events === null) { @@ -14112,14 +12474,10 @@ if (m) { // finish any current chains node watchers that reference obj chainWatchers = m.chainWatchers; if (chainWatchers) { for (var key in chainWatchers) { - if (!chainWatchers.hasOwnProperty(key)) { - continue; - } - chainNodes = chainWatchers[key]; if (chainNodes) { for (var i = 0, l = chainNodes.length; i < l; i++) { var node = chainNodes[i]; if (node) { @@ -14139,12 +12497,12 @@ exports.removeChainWatcher = removeChainWatcher; exports.ChainNode = ChainNode; }); // warn, assert, etc; -enifed("ember-metal/computed", ["exports", "ember-metal/core", "ember-metal/property_set", "ember-metal/utils", "ember-metal/expand_properties", "ember-metal/error", "ember-metal/properties", "ember-metal/property_events", "ember-metal/dependent_keys"], function (exports, _emberMetalCore, _emberMetalProperty_set, _emberMetalUtils, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { - "use strict"; +enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/expand_properties', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/dependent_keys'], function (exports, _emberMetalCore, _emberMetalProperty_set, _emberMetalUtils, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { + exports.default = computed; /** @module ember @submodule ember-metal */ @@ -14238,60 +12596,29 @@ @constructor @public */ function ComputedProperty(config, opts) { this.isDescriptor = true; - if (typeof config === "function") { - config.__ember_arity = config.length; + if (typeof config === 'function') { this._getter = config; - if (config.__ember_arity > 1) { - this._setter = config; - } } else { this._getter = config.get; this._setter = config.set; - if (this._setter && this._setter.__ember_arity === undefined) { - this._setter.__ember_arity = this._setter.length; - } } - this._dependentKeys = undefined; this._suspended = undefined; this._meta = undefined; - - this._cacheable = opts && opts.cacheable !== undefined ? opts.cacheable : true; // TODO: Set always to `true` once this deprecation is gone. + this._cacheable = true; this._dependentKeys = opts && opts.dependentKeys; - this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly) || false; // TODO: Set always to `false` once this deprecation is gone. + this._readOnly = false; } ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); var ComputedPropertyPrototype = ComputedProperty.prototype; /** - Properties are cacheable by default. Computed property will automatically - cache the return value of your function until one of the dependent keys changes. - - Call `volatile()` to set it into non-cached mode. When in this mode - the computed property will not automatically cache the return value. - - However, if a property is properly observable, there is no reason to disable - caching. - - @method cacheable - @param {Boolean} aFlag optional set to `false` to disable caching - @return {Ember.ComputedProperty} this - @chainable - @deprecated All computed properties are cacheble by default. Use `volatile()` instead to opt-out to caching. - @public - */ - ComputedPropertyPrototype.cacheable = function (aFlag) { - this._cacheable = aFlag !== false; - return this; - }; - - /** Call on a computed property to set it into non-cached mode. When in this mode the computed property will not automatically cache the return value. ```javascript var outsideService = Ember.Object.extend({ @@ -14304,11 +12631,11 @@ @method volatile @return {Ember.ComputedProperty} this @chainable @public */ - ComputedPropertyPrototype["volatile"] = function () { + ComputedPropertyPrototype.volatile = function () { this._cacheable = false; return this; }; /** @@ -14330,12 +12657,12 @@ @method readOnly @return {Ember.ComputedProperty} this @chainable @public */ - ComputedPropertyPrototype.readOnly = function (readOnly) { - this._readOnly = readOnly === undefined || !!readOnly; // Force to true once this deprecation is gone + ComputedPropertyPrototype.readOnly = function () { + this._readOnly = true; return this; }; /** Sets the dependent keys on this computed property. Pass any number of @@ -14367,17 +12694,16 @@ */ ComputedPropertyPrototype.property = function () { var args; var addArg = function (property) { - args.push(property); }; args = []; for (var i = 0, l = arguments.length; i < l; i++) { - _emberMetalExpand_properties["default"](arguments[i], addArg); + _emberMetalExpand_properties.default(arguments[i], addArg); } this._dependentKeys = args; return this; }; @@ -14568,11 +12894,11 @@ var hadCachedValue = false; var cachedValue, ret; if (this._readOnly) { - throw new _emberMetalError["default"]("Cannot set read-only property \"" + keyName + "\" on object: " + _emberMetalUtils.inspect(obj)); + throw new _emberMetalError.default('Cannot set read-only property "' + keyName + '" on object: ' + _emberMetalUtils.inspect(obj)); } if (cacheable && cache && cache[keyName] !== undefined) { if (cache[keyName] !== UNDEFINED) { cachedValue = cache[keyName]; @@ -14581,16 +12907,11 @@ hadCachedValue = true; } if (!setter) { _emberMetalProperties.defineProperty(obj, keyName, null, cachedValue); - _emberMetalProperty_set.set(obj, keyName, value); - return; - } else if (setter.__ember_arity === 2) { - // Is there any way of deprecate this in a sensitive way? - // Maybe now that getters and setters are the prefered options we can.... - ret = setter.call(obj, keyName, value); + return _emberMetalProperty_set.set(obj, keyName, value); } else { ret = setter.call(obj, keyName, value, cachedValue); } if (hadCachedValue && cachedValue === ret) { @@ -14696,10 +13017,11 @@ @param {String} [dependentKeys*] Optional dependent keys that trigger this computed property. @param {Function} func The computed property function. @return {Ember.ComputedProperty} property descriptor instance @public */ + function computed(func) { var args; if (arguments.length > 1) { args = [].slice.call(arguments); @@ -14762,13 +13084,11 @@ exports.ComputedProperty = ComputedProperty; exports.computed = computed; exports.cacheFor = cacheFor; }); -enifed("ember-metal/computed_macros", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/computed", "ember-metal/is_empty", "ember-metal/is_none", "ember-metal/alias"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalIs_empty, _emberMetalIs_none, _emberMetalAlias) { - "use strict"; - +enifed('ember-metal/computed_macros', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-metal/is_empty', 'ember-metal/is_none', 'ember-metal/alias'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalIs_empty, _emberMetalIs_none, _emberMetalAlias) { exports.empty = empty; exports.notEmpty = notEmpty; exports.none = none; exports.not = not; exports.bool = bool; @@ -14778,11 +13098,10 @@ exports.gte = gte; exports.lt = lt; exports.lte = lte; exports.oneWay = oneWay; exports.readOnly = readOnly; - exports.defaultTo = defaultTo; exports.deprecatingAlias = deprecatingAlias; /** @module ember @submodule ember-metal @@ -14839,11 +13158,11 @@ @public */ function empty(dependentKey) { return _emberMetalComputed.computed(dependentKey + '.length', function () { - return _emberMetalIs_empty["default"](_emberMetalProperty_get.get(this, dependentKey)); + return _emberMetalIs_empty.default(_emberMetalProperty_get.get(this, dependentKey)); }); } /** A computed property that returns true if the value of the dependent @@ -14871,11 +13190,11 @@ @public */ function notEmpty(dependentKey) { return _emberMetalComputed.computed(dependentKey + '.length', function () { - return !_emberMetalIs_empty["default"](_emberMetalProperty_get.get(this, dependentKey)); + return !_emberMetalIs_empty.default(_emberMetalProperty_get.get(this, dependentKey)); }); } /** A computed property that returns true if the value of the dependent @@ -14906,11 +13225,11 @@ @public */ function none(dependentKey) { return _emberMetalComputed.computed(dependentKey, function () { - return _emberMetalIs_none["default"](_emberMetalProperty_get.get(this, dependentKey)); + return _emberMetalIs_none.default(_emberMetalProperty_get.get(this, dependentKey)); }); } /** A computed property that returns the inverse boolean value @@ -15268,46 +13587,10 @@ return false; }); exports.or = or; /** - A computed property that returns the first truthy value - from a list of dependent properties. - - Example - - ```javascript - var Hamster = Ember.Object.extend({ - hasClothes: Ember.computed.any('hat', 'shirt') - }); - - var hamster = Hamster.create(); - - hamster.get('hasClothes'); // null - hamster.set('shirt', 'Hawaiian Shirt'); - hamster.get('hasClothes'); // 'Hawaiian Shirt' - ``` - - @method any - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which returns - the first truthy value of given list of properties. - @deprecated Use `Ember.computed.or` instead. - @public - */ - var any = generateComputedWithProperties(function (properties) { - for (var key in properties) { - if (properties.hasOwnProperty(key) && properties[key]) { - return properties[key]; - } - } - return null; - }); - - exports.any = any; - /** A computed property that returns the array of values for the provided dependent properties. Example @@ -15330,14 +13613,14 @@ @return {Ember.ComputedProperty} computed property which maps values of all passed in properties to an array. @public */ var collect = generateComputedWithProperties(function (properties) { - var res = _emberMetalCore["default"].A(); + var res = _emberMetalCore.default.A(); for (var key in properties) { if (properties.hasOwnProperty(key)) { - if (_emberMetalIs_none["default"](properties[key])) { + if (_emberMetalIs_none.default(properties[key])) { res.push(null); } else { res.push(properties[key]); } } @@ -15407,11 +13690,11 @@ one way computed property to the original value for property. @public */ function oneWay(dependentKey) { - return _emberMetalAlias["default"](dependentKey).oneWay(); + return _emberMetalAlias.default(dependentKey).oneWay(); } /** This is a more semantically meaningful alias of `computed.oneWay`, whose name is somewhat ambiguous as to which direction the data flows. @@ -15459,55 +13742,14 @@ @since 1.5.0 @public */ function readOnly(dependentKey) { - return _emberMetalAlias["default"](dependentKey).readOnly(); + return _emberMetalAlias.default(dependentKey).readOnly(); } /** - A computed property that acts like a standard getter and setter, - but returns the value at the provided `defaultPath` if the - property itself has not been set to a value - - Example - - ```javascript - var Hamster = Ember.Object.extend({ - wishList: Ember.computed.defaultTo('favoriteFood') - }); - - var hamster = Hamster.create({ favoriteFood: 'Banana' }); - - hamster.get('wishList'); // 'Banana' - hamster.set('wishList', 'More Unit Tests'); - hamster.get('wishList'); // 'More Unit Tests' - hamster.get('favoriteFood'); // 'Banana' - ``` - - @method defaultTo - @for Ember.computed - @param {String} defaultPath - @return {Ember.ComputedProperty} computed property which acts like - a standard getter and setter, but defaults to the value from `defaultPath`. - @deprecated Use `Ember.computed.oneWay` or custom CP with default instead. - @public - */ - - function defaultTo(defaultPath) { - return _emberMetalComputed.computed({ - get: function (key) { - return _emberMetalProperty_get.get(this, defaultPath); - }, - - set: function (key, newValue, cachedValue) { - return newValue != null ? newValue : _emberMetalProperty_get.get(this, defaultPath); - } - }); - } - - /** Creates a new property that is an alias for another property on an object. Calls to `get` or `set` this property behave as though they were called on the original property, but also print a deprecation warning. @@ -15553,16 +13795,14 @@ cross-platform libraries such as jQuery. For more details, see [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). @class Ember @static - @version 1.13.13 + @version 2.0.0-beta.2 @public */ - 'use strict'; - if ('undefined' === typeof Ember) { // Create core object. Make it act like an instance of Ember.Namespace so that // objects assigned to it are given a sane string representation. Ember = {}; } @@ -15587,15 +13827,15 @@ /** The semantic version. @property VERSION @type String - @default '1.13.13' + @default '2.0.0-beta.2' @static @public */ - Ember.VERSION = '1.13.13'; + Ember.VERSION = '2.0.0-beta.2'; /** The hash of environment variables used to control various configuration settings. To specify your own or override default settings, add the desired properties to a global hash named `EmberENV` (or `ENV` for @@ -15622,65 +13862,10 @@ // We disable the RANGE API by default for performance reasons if ('undefined' === typeof Ember.ENV.DISABLE_RANGE_API) { Ember.ENV.DISABLE_RANGE_API = true; } - /** - The hash of enabled Canary features. Add to this, any canary features - before creating your application. - - Alternatively (and recommended), you can also define `EmberENV.FEATURES` - if you need to enable features flagged at runtime. - - @class FEATURES - @namespace Ember - @static - @since 1.1.0 - @public - */ - Ember.FEATURES = {"features-stripped-test":false,"ember-routing-named-substates":true,"mandatory-setter":false,"ember-htmlbars-component-generation":false,"ember-htmlbars-component-helper":true,"ember-htmlbars-inline-if-helper":true,"ember-htmlbars-attribute-syntax":true,"ember-routing-transitioning-classes":true,"ember-testing-checkbox-helpers":false,"ember-metal-stream":false,"ember-application-instance-initializers":true,"ember-application-initializer-context":true,"ember-router-willtransition":true,"ember-application-visit":false,"ember-views-component-block-info":true,"ember-routing-core-outlet":false,"ember-libraries-isregistered":false,"ember-routing-htmlbars-improved-actions":true,"ember-htmlbars-get-helper":false,"ember-htmlbars-helper":true,"ember-htmlbars-dashless-helpers":true}; //jshint ignore:line - - if (Ember.ENV.FEATURES) { - for (var feature in Ember.ENV.FEATURES) { - if (Ember.ENV.FEATURES.hasOwnProperty(feature)) { - Ember.FEATURES[feature] = Ember.ENV.FEATURES[feature]; - } - } - } - - /** - Determine whether the specified `feature` is enabled. Used by Ember's - build tools to exclude experimental features from beta/stable builds. - - You can define the following configuration options: - - * `EmberENV.ENABLE_ALL_FEATURES` - force all features to be enabled. - * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly - enabled/disabled. - - @method isEnabled - @param {String} feature The feature to check - @return {Boolean} - @for Ember.FEATURES - @since 1.1.0 - @public - */ - - Ember.FEATURES.isEnabled = function (feature) { - var featureValue = Ember.FEATURES[feature]; - - if (Ember.ENV.ENABLE_ALL_FEATURES) { - return true; - } else if (featureValue === true || featureValue === false || featureValue === undefined) { - return featureValue; - } else if (Ember.ENV.ENABLE_OPTIONAL_FEATURES) { - return true; - } else { - return false; - } - }; - // .......................................................... // BOOTSTRAP // /** @@ -15743,10 +13928,11 @@ /** An empty function useful for some operations. Always returns `this`. @method K + @private @return {Object} @public */ function K() { return this; @@ -15772,29 +13958,24 @@ } if ('undefined' === typeof Ember.deprecate) { Ember.deprecate = K; } if ('undefined' === typeof Ember.deprecateFunc) { - Ember.deprecateFunc = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return args[args.length - 1]; + Ember.deprecateFunc = function (_, func) { + return func; }; } - exports["default"] = Ember; + exports.default = Ember; }); -enifed("ember-metal/dependent_keys", ["exports", "ember-metal/platform/create", "ember-metal/watching"], function (exports, _emberMetalPlatformCreate, _emberMetalWatching) { +enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { + exports.addDependentKeys = addDependentKeys; + exports.removeDependentKeys = removeDependentKeys; // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed // - - exports.addDependentKeys = addDependentKeys; - exports.removeDependentKeys = removeDependentKeys; - "REMOVE_USE_STRICT: true"; + 'REMOVE_USE_STRICT: true'; /** @module ember @submodule ember-metal */ @@ -15821,11 +14002,11 @@ // create a new empty list of dependencies for the key keys = depsMeta[depKey] = {}; } else if (!depsMeta.hasOwnProperty(depKey)) { // otherwise if the dependency list is inherited from // a superclass, clone the hash - keys = depsMeta[depKey] = _emberMetalPlatformCreate["default"](keys); + keys = depsMeta[depKey] = Object.create(keys); } return keys; } function metaForDeps(meta) { @@ -15874,18 +14055,11 @@ // Unwatch the depKey _emberMetalWatching.unwatch(obj, depKey, meta); } } }); -enifed("ember-metal/deprecate_property", ["exports", "ember-metal/core", "ember-metal/platform/define_property", "ember-metal/properties", "ember-metal/property_get", "ember-metal/property_set"], function (exports, _emberMetalCore, _emberMetalPlatformDefine_property, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set) { - /** - @module ember - @submodule ember-metal - */ - - "use strict"; - +enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set) { exports.deprecateProperty = deprecateProperty; /** Used internally to allow changing properties in a backwards compatible way, and print a helpful deprecation warning. @@ -15900,365 +14074,45 @@ function deprecateProperty(object, deprecatedKey, newKey) { function deprecate() { } - if (_emberMetalPlatformDefine_property.hasPropertyAccessors) { - _emberMetalProperties.defineProperty(object, deprecatedKey, { - configurable: true, - enumerable: false, - set: function (value) { - deprecate(); - _emberMetalProperty_set.set(this, newKey, value); - }, - get: function () { - deprecate(); - return _emberMetalProperty_get.get(this, newKey); - } - }); - } + Object.defineProperty(object, deprecatedKey, { + configurable: true, + enumerable: false, + set: function (value) { + deprecate(); + _emberMetalProperty_set.set(this, newKey, value); + }, + get: function () { + deprecate(); + return _emberMetalProperty_get.get(this, newKey); + } + }); } }); -enifed('ember-metal/dictionary', ['exports', 'ember-metal/platform/create'], function (exports, _emberMetalPlatformCreate) { - 'use strict'; +/** +@module ember +@submodule ember-metal +*/ +enifed('ember-metal/dictionary', ['exports'], function (exports) { + exports.default = makeDictionary; - exports["default"] = makeDictionary; - // the delete is meant to hint at runtimes that this object should remain in // dictionary mode. This is clearly a runtime specific hack, but currently it // appears worthwhile in some usecases. Please note, these deletes do increase // the cost of creation dramatically over a plain Object.create. And as this // only makes sense for long-lived dictionaries that aren't instantiated often. function makeDictionary(parent) { - var dict = _emberMetalPlatformCreate["default"](parent); + var dict = Object.create(parent); dict['_dict'] = null; delete dict['_dict']; return dict; } }); -enifed("ember-metal/empty_object", ["exports", "ember-metal/platform/create"], function (exports, _emberMetalPlatformCreate) { - "use strict"; - - // This exists because `Object.create(null)` is absurdly slow compared - // to `new EmptyObject()`. In either case, you want a null prototype - // when you're treating the object instances as arbitrary dictionaries - // and don't want your keys colliding with build-in methods on the - // default object prototype. - - var proto = _emberMetalPlatformCreate["default"](null, { - // without this, we will always still end up with (new - // EmptyObject()).constructor === Object - constructor: { - value: undefined, - enumerable: false, - writable: true - } - }); - - function EmptyObject() {} - EmptyObject.prototype = proto; - exports["default"] = EmptyObject; -}); -enifed('ember-metal/enumerable_utils', ['exports', 'ember-metal/core', 'ember-metal/array'], function (exports, _emberMetalCore, _emberMetalArray) { - 'use strict'; - - exports.map = map; - exports.forEach = forEach; - exports.filter = filter; - exports.indexOf = indexOf; - exports.indexesOf = indexesOf; - exports.addObject = addObject; - exports.removeObject = removeObject; - exports._replace = _replace; - exports.replace = replace; - exports.intersection = intersection; - - var splice = Array.prototype.splice; - - /** - Defines some convenience methods for working with Enumerables. - `Ember.EnumerableUtils` uses `Ember.ArrayPolyfills` when necessary. - - @class EnumerableUtils - @namespace Ember - @deprecated - @static - @public - */ - - /** - Calls the map function on the passed object with a specified callback. This - uses `Ember.ArrayPolyfill`'s-map method when necessary. - - @method map - @deprecated Use ES5's Array.prototype.map instead. - @param {Object} obj The object that should be mapped - @param {Function} callback The callback to execute - @param {Object} thisArg Value to use as this when executing *callback* - - @return {Array} An array of mapped values. - @public - */ - - function map(obj, callback, thisArg) { - return obj.map ? obj.map(callback, thisArg) : _emberMetalArray.map.call(obj, callback, thisArg); - } - - var deprecatedMap = _emberMetalCore["default"].deprecateFunc('Ember.EnumberableUtils.map is deprecated, please refactor to use Array.prototype.map.', map); - - /** - Calls the forEach function on the passed object with a specified callback. This - uses `Ember.ArrayPolyfill`'s-forEach method when necessary. - - @method forEach - @deprecated Use ES5's Array.prototype.forEach instead. - @param {Object} obj The object to call forEach on - @param {Function} callback The callback to execute - @param {Object} thisArg Value to use as this when executing *callback* - @public - */ - - function forEach(obj, callback, thisArg) { - return obj.forEach ? obj.forEach(callback, thisArg) : _emberMetalArray.forEach.call(obj, callback, thisArg); - } - - var deprecatedForEach = _emberMetalCore["default"].deprecateFunc('Ember.EnumberableUtils.forEach is deprecated, please refactor to use Array.prototype.forEach.', forEach); - - /** - Calls the filter function on the passed object with a specified callback. This - uses `Ember.ArrayPolyfill`'s-filter method when necessary. - - @method filter - @deprecated Use ES5's Array.prototype.filter instead. - @param {Object} obj The object to call filter on - @param {Function} callback The callback to execute - @param {Object} thisArg Value to use as this when executing *callback* - - @return {Array} An array containing the filtered values - @since 1.4.0 - @public - */ - - function filter(obj, callback, thisArg) { - return obj.filter ? obj.filter(callback, thisArg) : _emberMetalArray.filter.call(obj, callback, thisArg); - } - - var deprecatedFilter = _emberMetalCore["default"].deprecateFunc('Ember.EnumberableUtils.filter is deprecated, please refactor to use Array.prototype.filter.', filter); - - /** - Calls the indexOf function on the passed object with a specified callback. This - uses `Ember.ArrayPolyfill`'s-indexOf method when necessary. - - @method indexOf - @deprecated Use ES5's Array.prototype.indexOf instead. - @param {Object} obj The object to call indexOn on - @param {Object} index The index to start searching from - - @public - */ - - function indexOf(obj, element, index) { - return obj.indexOf ? obj.indexOf(element, index) : _emberMetalArray.indexOf.call(obj, element, index); - } - - var deprecatedIndexOf = _emberMetalCore["default"].deprecateFunc('Ember.EnumberableUtils.indexOf is deprecated, please refactor to use Array.prototype.indexOf.', indexOf); - - /** - Returns an array of indexes of the first occurrences of the passed elements - on the passed object. - - ```javascript - var array = [1, 2, 3, 4, 5]; - Ember.EnumerableUtils.indexesOf(array, [2, 5]); // [1, 4] - - var fubar = "Fubarr"; - Ember.EnumerableUtils.indexesOf(fubar, ['b', 'r']); // [2, 4] - ``` - - @method indexesOf - @deprecated - @param {Object} obj The object to check for element indexes - @param {Array} elements The elements to search for on *obj* - - @return {Array} An array of indexes. - @public - */ - - function indexesOf(obj, elements) { - return elements === undefined ? [] : map(elements, function (item) { - return indexOf(obj, item); - }); - } - - var deprecatedIndexesOf = _emberMetalCore["default"].deprecateFunc('Ember.EnumerableUtils.indexesOf is deprecated.', indexesOf); - - /** - Adds an object to an array. If the array already includes the object this - method has no effect. - - @method addObject - @deprecated - @param {Array} array The array the passed item should be added to - @param {Object} item The item to add to the passed array - - @return 'undefined' - @public - */ - - function addObject(array, item) { - var index = indexOf(array, item); - if (index === -1) { - array.push(item); - } - } - - var deprecatedAddObject = _emberMetalCore["default"].deprecateFunc('Ember.EnumerableUtils.addObject is deprecated.', addObject); - - /** - Removes an object from an array. If the array does not contain the passed - object this method has no effect. - - @method removeObject - @deprecated - @param {Array} array The array to remove the item from. - @param {Object} item The item to remove from the passed array. - - @return 'undefined' - @public - */ - - function removeObject(array, item) { - var index = indexOf(array, item); - if (index !== -1) { - array.splice(index, 1); - } - } - - var deprecatedRemoveObject = _emberMetalCore["default"].deprecateFunc('Ember.EnumerableUtils.removeObject is deprecated.', removeObject); - - function _replace(array, idx, amt, objects) { - var args = [].concat(objects); - var ret = []; - // https://code.google.com/p/chromium/issues/detail?id=56588 - var size = 60000; - var start = idx; - var ends = amt; - var count, chunk; - - while (args.length) { - count = ends > size ? size : ends; - if (count <= 0) { - count = 0; - } - - chunk = args.splice(0, size); - chunk = [start, count].concat(chunk); - - start += size; - ends -= count; - - ret = ret.concat(splice.apply(array, chunk)); - } - return ret; - } - - /** - Replaces objects in an array with the passed objects. - - ```javascript - var array = [1,2,3]; - Ember.EnumerableUtils.replace(array, 1, 2, [4, 5]); // [1, 4, 5] - - var array = [1,2,3]; - Ember.EnumerableUtils.replace(array, 1, 1, [4, 5]); // [1, 4, 5, 3] - - var array = [1,2,3]; - Ember.EnumerableUtils.replace(array, 10, 1, [4, 5]); // [1, 2, 3, 4, 5] - ``` - - @method replace - @deprecated - @param {Array} array The array the objects should be inserted into. - @param {Number} idx Starting index in the array to replace. If *idx* >= - length, then append to the end of the array. - @param {Number} amt Number of elements that should be removed from the array, - starting at *idx* - @param {Array} objects An array of zero or more objects that should be - inserted into the array at *idx* - - @return {Array} The modified array. - @public - */ - - function replace(array, idx, amt, objects) { - if (array.replace) { - return array.replace(idx, amt, objects); - } else { - return _replace(array, idx, amt, objects); - } - } - - var deprecatedReplace = _emberMetalCore["default"].deprecateFunc('Ember.EnumerableUtils.replace is deprecated.', replace); - - /** - Calculates the intersection of two arrays. This method returns a new array - filled with the records that the two passed arrays share with each other. - If there is no intersection, an empty array will be returned. - - ```javascript - var array1 = [1, 2, 3, 4, 5]; - var array2 = [1, 3, 5, 6, 7]; - - Ember.EnumerableUtils.intersection(array1, array2); // [1, 3, 5] - - var array1 = [1, 2, 3]; - var array2 = [4, 5, 6]; - - Ember.EnumerableUtils.intersection(array1, array2); // [] - ``` - - @method intersection - @deprecated - @param {Array} array1 The first array - @param {Array} array2 The second array - - @return {Array} The intersection of the two passed arrays. - @public - */ - - function intersection(array1, array2) { - var result = []; - forEach(array1, function (element) { - if (indexOf(array2, element) >= 0) { - result.push(element); - } - }); - - return result; - } - - var deprecatedIntersection = _emberMetalCore["default"].deprecateFunc('Ember.EnumerableUtils.intersection is deprecated.', intersection); - - // TODO: this only exists to maintain the existing api, as we move forward it - // should only be part of the "global build" via some shim - exports["default"] = { - _replace: _replace, - addObject: deprecatedAddObject, - filter: deprecatedFilter, - forEach: deprecatedForEach, - indexOf: deprecatedIndexOf, - indexesOf: deprecatedIndexesOf, - intersection: deprecatedIntersection, - map: deprecatedMap, - removeObject: deprecatedRemoveObject, - replace: deprecatedReplace - }; -}); -// Ember.deprecateFunc enifed('ember-metal/environment', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { - 'use strict'; /* Ember can run in many different environments, including environments like Node.js where the DOM is unavailable. This object serves as an abstraction over the browser features that Ember relies on, so that code does not @@ -16272,11 +14126,11 @@ // This code attempts to automatically detect an environment with DOM // by searching for window and document.createElement. An environment // with DOM may disable the DOM functionality of Ember explicitly by // defining a `disableBrowserEnvironment` ENV. - var hasDOM = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.createElement !== 'undefined' && !_emberMetalCore["default"].ENV.disableBrowserEnvironment; + var hasDOM = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.createElement !== 'undefined' && !_emberMetalCore.default.ENV.disableBrowserEnvironment; if (hasDOM) { environment = { hasDOM: true, isChrome: !!window.chrome && !window.opera, @@ -16291,19 +14145,19 @@ hasDOM: false, isChrome: false, isFirefox: false, location: null, history: null, - userAgent: "Lynx (textmode)", + userAgent: 'Lynx (textmode)', global: null }; } - exports["default"] = environment; + exports.default = environment; }); -enifed('ember-metal/error', ['exports', 'ember-metal/platform/create'], function (exports, _emberMetalPlatformCreate) { - 'use strict'; +enifed('ember-metal/error', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + exports.default = EmberError; var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; /** A subclass of the JavaScript Error object for use in Ember. @@ -16312,10 +14166,11 @@ @namespace Ember @extends Error @constructor @public */ + function EmberError() { var tmp = Error.apply(this, arguments); // Adds a `stack` property to the given error object that will yield the // stack trace at the time captureStackTrace was called. @@ -16323,43 +14178,35 @@ // to this function, including that call, will be left out of the // stack trace. // This is useful because we can hide Ember implementation details // that are not very helpful for the user. if (Error.captureStackTrace) { - Error.captureStackTrace(this, Ember.Error); + Error.captureStackTrace(this, _emberMetalCore.default.Error); } // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. for (var idx = 0; idx < errorProps.length; idx++) { this[errorProps[idx]] = tmp[errorProps[idx]]; } } - EmberError.prototype = _emberMetalPlatformCreate["default"](Error.prototype); - - exports["default"] = EmberError; + EmberError.prototype = Object.create(Error.prototype); }); -enifed("ember-metal/events", ["exports", "ember-metal/core", "ember-metal/utils", "ember-metal/platform/create"], function (exports, _emberMetalCore, _emberMetalUtils, _emberMetalPlatformCreate) { - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - // - +enifed('ember-metal/events', ['exports', 'ember-metal/core', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalUtils) { exports.accumulateListeners = accumulateListeners; exports.addListener = addListener; exports.suspendListener = suspendListener; exports.suspendListeners = suspendListeners; exports.watchedEvents = watchedEvents; exports.sendEvent = sendEvent; exports.hasListeners = hasListeners; exports.listenersFor = listenersFor; exports.on = on; - "REMOVE_USE_STRICT: true"; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + // + 'REMOVE_USE_STRICT: true'; - /** - @module ember - @submodule ember-metal - */ - /* listener flags */ var ONCE = 1; var SUSPENDED = 2; /* @@ -16398,15 +14245,15 @@ var meta = _emberMetalUtils.meta(obj, true); var actions; var listeners = meta.listeners; if (!listeners) { - listeners = meta.listeners = _emberMetalPlatformCreate["default"](null); + listeners = meta.listeners = Object.create(null); listeners.__source__ = obj; } else if (listeners.__source__ !== obj) { // setup inherited copy of the listeners object - listeners = meta.listeners = _emberMetalPlatformCreate["default"](listeners); + listeners = meta.listeners = Object.create(listeners); listeners.__source__ = obj; } actions = listeners[eventName]; @@ -16567,20 +14414,17 @@ if (actionIndex !== -1) { actions[actionIndex + 2] |= SUSPENDED; // mark the action as suspended } - function tryable() { + try { return callback.call(target); - } - function finalizer() { + } finally { if (actionIndex !== -1) { actions[actionIndex + 2] &= ~SUSPENDED; } } - - return _emberMetalUtils.tryFinally(tryable, finalizer); } /** Suspends multiple listeners during a callback. @@ -16601,36 +14445,31 @@ target = null; } var suspendedActions = []; var actionsList = []; - var eventName, actions, i, l; - for (i = 0, l = eventNames.length; i < l; i++) { - eventName = eventNames[i]; - actions = actionsFor(obj, eventName); + for (var i = 0, l = eventNames.length; i < l; i++) { + var eventName = eventNames[i]; + var actions = actionsFor(obj, eventName); var actionIndex = indexOf(actions, target, method); if (actionIndex !== -1) { actions[actionIndex + 2] |= SUSPENDED; suspendedActions.push(actionIndex); actionsList.push(actions); } } - function tryable() { + try { return callback.call(target); - } - - function finalizer() { + } finally { for (var i = 0, l = suspendedActions.length; i < l; i++) { var actionIndex = suspendedActions[i]; actionsList[i][actionIndex + 2] &= ~SUSPENDED; } } - - return _emberMetalUtils.tryFinally(tryable, finalizer); } /** Return a list of currently watched events @@ -16670,11 +14509,11 @@ @public */ function sendEvent(obj, eventName, params, actions) { // first give object a chance to handle it - if (obj !== _emberMetalCore["default"] && 'function' === typeof obj.sendEvent) { + if (obj !== _emberMetalCore.default && 'function' === typeof obj.sendEvent) { obj.sendEvent(eventName, params); } if (!actions) { var meta = obj['__ember_meta__']; @@ -16797,15 +14636,17 @@ return func; } exports.removeListener = removeListener; }); -enifed('ember-metal/expand_properties', ['exports', 'ember-metal/error', 'ember-metal/array'], function (exports, _emberMetalError, _emberMetalArray) { - 'use strict'; +/** +@module ember +@submodule ember-metal +*/ +enifed('ember-metal/expand_properties', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) { + exports.default = expandProperties; - exports["default"] = expandProperties; - /** @module ember @submodule ember-metal */ @@ -16829,61 +14670,109 @@ Ember.expandProperties('foo.{bar,baz}.@each', echo) //=> 'foo.bar.@each', 'foo.baz.@each' Ember.expandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs' Ember.expandProperties('{foo}.bar.{baz}') //=> 'foo.bar.baz' ``` - @method expandProperties - @for Ember + @method @private @param {String} pattern The property pattern to expand. @param {Function} callback The callback to invoke. It is invoked once per expansion, and is passed the expansion. */ function expandProperties(pattern, callback) { if (pattern.indexOf(' ') > -1) { - throw new _emberMetalError["default"]('Brace expanded properties cannot contain spaces, e.g. \'user.{firstName, lastName}\' should be \'user.{firstName,lastName}\''); + throw new _emberMetalError.default('Brace expanded properties cannot contain spaces, e.g. \'user.{firstName, lastName}\' should be \'user.{firstName,lastName}\''); } if ('string' === typeof pattern) { var parts = pattern.split(SPLIT_REGEX); var properties = [parts]; - _emberMetalArray.forEach.call(parts, function (part, index) { + parts.forEach(function (part, index) { if (part.indexOf(',') >= 0) { properties = duplicateAndReplace(properties, part.split(','), index); } }); - _emberMetalArray.forEach.call(properties, function (property) { + properties.forEach(function (property) { callback(property.join('')); }); } else { callback(pattern); } } function duplicateAndReplace(properties, currentParts, index) { var all = []; - _emberMetalArray.forEach.call(properties, function (property) { - _emberMetalArray.forEach.call(currentParts, function (part) { + properties.forEach(function (property) { + currentParts.forEach(function (part) { var current = property.slice(0); current[index] = part; all.push(current); }); }); return all; } }); -enifed("ember-metal/get_properties", ["exports", "ember-metal/property_get", "ember-metal/utils"], function (exports, _emberMetalProperty_get, _emberMetalUtils) { - "use strict"; +enifed('ember-metal/features', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + exports.default = isEnabled; - exports["default"] = getProperties; + /** + The hash of enabled Canary features. Add to this, any canary features + before creating your application. + + Alternatively (and recommended), you can also define `EmberENV.FEATURES` + if you need to enable features flagged at runtime. + + @class FEATURES + @namespace Ember + @static + @since 1.1.0 + @public + */ + var FEATURES = _emberMetalCore.default.ENV.FEATURES || {}; + exports.FEATURES = FEATURES; /** + Determine whether the specified `feature` is enabled. Used by Ember's + build tools to exclude experimental features from beta/stable builds. + + You can define the following configuration options: + + * `EmberENV.ENABLE_ALL_FEATURES` - force all features to be enabled. + * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly + enabled/disabled. + + @method isEnabled + @param {String} feature The feature to check + @return {Boolean} + @for Ember.FEATURES + @since 1.1.0 + @public + */ + + function isEnabled(feature) { + var featureValue = FEATURES[feature]; + + if (_emberMetalCore.default.ENV.ENABLE_ALL_FEATURES) { + return true; + } else if (featureValue === true || featureValue === false || featureValue === undefined) { + return featureValue; + } else if (_emberMetalCore.default.ENV.ENABLE_OPTIONAL_FEATURES) { + return true; + } else { + return false; + } + } +}); +enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { + exports.default = getProperties; + + /** To get multiple properties at once, call `Ember.getProperties` with an object followed by a list of strings or an array: ```javascript Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); @@ -16900,30 +14789,29 @@ @method getProperties @for Ember @param {Object} obj @param {String...|Array} list of keys to get @return {Object} - @public + @private */ function getProperties(obj) { var ret = {}; var propertyNames = arguments; var i = 1; - if (arguments.length === 2 && _emberMetalUtils.isArray(arguments[1])) { + if (arguments.length === 2 && Array.isArray(arguments[1])) { i = 0; propertyNames = arguments[1]; } for (var len = propertyNames.length; i < len; i++) { ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]); } return ret; } }); -enifed("ember-metal/injected_property", ["exports", "ember-metal/core", "ember-metal/computed", "ember-metal/alias", "ember-metal/properties", "ember-metal/platform/create"], function (exports, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties, _emberMetalPlatformCreate) { - "use strict"; +enifed('ember-metal/injected_property', ['exports', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) { /** Read-only property that returns the result of a container lookup. @class InjectedProperty @@ -16948,11 +14836,11 @@ return this.container.lookup(desc.type + ':' + (desc.name || keyName)); } - InjectedProperty.prototype = _emberMetalPlatformCreate["default"](_emberMetalProperties.Descriptor.prototype); + InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); var InjectedPropertyPrototype = InjectedProperty.prototype; var ComputedPropertyPrototype = _emberMetalComputed.ComputedProperty.prototype; var AliasedPropertyPrototype = _emberMetalAlias.AliasedProperty.prototype; @@ -16961,16 +14849,14 @@ InjectedPropertyPrototype.get = ComputedPropertyPrototype.get; InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly; InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; - exports["default"] = InjectedProperty; + exports.default = InjectedProperty; }); // Ember.assert -enifed("ember-metal/instrumentation", ["exports", "ember-metal/core", "ember-metal/utils"], function (exports, _emberMetalCore, _emberMetalUtils) { - "use strict"; - +enifed('ember-metal/instrumentation', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { exports.instrument = instrument; exports._instrumentStart = _instrumentStart; exports.subscribe = subscribe; exports.unsubscribe = unsubscribe; exports.reset = reset; @@ -17074,23 +14960,29 @@ } var payload = _payload || {}; var finalizer = _instrumentStart(name, function () { return payload; }); + if (finalizer) { - var tryable = function _instrumenTryable() { - return callback.call(binding); - }; - var catchable = function _instrumentCatchable(e) { - payload.exception = e; - }; - return _emberMetalUtils.tryCatchFinally(tryable, catchable, finalizer); + return withFinalizer(callback, finalizer, payload, binding); } else { return callback.call(binding); } } + function withFinalizer(callback, finalizer, payload, binding) { + try { + return callback.call(binding); + } catch (e) { + payload.exception = e; + return payload; + } finally { + return finalizer(); + } + } + // private for now function _instrumentStart(name, _payload) { var listeners = cache[name]; @@ -17102,14 +14994,14 @@ return; } var payload = _payload(); - var STRUCTURED_PROFILE = _emberMetalCore["default"].STRUCTURED_PROFILE; + var STRUCTURED_PROFILE = _emberMetalCore.default.STRUCTURED_PROFILE; var timeName; if (STRUCTURED_PROFILE) { - timeName = name + ": " + payload.object; + timeName = name + ': ' + payload.object; console.time(timeName); } var l = listeners.length; var beforeValues = new Array(l); @@ -17146,29 +15038,29 @@ @return {Subscriber} @private */ function subscribe(pattern, object) { - var paths = pattern.split("."); + var paths = pattern.split('.'); var path; var regex = []; for (var i = 0, l = paths.length; i < l; i++) { path = paths[i]; - if (path === "*") { - regex.push("[^\\.]*"); + if (path === '*') { + regex.push('[^\\.]*'); } else { regex.push(path); } } - regex = regex.join("\\."); - regex = regex + "(\\..*)?"; + regex = regex.join('\\.'); + regex = regex + '(\\..*)?'; var subscriber = { pattern: pattern, - regex: new RegExp("^" + regex + "$"), + regex: new RegExp('^' + regex + '$'), object: object }; subscribers.push(subscriber); cache = {}; @@ -17211,14 +15103,12 @@ subscribers.length = 0; cache = {}; } }); enifed('ember-metal/is_blank', ['exports', 'ember-metal/is_empty'], function (exports, _emberMetalIs_empty) { - 'use strict'; + exports.default = isBlank; - exports["default"] = isBlank; - /** A value is blank if it is empty or a whitespace string. ```javascript Ember.isBlank(); // true @@ -17241,15 +15131,14 @@ @since 1.5.0 @public */ function isBlank(obj) { - return _emberMetalIs_empty["default"](obj) || typeof obj === 'string' && obj.match(/\S/) === null; + return _emberMetalIs_empty.default(obj) || typeof obj === 'string' && obj.match(/\S/) === null; } }); enifed('ember-metal/is_empty', ['exports', 'ember-metal/property_get', 'ember-metal/is_none'], function (exports, _emberMetalProperty_get, _emberMetalIs_none) { - 'use strict'; /** Verifies that a value is `null` or an empty string, empty array, or empty function. @@ -17272,11 +15161,11 @@ @param {Object} obj Value to test @return {Boolean} @public */ function isEmpty(obj) { - var none = _emberMetalIs_none["default"](obj); + var none = _emberMetalIs_none.default(obj); if (none) { return none; } if (typeof obj.size === 'number') { @@ -17304,13 +15193,14 @@ } return false; } - exports["default"] = isEmpty; + exports.default = isEmpty; }); enifed("ember-metal/is_none", ["exports"], function (exports) { + exports.default = isNone; /** Returns true if the passed value is null or undefined. This avoids errors from JSLint complaining about use of ==, which can be technically confusing. @@ -17327,23 +15217,18 @@ @for Ember @param {Object} obj Value to test @return {Boolean} @public */ - "use strict"; function isNone(obj) { return obj === null || obj === undefined; } - - exports["default"] = isNone; }); enifed('ember-metal/is_present', ['exports', 'ember-metal/is_blank'], function (exports, _emberMetalIs_blank) { - 'use strict'; + exports.default = isPresent; - exports["default"] = isPresent; - /** A value is present if it not `isBlank`. ```javascript Ember.isPresent(); // false @@ -17367,16 +15252,14 @@ @since 1.8.0 @public */ function isPresent(obj) { - return !_emberMetalIs_blank["default"](obj); + return !_emberMetalIs_blank.default(obj); } }); -enifed('ember-metal/keys', ['exports', 'ember-metal/platform/define_property'], function (exports, _emberMetalPlatformDefine_property) { - 'use strict'; - +enifed('ember-metal/keys', ['exports'], function (exports) { /** Returns all of the keys defined on an object or hash. This is useful when inspecting objects for debugging. On browsers that support it, this uses the native `Object.keys` implementation. @@ -17386,11 +15269,11 @@ @return {Array} Array containing keys of obj @private */ var keys = Object.keys; - if (!keys || !_emberMetalPlatformDefine_property.canDefineNonEnumerableProperties) { + if (!keys) { // modified from // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys keys = (function () { var hasOwnProperty = Object.prototype.hasOwnProperty; var hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'); @@ -17421,14 +15304,13 @@ return result; }; })(); } - exports["default"] = keys; + exports.default = keys; }); -enifed("ember-metal/libraries", ["exports", "ember-metal/core", "ember-metal/enumerable_utils"], function (exports, _emberMetalCore, _emberMetalEnumerable_utils) { - "use strict"; +enifed('ember-metal/libraries', ['exports', 'ember-metal/core', 'ember-metal/features'], function (exports, _emberMetalCore, _emberMetalFeatures) { /** Helper class that allows you to register your library with Ember. Singleton created at `Ember.libraries`. @@ -17475,36 +15357,34 @@ deRegister: function (name) { var lib = this._getLibraryByName(name); var index; if (lib) { - index = _emberMetalEnumerable_utils.indexOf(this._registry, lib); + index = this._registry.indexOf(lib); this._registry.splice(index, 1); } }, each: function (callback) { - _emberMetalEnumerable_utils.forEach(this._registry, function (lib) { + this._registry.forEach(function (lib) { callback(lib.name, lib.version); }); } }; - - exports["default"] = Libraries; + exports.default = Libraries; }); -enifed("ember-metal/logger", ["exports", "ember-metal/core", "ember-metal/error"], function (exports, _emberMetalCore, _emberMetalError) { - "use strict"; +enifed('ember-metal/logger', ['exports', 'ember-metal/core', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalError) { function K() { return this; } function consoleMethod(name) { var consoleObj, logToConsole; - if (_emberMetalCore["default"].imports.console) { - consoleObj = _emberMetalCore["default"].imports.console; + if (_emberMetalCore.default.imports.console) { + consoleObj = _emberMetalCore.default.imports.console; } else if (typeof console !== 'undefined') { consoleObj = console; } var method = typeof consoleObj === 'object' ? consoleObj[name] : null; @@ -17532,11 +15412,11 @@ function assertPolyfill(test, message) { if (!test) { try { // attempt to preserve the stack - throw new _emberMetalError["default"]("assertion failed: " + message); + throw new _emberMetalError.default('assertion failed: ' + message); } catch (error) { setTimeout(function () { throw error; }, 0); } @@ -17547,13 +15427,13 @@ Inside Ember-Metal, simply uses the methods from `imports.console`. Override this to provide more robust logging functionality. @class Logger @namespace Ember - @public + @private */ - exports["default"] = { + exports.default = { /** Logs the arguments to the console. You can pass as many arguments as you want and they will be joined together with a space. ```javascript var foo = 1; @@ -17561,11 +15441,11 @@ // "log value of foo: 1" will be printed to the console ``` @method log @for Ember.Logger @param {*} arguments - @public + @private */ log: consoleMethod('log') || K, /** Prints the arguments to the console with a warning icon. @@ -17575,11 +15455,11 @@ // "Something happened!" will be printed to the console with a warning icon. ``` @method warn @for Ember.Logger @param {*} arguments - @public + @private */ warn: consoleMethod('warn') || K, /** Prints the arguments to the console with an error icon, red text and a stack trace. @@ -17589,11 +15469,11 @@ // "Danger! Danger!" will be printed to the console in red text. ``` @method error @for Ember.Logger @param {*} arguments - @public + @private */ error: consoleMethod('error') || K, /** Logs the arguments to the console. @@ -17604,11 +15484,11 @@ // "log value of foo: 1" will be printed to the console ``` @method info @for Ember.Logger @param {*} arguments - @public + @private */ info: consoleMethod('info') || K, /** Logs the arguments to the console in blue text. @@ -17619,11 +15499,11 @@ // "log value of foo: 1" will be printed to the console ``` @method debug @for Ember.Logger @param {*} arguments - @public + @private */ debug: consoleMethod('debug') || consoleMethod('info') || K, /** If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. @@ -17632,52 +15512,28 @@ Ember.Logger.assert(true === false); // Throws an Assertion failed error. ``` @method assert @for Ember.Logger @param {Boolean} bool Value to test - @public + @private */ assert: consoleMethod('assert') || assertPolyfill }; }); // Ember.imports -enifed("ember-metal/map", ["exports", "ember-metal/utils", "ember-metal/array", "ember-metal/platform/create", "ember-metal/deprecate_property"], function (exports, _emberMetalUtils, _emberMetalArray, _emberMetalPlatformCreate, _emberMetalDeprecate_property) { - /** - @module ember - @submodule ember-metal - */ +enifed('ember-metal/map', ['exports', 'ember-metal/core', 'ember-metal/utils', 'ember-metal/deprecate_property'], function (exports, _emberMetalCore, _emberMetalUtils, _emberMetalDeprecate_property) { - /* - JavaScript (before ES6) does not have a Map implementation. Objects, - which are often used as dictionaries, may only have Strings as keys. - - Because Ember has a way to get a unique identifier for every object - via `Ember.guidFor`, we can implement a performant Map with arbitrary - keys. Because it is commonly used in low-level bookkeeping, Map is - implemented as a pure JavaScript object for performance. - - This implementation follows the current iteration of the ES6 proposal for - maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets), - with one exception: as we do not have the luxury of in-VM iteration, we implement a - forEach method for iteration. - - Map is mocked out to look like an Ember object, so you can do - `Ember.Map.create()` for symmetry with other Ember classes. - */ - - "use strict"; - function missingFunction(fn) { - throw new TypeError(Object.prototype.toString.call(fn) + " is not a function"); + throw new TypeError(Object.prototype.toString.call(fn) + ' is not a function'); } function missingNew(name) { - throw new TypeError("Constructor " + name + " requires 'new'"); + throw new TypeError('Constructor ' + name + ' requires \'new\''); } function copyNull(obj) { - var output = _emberMetalPlatformCreate["default"](null); + var output = Object.create(null); for (var prop in obj) { // hasOwnPropery is not needed because obj is Object.create(null); output[prop] = obj[prop]; } @@ -17710,11 +15566,11 @@ if (this instanceof OrderedSet) { this.clear(); this._silenceRemoveDeprecation = false; } else { - missingNew("OrderedSet"); + missingNew('OrderedSet'); } } /** @method create @@ -17733,11 +15589,11 @@ /** @method clear @private */ clear: function () { - this.presenceSet = _emberMetalPlatformCreate["default"](null); + this.presenceSet = Object.create(null); this.list = []; this.size = 0; }, /** @@ -17768,29 +15624,29 @@ @return {Boolean} @private */ remove: function (obj, _guid) { - return this["delete"](obj, _guid); + return this.delete(obj, _guid); }, /** @since 1.8.0 @method delete @param obj @param _guid (optional and for internal use only) @return {Boolean} @private */ - "delete": function (obj, _guid) { + delete: function (obj, _guid) { var guid = _guid || _emberMetalUtils.guidFor(obj); var presenceSet = this.presenceSet; var list = this.list; if (presenceSet[guid] === true) { delete presenceSet[guid]; - var index = _emberMetalArray.indexOf.call(list, obj); + var index = list.indexOf(obj); if (index > -1) { list.splice(index, 1); } this.size = list.length; return true; @@ -17906,18 +15762,18 @@ */ function Map() { if (this instanceof this.constructor) { this._keys = OrderedSet.create(); this._keys._silenceRemoveDeprecation = true; - this._values = _emberMetalPlatformCreate["default"](null); + this._values = Object.create(null); this.size = 0; } else { - missingNew("OrderedSet"); + missingNew('OrderedSet'); } } - Ember.Map = Map; + _emberMetalCore.default.Map = Map; /** @method create @static @private @@ -17992,32 +15848,32 @@ @return {Boolean} true if an item was removed, false otherwise @private */ remove: function (key) { - return this["delete"](key); + return this.delete(key); }, /** Removes a value from the map for an associated key. @since 1.8.0 @method delete @param {*} key @return {Boolean} true if an item was removed, false otherwise @private */ - "delete": function (key) { + delete: function (key) { if (this.size === 0) { return false; } // don't use ES6 "delete" because it will be annoying // to use in browsers that are not ES6 friendly; var keys = this._keys; var values = this._values; var guid = _emberMetalUtils.guidFor(key); - if (keys["delete"](key, guid)) { + if (keys.delete(key, guid)) { delete values[guid]; this.size = keys.size; return true; } else { return false; @@ -18077,11 +15933,11 @@ @method clear @private */ clear: function () { this._keys.clear(); - this._values = _emberMetalPlatformCreate["default"](null); + this._values = Object.create(null); this.size = 0; }, /** @method copy @@ -18124,11 +15980,11 @@ } else { return new Map(); } }; - MapWithDefault.prototype = _emberMetalPlatformCreate["default"](Map.prototype); + MapWithDefault.prototype = Object.create(Map.prototype); MapWithDefault.prototype.constructor = MapWithDefault; MapWithDefault.prototype._super$constructor = Map; MapWithDefault.prototype._super$get = Map.prototype.get; /** @@ -18161,21 +16017,40 @@ return copyMap(this, new Constructor({ defaultValue: this.defaultValue })); }; - exports["default"] = Map; + exports.default = Map; exports.OrderedSet = OrderedSet; exports.Map = Map; exports.MapWithDefault = MapWithDefault; }); -enifed('ember-metal/merge', ['exports', 'ember-metal/keys'], function (exports, _emberMetalKeys) { - 'use strict'; +/** +@module ember +@submodule ember-metal +*/ - exports["default"] = merge; - exports.assign = assign; +/* + JavaScript (before ES6) does not have a Map implementation. Objects, + which are often used as dictionaries, may only have Strings as keys. + Because Ember has a way to get a unique identifier for every object + via `Ember.guidFor`, we can implement a performant Map with arbitrary + keys. Because it is commonly used in low-level bookkeeping, Map is + implemented as a pure JavaScript object for performance. + + This implementation follows the current iteration of the ES6 proposal for + maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets), + with one exception: as we do not have the luxury of in-VM iteration, we implement a + forEach method for iteration. + + Map is mocked out to look like an Ember object, so you can do + `Ember.Map.create()` for symmetry with other Ember classes. +*/ +enifed('ember-metal/merge', ['exports'], function (exports) { + exports.default = merge; + exports.assign = assign; /** Merge the contents of two objects together into the first object. ```javascript Ember.merge({first: 'Tom'}, {last: 'Dale'}); // {first: 'Tom', last: 'Dale'} @@ -18187,19 +16062,19 @@ @method merge @for Ember @param {Object} original The object to merge into @param {Object} updates The object to copy properties from @return {Object} - @public + @private */ function merge(original, updates) { if (!updates || typeof updates !== 'object') { return original; } - var props = _emberMetalKeys["default"](updates); + var props = Object.keys(updates); var prop; var length = props.length; for (var i = 0; i < length; i++) { prop = props[i]; @@ -18218,39 +16093,34 @@ var arg = args[i]; if (!arg) { continue; } - var updates = _emberMetalKeys["default"](arg); + var updates = Object.keys(arg); for (var _i = 0, _l = updates.length; _i < _l; _i++) { var prop = updates[_i]; original[prop] = arg[prop]; } } return original; } }); -enifed("ember-metal/mixin", ["exports", "ember-metal/core", "ember-metal/merge", "ember-metal/array", "ember-metal/platform/create", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/utils", "ember-metal/expand_properties", "ember-metal/properties", "ember-metal/computed", "ember-metal/binding", "ember-metal/observer", "ember-metal/events", "ember-metal/streams/utils"], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalArray, _emberMetalPlatformCreate, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents, _emberMetalStreamsUtils) { - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - // - +enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents, _emberMetalStreamsUtils) { exports.mixin = mixin; + exports.default = Mixin; exports.required = required; exports.aliasMethod = aliasMethod; exports.observer = observer; exports._immediateObserver = _immediateObserver; exports._beforeObserver = _beforeObserver; - "REMOVE_USE_STRICT: true"; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + // + 'REMOVE_USE_STRICT: true'; - /** - @module ember - @submodule ember-metal - */ - var REQUIRED; var a_slice = [].slice; function superFunction() { var func = this.__nextSuper; @@ -18288,11 +16158,11 @@ var m = _emberMetalUtils.meta(obj, true); var ret = m.mixins; if (!ret) { ret = m.mixins = {}; } else if (!m.hasOwnProperty('mixins')) { - ret = m.mixins = _emberMetalPlatformCreate["default"](ret); + ret = m.mixins = Object.create(ret); } return ret; } function isMethod(obj) { @@ -18351,11 +16221,11 @@ } // Since multiple mixins may inherit from the same parent, we need // to clone the computed property so that other mixins do not receive // the wrapped version. - property = _emberMetalPlatformCreate["default"](property); + property = Object.create(property); property._getter = _emberMetalUtils.wrap(property._getter, superProperty._getter); if (superProperty._setter) { if (property._setter) { property._setter = _emberMetalUtils.wrap(property._setter, superProperty._setter); } else { @@ -18429,11 +16299,11 @@ if (!baseValue) { return value; } - var newBase = _emberMetalMerge["default"]({}, baseValue); + var newBase = _emberMetalMerge.default({}, baseValue); var hasFunction = false; for (var prop in value) { if (!value.hasOwnProperty(prop)) { continue; @@ -18469,13 +16339,13 @@ } descs[key] = value; values[key] = undefined; } else { - if (concats && _emberMetalArray.indexOf.call(concats, key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { + if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { value = applyConcatenatedProperties(base, key, value, values); - } else if (mergings && _emberMetalArray.indexOf.call(mergings, key) >= 0) { + } else if (mergings && mergings.indexOf(key) >= 0) { value = applyMergedProperties(base, key, value, values); } else if (isMethod(value)) { value = giveMethodSuper(base, key, value, values, descs); } @@ -18521,11 +16391,11 @@ base.toString = props.toString; } } else if (currentMixin.mixins) { mergeMixins(currentMixin.mixins, m, descs, values, base, keys); if (currentMixin._without) { - _emberMetalArray.forEach.call(currentMixin._without, removeKeys); + currentMixin._without.forEach(removeKeys); } } } } @@ -18535,11 +16405,11 @@ if (IS_BINDING.test(key)) { var bindings = m.bindings; if (!bindings) { bindings = m.bindings = {}; } else if (!m.hasOwnProperty('bindings')) { - bindings = m.bindings = _emberMetalPlatformCreate["default"](m.bindings); + bindings = m.bindings = Object.create(m.bindings); } bindings[key] = value; } } @@ -18560,11 +16430,11 @@ _emberMetalObserver.addObserver(obj, key, null, didChange); stream.subscribe(onNotify); if (obj._streamBindingSubscriptions === undefined) { - obj._streamBindingSubscriptions = _emberMetalPlatformCreate["default"](null); + obj._streamBindingSubscriptions = Object.create(null); } obj._streamBindingSubscriptions[key] = onNotify; } @@ -18770,11 +16640,10 @@ @class Mixin @namespace Ember @public */ - exports["default"] = Mixin; function Mixin(args, properties) { this.properties = properties; var length = args && args.length; @@ -18806,21 +16675,21 @@ }; Mixin.finishPartial = finishPartial; // ES6TODO: this relies on a global state? - _emberMetalCore["default"].anyUnprocessedMixins = false; + _emberMetalCore.default.anyUnprocessedMixins = false; /** @method create @static @param arguments* @public */ Mixin.create = function () { // ES6TODO: this relies on a global state? - _emberMetalCore["default"].anyUnprocessedMixins = true; + _emberMetalCore.default.anyUnprocessedMixins = true; var M = this; for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } @@ -18942,12 +16811,12 @@ if (props.hasOwnProperty(key)) { ret[key] = true; } } } else if (mixin.mixins) { - _emberMetalArray.forEach.call(mixin.mixins, function (x) { - _keys(ret, x, seen); + mixin.mixins.forEach(function (x) { + return _keys(ret, x, seen); }); } } MixinPrototype.keys = function () { @@ -19070,30 +16939,29 @@ var func = args.slice(-1)[0]; var paths; var addWatchedProperty = function (path) { - paths.push(path); }; var _paths = args.slice(0, -1); - if (typeof func !== "function") { + if (typeof func !== 'function') { // revert to old, soft-deprecated argument ordering - + func = args[0]; _paths = args.slice(1); } paths = []; for (var i = 0; i < _paths.length; ++i) { - _emberMetalExpand_properties["default"](_paths[i], addWatchedProperty); + _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); } - if (typeof func !== "function") { - throw new _emberMetalCore["default"].Error("Ember.observer called without a function"); + if (typeof func !== 'function') { + throw new _emberMetalCore.default.Error('Ember.observer called without a function'); } func.__ember_observes__ = paths; return func; } @@ -19190,25 +17058,25 @@ paths.push(path); }; var _paths = args.slice(0, -1); - if (typeof func !== "function") { + if (typeof func !== 'function') { // revert to old, soft-deprecated argument ordering func = args[0]; _paths = args.slice(1); } paths = []; for (var i = 0; i < _paths.length; ++i) { - _emberMetalExpand_properties["default"](_paths[i], addWatchedProperty); + _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); } - if (typeof func !== "function") { - throw new _emberMetalCore["default"].Error("Ember.beforeObserver called without a function"); + if (typeof func !== 'function') { + throw new _emberMetalCore.default.Error('Ember.beforeObserver called without a function'); } func.__ember_observesBefore__ = paths; return func; } @@ -19216,14 +17084,17 @@ exports.IS_BINDING = IS_BINDING; exports.Mixin = Mixin; exports.required = required; exports.REQUIRED = REQUIRED; }); -// warn, assert, wrap, et; -enifed("ember-metal/observer", ["exports", "ember-metal/watching", "ember-metal/array", "ember-metal/events"], function (exports, _emberMetalWatching, _emberMetalArray, _emberMetalEvents) { - "use strict"; +/** +@module ember +@submodule ember-metal +*/ +// warn, assert, wrap, et; +enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) { exports.addObserver = addObserver; exports.observersFor = observersFor; exports.removeObserver = removeObserver; exports._addBeforeObserver = _addBeforeObserver; exports._suspendBeforeObserver = _suspendBeforeObserver; @@ -19316,16 +17187,16 @@ function _suspendObserver(obj, path, target, method, callback) { return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback); } function _suspendBeforeObservers(obj, paths, target, method, callback) { - var events = _emberMetalArray.map.call(paths, beforeEvent); + var events = paths.map(beforeEvent); return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); } function _suspendObservers(obj, paths, target, method, callback) { - var events = _emberMetalArray.map.call(paths, changeEvent); + var events = paths.map(changeEvent); return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); } function _beforeObserversFor(obj, path) { return _emberMetalEvents.listenersFor(obj, beforeEvent(path)); @@ -19347,12 +17218,11 @@ _emberMetalEvents.removeListener(obj, beforeEvent(path), target, method); return this; } }); -enifed("ember-metal/observer_set", ["exports", "ember-metal/utils", "ember-metal/events"], function (exports, _emberMetalUtils, _emberMetalEvents) { - "use strict"; +enifed('ember-metal/observer_set', ['exports', 'ember-metal/utils', 'ember-metal/events'], function (exports, _emberMetalUtils, _emberMetalEvents) { /* this.observerSet = { [senderGuid]: { // variable name: `keySet` [keyName]: listIndex @@ -19368,11 +17238,11 @@ ] }, ... ] */ - exports["default"] = ObserverSet; + exports.default = ObserverSet; function ObserverSet() { this.clear(); } @@ -19417,12 +17287,10 @@ this.observerSet = {}; this.observers = []; }; }); enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { - 'use strict'; - exports.isGlobal = isGlobal; exports.isGlobalPath = isGlobalPath; exports.hasThis = hasThis; exports.isPath = isPath; exports.getFirstKey = getFirstKey; @@ -19430,36 +17298,36 @@ var IS_GLOBAL = /^[A-Z$]/; var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; var HAS_THIS = 'this.'; - var isGlobalCache = new _emberMetalCache["default"](1000, function (key) { + var isGlobalCache = new _emberMetalCache.default(1000, function (key) { return IS_GLOBAL.test(key); }); - var isGlobalPathCache = new _emberMetalCache["default"](1000, function (key) { + var isGlobalPathCache = new _emberMetalCache.default(1000, function (key) { return IS_GLOBAL_PATH.test(key); }); - var hasThisCache = new _emberMetalCache["default"](1000, function (key) { + var hasThisCache = new _emberMetalCache.default(1000, function (key) { return key.lastIndexOf(HAS_THIS, 0) === 0; }); - var firstDotIndexCache = new _emberMetalCache["default"](1000, function (key) { + var firstDotIndexCache = new _emberMetalCache.default(1000, function (key) { return key.indexOf('.'); }); - var firstKeyCache = new _emberMetalCache["default"](1000, function (path) { + var firstKeyCache = new _emberMetalCache.default(1000, function (path) { var index = firstDotIndexCache.get(path); if (index === -1) { return path; } else { return path.slice(0, index); } }); - var tailPathCache = new _emberMetalCache["default"](1000, function (path) { + var tailPathCache = new _emberMetalCache.default(1000, function (path) { var index = firstDotIndexCache.get(path); if (index !== -1) { return path.slice(index + 1); } }); @@ -19497,287 +17365,11 @@ function getTailPath(path) { return tailPathCache.get(path); } }); -enifed('ember-metal/platform/create', ['exports', 'ember-metal/platform/define_properties'], function (exports, _emberMetalPlatformDefine_properties) { - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - // - - "REMOVE_USE_STRICT: true"; - - /** - @class platform - @namespace Ember - @static - @private - */ - - /** - Identical to `Object.create()`. Implements if not available natively. - - @since 1.8.0 - @method create - @for Ember - @public - */ - var create; - // ES5 15.2.3.5 - // http://es5.github.com/#x15.2.3.5 - if (!(Object.create && !Object.create(null).hasOwnProperty)) { - /* jshint scripturl:true, proto:true */ - // Contributed by Brandon Benvie, October, 2012 - var createEmpty; - var supportsProto = !({ '__proto__': null } instanceof Object); - // the following produces false positives - // in Opera Mini => not a reliable check - // Object.prototype.__proto__ === null - if (supportsProto || typeof document === 'undefined') { - createEmpty = function () { - return { "__proto__": null }; - }; - } else { - // In old IE __proto__ can't be used to manually set `null`, nor does - // any other method exist to make an object that inherits from nothing, - // aside from Object.prototype itself. Instead, create a new global - // object and *steal* its Object.prototype and strip it bare. This is - // used as the prototype to create nullary objects. - createEmpty = function () { - var iframe = document.createElement('iframe'); - var parent = document.body || document.documentElement; - iframe.style.display = 'none'; - parent.appendChild(iframe); - iframe.src = 'javascript:'; - var empty = iframe.contentWindow.Object.prototype; - parent.removeChild(iframe); - iframe = null; - delete empty.constructor; - delete empty.hasOwnProperty; - delete empty.propertyIsEnumerable; - delete empty.isPrototypeOf; - delete empty.toLocaleString; - delete empty.toString; - delete empty.valueOf; - - function Empty() {} - Empty.prototype = empty; - // short-circuit future calls - createEmpty = function () { - return new Empty(); - }; - return new Empty(); - }; - } - - create = Object.create = function create(prototype, properties) { - - var object; - function Type() {} // An empty constructor. - - if (prototype === null) { - object = createEmpty(); - } else { - if (typeof prototype !== "object" && typeof prototype !== "function") { - // In the native implementation `parent` can be `null` - // OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc) - // Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object` - // like they are in modern browsers. Using `Object.create` on DOM elements - // is...err...probably inappropriate, but the native version allows for it. - throw new TypeError("Object prototype may only be an Object or null"); // same msg as Chrome - } - - Type.prototype = prototype; - - object = new Type(); - } - - if (properties !== undefined) { - _emberMetalPlatformDefine_properties["default"](object, properties); - } - - return object; - }; - } else { - create = Object.create; - } - - exports["default"] = create; -}); -enifed("ember-metal/platform/define_properties", ["exports", "ember-metal/platform/define_property"], function (exports, _emberMetalPlatformDefine_property) { - "use strict"; - - var defineProperties = Object.defineProperties; - - // ES5 15.2.3.7 - // http://es5.github.com/#x15.2.3.7 - if (!defineProperties) { - defineProperties = function defineProperties(object, properties) { - for (var property in properties) { - if (properties.hasOwnProperty(property) && property !== "__proto__") { - _emberMetalPlatformDefine_property.defineProperty(object, property, properties[property]); - } - } - return object; - }; - - Object.defineProperties = defineProperties; - } - - exports["default"] = defineProperties; -}); -enifed('ember-metal/platform/define_property', ['exports'], function (exports) { - /*globals Node */ - - /** - @class platform - @namespace Ember - @static - @private - */ - - /** - Set to true if the platform supports native getters and setters. - - @property hasPropertyAccessors - @final - @private - */ - - /** - Identical to `Object.defineProperty()`. Implements as much functionality - as possible if not available natively. - - @method defineProperty - @param {Object} obj The object to modify - @param {String} keyName property name to modify - @param {Object} desc descriptor hash - @return {void} - @public - */ - 'use strict'; - - var defineProperty = (function checkCompliance(defineProperty) { - if (!defineProperty) { - return; - } - - try { - var a = 5; - var obj = {}; - defineProperty(obj, 'a', { - configurable: true, - enumerable: true, - get: function () { - return a; - }, - set: function (v) { - a = v; - } - }); - if (obj.a !== 5) { - return; - } - - obj.a = 10; - if (a !== 10) { - return; - } - - // check non-enumerability - defineProperty(obj, 'a', { - configurable: true, - enumerable: false, - writable: true, - value: true - }); - for (var key in obj) { - if (key === 'a') { - return; - } - } - - // Detects a bug in Android <3.2 where you cannot redefine a property using - // Object.defineProperty once accessors have already been set. - if (obj.a !== true) { - return; - } - - // Detects a bug in Android <3 where redefining a property without a value changes the value - // Object.defineProperty once accessors have already been set. - defineProperty(obj, 'a', { - enumerable: false - }); - if (obj.a !== true) { - return; - } - - // defineProperty is compliant - return defineProperty; - } catch (e) { - // IE8 defines Object.defineProperty but calling it on an Object throws - return; - } - })(Object.defineProperty); - - var hasES5CompliantDefineProperty = !!defineProperty; - - if (hasES5CompliantDefineProperty && typeof document !== 'undefined') { - // This is for Safari 5.0, which supports Object.defineProperty, but not - // on DOM nodes. - var canDefinePropertyOnDOM = (function () { - try { - defineProperty(document.createElement('div'), 'definePropertyOnDOM', {}); - return true; - } catch (e) {} - - return false; - })(); - - if (!canDefinePropertyOnDOM) { - exports.defineProperty = defineProperty = function (obj, keyName, desc) { - var isNode; - - if (typeof Node === "object") { - isNode = obj instanceof Node; - } else { - isNode = typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string"; - } - - if (isNode) { - // TODO: Should we have a warning here? - return obj[keyName] = desc.value; - } else { - return Object.defineProperty(obj, keyName, desc); - } - }; - } - } - - if (!hasES5CompliantDefineProperty) { - exports.defineProperty = defineProperty = function definePropertyPolyfill(obj, keyName, desc) { - if (!desc.get) { - obj[keyName] = desc.value; - } - }; - } - - var hasPropertyAccessors = hasES5CompliantDefineProperty; - var canDefineNonEnumerableProperties = hasES5CompliantDefineProperty; - - exports.hasES5CompliantDefineProperty = hasES5CompliantDefineProperty; - exports.defineProperty = defineProperty; - exports.hasPropertyAccessors = hasPropertyAccessors; - exports.canDefineNonEnumerableProperties = canDefineNonEnumerableProperties; -}); -enifed("ember-metal/properties", ["exports", "ember-metal/core", "ember-metal/utils", "ember-metal/platform/define_property", "ember-metal/property_events"], function (exports, _emberMetalCore, _emberMetalUtils, _emberMetalPlatformDefine_property, _emberMetalProperty_events) { - /** - @module ember-metal - */ - - "use strict"; - +enifed('ember-metal/properties', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/utils', 'ember-metal/property_events'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalUtils, _emberMetalProperty_events) { exports.Descriptor = Descriptor; exports.MANDATORY_SETTER_FUNCTION = MANDATORY_SETTER_FUNCTION; exports.DEFAULT_GETTER_FUNCTION = DEFAULT_GETTER_FUNCTION; exports.defineProperty = defineProperty; @@ -19876,28 +17468,25 @@ } if (desc instanceof Descriptor) { value = desc; - - obj[keyName] = value; - + obj[keyName] = value; + if (desc.setup) { desc.setup(obj, keyName); } } else { if (desc == null) { value = data; - - obj[keyName] = data; - + obj[keyName] = data; } else { value = desc; - // compatibility with ES5 - _emberMetalPlatformDefine_property.defineProperty(obj, keyName, desc); + // fallback to ES5 + Object.defineProperty(obj, keyName, desc); } } // if key is being watched, override chains that // were initialized with the prototype @@ -19912,18 +17501,19 @@ } return this; } }); -enifed("ember-metal/property_events", ["exports", "ember-metal/utils", "ember-metal/events", "ember-metal/observer_set"], function (exports, _emberMetalUtils, _emberMetalEvents, _emberMetalObserver_set) { - "use strict"; +/** +@module ember-metal +*/ +enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-metal/events', 'ember-metal/observer_set'], function (exports, _emberMetalUtils, _emberMetalEvents, _emberMetalObserver_set) { + var PROPERTY_DID_CHANGE = _emberMetalUtils.symbol('PROPERTY_DID_CHANGE'); - var PROPERTY_DID_CHANGE = _emberMetalUtils.symbol("PROPERTY_DID_CHANGE"); - exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; - var beforeObserverSet = new _emberMetalObserver_set["default"](); - var observerSet = new _emberMetalObserver_set["default"](); + var beforeObserverSet = new _emberMetalObserver_set.default(); + var observerSet = new _emberMetalObserver_set.default(); var deferred = 0; // .......................................................... // PROPERTY CHANGES // @@ -20185,11 +17775,15 @@ @param [binding] @private */ function changeProperties(callback, binding) { beginPropertyChanges(); - _emberMetalUtils.tryFinally(callback, endPropertyChanges, binding); + try { + callback.call(binding); + } finally { + endPropertyChanges.call(binding); + } } function notifyBeforeObservers(obj, keyName) { if (obj.isDestroying) { return; @@ -20226,24 +17820,23 @@ exports.overrideChains = overrideChains; exports.beginPropertyChanges = beginPropertyChanges; exports.endPropertyChanges = endPropertyChanges; exports.changeProperties = changeProperties; }); -enifed("ember-metal/property_get", ["exports", "ember-metal/core", "ember-metal/error", "ember-metal/path_cache", "ember-metal/platform/define_property", "ember-metal/is_none"], function (exports, _emberMetalCore, _emberMetalError, _emberMetalPath_cache, _emberMetalPlatformDefine_property, _emberMetalIs_none) { - /** - @module ember-metal - */ - - "use strict"; - +enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/utils', 'ember-metal/is_none'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalPath_cache, _emberMetalUtils, _emberMetalIs_none) { exports.get = get; exports.normalizeTuple = normalizeTuple; exports._getPath = _getPath; exports.getWithDefault = getWithDefault; var FIRST_KEY = /^([^\.]+)/; + var INTERCEPT_GET = _emberMetalUtils.symbol('INTERCEPT_GET'); + exports.INTERCEPT_GET = INTERCEPT_GET; + var UNHANDLED_GET = _emberMetalUtils.symbol('UNHANDLED_GET'); + + exports.UNHANDLED_GET = UNHANDLED_GET; // .......................................................... // GET AND SET // // If we are on a platform that supports accessors we can use those. // Otherwise simulate accessors by looking up the property directly on the @@ -20274,25 +17867,32 @@ @return {Object} the property value or `null`. @public */ function get(obj, keyName) { - // Helpers that operate with 'this' within an #each + // Helpers that operate with 'this' within an #each if (keyName === '') { return obj; } if (!keyName && 'string' === typeof obj) { - keyName = obj; - obj = _emberMetalCore["default"].lookup; + keyName = obj; + obj = _emberMetalCore.default.lookup; } - if (_emberMetalIs_none["default"](obj)) { - return _getPath(obj, keyName); + if (_emberMetalIs_none.default(obj)) { + return _getPath(obj, keyName); } + if (obj && typeof obj[INTERCEPT_GET] === 'function') { + var result = obj[INTERCEPT_GET](obj, keyName); + if (result !== UNHANDLED_GET) { + return result; + } + } + var meta = obj['__ember_meta__']; var possibleDesc = obj[keyName]; var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; var ret; @@ -20301,13 +17901,11 @@ } if (desc) { return desc.get(obj, keyName); } else { - - ret = obj[keyName]; - + ret = obj[keyName]; if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) { return obj.unknownProperty(keyName); } @@ -20341,11 +17939,11 @@ if (hasThis) { path = path.slice(5); } if (!target || isGlobal) { - target = _emberMetalCore["default"].lookup; + target = _emberMetalCore.default.lookup; } if (isGlobal && _emberMetalPath_cache.isPath(path)) { key = path.match(FIRST_KEY)[0]; target = get(target, key); @@ -20358,32 +17956,31 @@ return [target, path]; } function validateIsPath(path) { if (!path || path.length === 0) { - throw new _emberMetalError["default"]("Object in path " + path + " could not be found or was destroyed."); + throw new _emberMetalError.default('Object in path ' + path + ' could not be found or was destroyed.'); } } function _getPath(root, path) { var hasThis, parts, tuple, idx, len; // detect complicated paths and normalize them hasThis = _emberMetalPath_cache.hasThis(path); - if (!root || hasThis) { tuple = normalizeTuple(root, path); root = tuple[0]; path = tuple[1]; tuple.length = 0; } - parts = path.split("."); + parts = path.split('.'); len = parts.length; for (idx = 0; root != null && idx < len; idx++) { - root = get(root, parts[idx]); + root = get(root, parts[idx], true); if (root && root.isDestroyed) { return undefined; } } return root; @@ -20396,18 +17993,23 @@ return defaultValue; } return value; } - exports["default"] = get; + exports.default = get; }); -enifed("ember-metal/property_set", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_events", "ember-metal/properties", "ember-metal/error", "ember-metal/path_cache", "ember-metal/platform/define_property"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache, _emberMetalPlatformDefine_property) { - "use strict"; - +/** +@module ember-metal +*/ +enifed('ember-metal/property_set', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache, _emberMetalUtils) { exports.set = set; exports.trySet = trySet; + var INTERCEPT_SET = _emberMetalUtils.symbol('INTERCEPT_SET'); + exports.INTERCEPT_SET = INTERCEPT_SET; + var UNHANDLED_SET = _emberMetalUtils.symbol('UNHANDLED_SET'); + exports.UNHANDLED_SET = UNHANDLED_SET; /** Sets the value of a property on an object, respecting computed properties and notifying observers and other listeners of the change. If the property is not defined but the object implements the `setUnknownProperty` method then that will be invoked as well. @@ -20421,30 +18023,40 @@ @public */ function set(obj, keyName, value, tolerant) { if (typeof obj === 'string') { - value = keyName; + value = keyName; keyName = obj; - obj = _emberMetalCore["default"].lookup; + obj = _emberMetalCore.default.lookup; } - - if (obj === _emberMetalCore["default"].lookup) { + + if (obj === _emberMetalCore.default.lookup) { return setPath(obj, keyName, value, tolerant); } + // This path exists purely to implement backwards-compatible + // effects (specifically, setting a property on a view may + // invoke a mutator on `attrs`). + if (obj && typeof obj[INTERCEPT_SET] === 'function') { + var result = obj[INTERCEPT_SET](obj, keyName, value, tolerant); + if (result !== UNHANDLED_SET) { + return result; + } + } + var meta, possibleDesc, desc; if (obj) { meta = obj['__ember_meta__']; possibleDesc = obj[keyName]; desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; } var isUnknown, currentValue; if ((!obj || desc === undefined) && _emberMetalPath_cache.isPath(keyName)) { - return setPath(obj, keyName, value, tolerant); + return setPath(obj, keyName, value, tolerant); } if (desc) { desc.set(obj, keyName, value); @@ -20461,20 +18073,18 @@ // `setUnknownProperty` method exists on the object if (isUnknown && 'function' === typeof obj.setUnknownProperty) { obj.setUnknownProperty(keyName, value); } else if (meta && meta.watching[keyName] > 0) { if (meta.proto !== obj) { - - currentValue = obj[keyName]; - + currentValue = obj[keyName]; } // only trigger a change if the value has changed if (value !== currentValue) { _emberMetalProperty_events.propertyWillChange(obj, keyName); - - obj[keyName] = value; - + + obj[keyName] = value; + _emberMetalProperty_events.propertyDidChange(obj, keyName); } } else { obj[keyName] = value; if (obj[_emberMetalProperty_events.PROPERTY_DID_CHANGE]) { @@ -20496,22 +18106,21 @@ // unless the path is this, look up the first part to // get the root if (path !== 'this') { root = _emberMetalProperty_get._getPath(root, path); - } else { - } + } if (!keyName || keyName.length === 0) { - throw new _emberMetalError["default"]('Property set failed: You passed an empty path'); + throw new _emberMetalError.default('Property set failed: You passed an empty path'); } if (!root) { if (tolerant) { return; } else { - throw new _emberMetalError["default"]('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); + throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); } } return set(root, keyName, value); } @@ -20533,32 +18142,100 @@ function trySet(root, path, value) { return set(root, path, value, true); } }); -enifed('ember-metal/run_loop', ['exports', 'ember-metal/core', 'ember-metal/utils', 'ember-metal/array', 'ember-metal/property_events', 'backburner'], function (exports, _emberMetalCore, _emberMetalUtils, _emberMetalArray, _emberMetalProperty_events, _backburner) { - 'use strict'; +// setup mandatory setter +enifed("ember-metal/replace", ["exports"], function (exports) { + exports._replace = _replace; + exports.default = replace; + var splice = Array.prototype.splice; + function _replace(array, idx, amt, objects) { + var args = [].concat(objects); + var ret = []; + // https://code.google.com/p/chromium/issues/detail?id=56588 + var size = 60000; + var start = idx; + var ends = amt; + var count, chunk; + + while (args.length) { + count = ends > size ? size : ends; + if (count <= 0) { + count = 0; + } + + chunk = args.splice(0, size); + chunk = [start, count].concat(chunk); + + start += size; + ends -= count; + + ret = ret.concat(splice.apply(array, chunk)); + } + return ret; + } + + /** + Replaces objects in an array with the passed objects. + + ```javascript + var array = [1,2,3]; + Ember.EnumerableUtils.replace(array, 1, 2, [4, 5]); // [1, 4, 5] + + var array = [1,2,3]; + Ember.EnumerableUtils.replace(array, 1, 1, [4, 5]); // [1, 4, 5, 3] + + var array = [1,2,3]; + Ember.EnumerableUtils.replace(array, 10, 1, [4, 5]); // [1, 2, 3, 4, 5] + ``` + + @method replace + @deprecated + @param {Array} array The array the objects should be inserted into. + @param {Number} idx Starting index in the array to replace. If *idx* >= + length, then append to the end of the array. + @param {Number} amt Number of elements that should be removed from the array, + starting at *idx* + @param {Array} objects An array of zero or more objects that should be + inserted into the array at *idx* + + @return {Array} The modified array. + @public + */ + + function replace(array, idx, amt, objects) { + if (array.replace) { + return array.replace(idx, amt, objects); + } else { + return _replace(array, idx, amt, objects); + } + } +}); +enifed('ember-metal/run_loop', ['exports', 'ember-metal/core', 'ember-metal/utils', 'ember-metal/property_events', 'backburner'], function (exports, _emberMetalCore, _emberMetalUtils, _emberMetalProperty_events, _backburner) { + exports.default = run; + function onBegin(current) { run.currentRunLoop = current; } function onEnd(current, next) { run.currentRunLoop = next; } // ES6TODO: should Backburner become es6? - var backburner = new _backburner["default"](['sync', 'actions', 'destroy'], { + var backburner = new _backburner.default(['sync', 'actions', 'destroy'], { GUID_KEY: _emberMetalUtils.GUID_KEY, sync: { before: _emberMetalProperty_events.beginPropertyChanges, after: _emberMetalProperty_events.endPropertyChanges }, defaultQueue: 'actions', onBegin: onBegin, onEnd: onEnd, - onErrorTarget: _emberMetalCore["default"], + onErrorTarget: _emberMetalCore.default, onErrorMethod: 'onerror' }); // .......................................................... // run - this is ideally the only public API the dev sees @@ -20590,11 +18267,10 @@ then it will be looked up on the passed target. @param {Object} [args*] Any additional arguments you wish to pass to the method. @return {Object} return value from invoking the passed function. @public */ - exports["default"] = run; function run() { return backburner.run.apply(backburner, arguments); } @@ -20794,11 +18470,11 @@ invoked allowing you to change the target function. @param {Object} [arguments*] Optional arguments to be passed to the queued method. @return {void} @public */ - run.schedule = function () /* queue, target, method */{ + run.schedule = function () { checkAutoRun(); backburner.schedule.apply(backburner, arguments); }; // Used by global test teardown @@ -20858,11 +18534,11 @@ @param {Object} [args*] Optional arguments to pass to the timeout. @param {Number} wait Number of milliseconds to wait. @return {*} Timer information for use in cancelling, see `run.cancel`. @public */ - run.later = function () /*target, method*/{ + run.later = function () { return backburner.later.apply(backburner, arguments); }; /** Schedule a function to run one time during the current RunLoop. This is equivalent @@ -20938,11 +18614,11 @@ target at the time the method is invoked. @param {Object} [args*] Optional arguments to pass to the timeout. @return {Object} Timer information for use in cancelling, see `run.cancel`. @public */ - run.scheduleOnce = function () /*queue, target, method*/{ + run.scheduleOnce = function () { checkAutoRun(); return backburner.scheduleOnce.apply(backburner, arguments); }; /** @@ -21197,20 +18873,19 @@ @param {String} name the name of the queue to add. @param {String} after the name of the queue to add after. @private */ run._addQueue = function (name, after) { - if (_emberMetalArray.indexOf.call(run.queues, name) === -1) { - run.queues.splice(_emberMetalArray.indexOf.call(run.queues, after) + 1, 0, name); + if (run.queues.indexOf(name) === -1) { + run.queues.splice(run.queues.indexOf(after) + 1, 0, name); } }; }); -enifed("ember-metal/set_properties", ["exports", "ember-metal/property_events", "ember-metal/property_set", "ember-metal/keys"], function (exports, _emberMetalProperty_events, _emberMetalProperty_set, _emberMetalKeys) { - "use strict"; +/* queue, target, method */ /*target, method*/ /*queue, target, method*/ +enifed('ember-metal/set_properties', ['exports', 'ember-metal/property_events', 'ember-metal/property_set'], function (exports, _emberMetalProperty_events, _emberMetalProperty_set) { + exports.default = setProperties; - exports["default"] = setProperties; - /** Set a list of properties on an object. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so observers will be buffered. @@ -21225,36 +18900,34 @@ ``` @method setProperties @param obj @param {Object} properties - @return obj + @return properties @public */ function setProperties(obj, properties) { - if (!properties || typeof properties !== "object") { - return obj; + if (!properties || typeof properties !== 'object') { + return properties; } _emberMetalProperty_events.changeProperties(function () { - var props = _emberMetalKeys["default"](properties); + var props = Object.keys(properties); var propertyName; for (var i = 0, l = props.length; i < l; i++) { propertyName = props[i]; _emberMetalProperty_set.set(obj, propertyName, properties[propertyName]); } }); - return obj; + return properties; } }); -enifed("ember-metal/streams/conditional", ["exports", "ember-metal/streams/stream", "ember-metal/streams/utils", "ember-metal/platform/create"], function (exports, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberMetalPlatformCreate) { - "use strict"; +enifed('ember-metal/streams/conditional', ['exports', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalStreamsStream, _emberMetalStreamsUtils) { + exports.default = conditional; - exports["default"] = conditional; - function conditional(test, consequent, alternate) { if (_emberMetalStreamsUtils.isStream(test)) { return new ConditionalStream(test, consequent, alternate); } else { if (test) { @@ -21272,11 +18945,11 @@ this.test = test; this.consequent = consequent; this.alternate = alternate; } - ConditionalStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsStream["default"].prototype); + ConditionalStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); ConditionalStream.prototype.compute = function () { var oldTestResult = this.oldTestResult; var newTestResult = !!_emberMetalStreamsUtils.read(this.test); @@ -21301,12 +18974,11 @@ } return newTestResult ? _emberMetalStreamsUtils.read(this.consequent) : _emberMetalStreamsUtils.read(this.alternate); }; }); -enifed("ember-metal/streams/dependency", ["exports", "ember-metal/core", "ember-metal/merge", "ember-metal/streams/utils"], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalStreamsUtils) { - "use strict"; +enifed('ember-metal/streams/dependency', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalStreamsUtils) { /** @module ember-metal */ @@ -21323,11 +18995,11 @@ this.depender = depender; this.dependee = dependee; this.unsubscription = null; } - _emberMetalMerge["default"](Dependency.prototype, { + _emberMetalMerge.default(Dependency.prototype, { subscribe: function () { this.unsubscription = _emberMetalStreamsUtils.subscribe(this.dependee, this.depender.notify, this.depender); }, @@ -21375,14 +19047,13 @@ // this.unsubscribe(); // } }); - exports["default"] = Dependency; + exports.default = Dependency; }); -enifed('ember-metal/streams/key-stream', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/platform/create', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/observer', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalPlatformCreate, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalObserver, _emberMetalStreamsStream, _emberMetalStreamsUtils) { - 'use strict'; +enifed('ember-metal/streams/key-stream', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/observer', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalObserver, _emberMetalStreamsStream, _emberMetalStreamsUtils) { function KeyStream(source, key) { // TODO: This isn't necessary. // used to get the original path for debugging and legacy purposes @@ -21397,13 +19068,13 @@ function labelFor(source, key) { return source.label ? source.label + '.' + key : key; } - KeyStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsStream["default"].prototype); + KeyStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); - _emberMetalMerge["default"](KeyStream.prototype, { + _emberMetalMerge.default(KeyStream.prototype, { compute: function () { var object = this.sourceDep.getValue(); if (object) { return _emberMetalProperty_get.get(object, this.key); } @@ -21419,11 +19090,11 @@ setSource: function (source) { this.sourceDep.replace(source); this.notify(); }, - _super$revalidate: _emberMetalStreamsStream["default"].prototype.revalidate, + _super$revalidate: _emberMetalStreamsStream.default.prototype.revalidate, revalidate: function (value) { this._super$revalidate(value); var object = this.sourceDep.getValue(); @@ -21435,11 +19106,11 @@ this.observedObject = object; } } }, - _super$deactivate: _emberMetalStreamsStream["default"].prototype.deactivate, + _super$deactivate: _emberMetalStreamsStream.default.prototype.deactivate, _clearObservedObject: function () { if (this.observedObject) { _emberMetalObserver.removeObserver(this.observedObject, this.key, this, this.notify); this.observedObject = null; @@ -21450,23 +19121,22 @@ this._super$deactivate(); this._clearObservedObject(); } }); - exports["default"] = KeyStream; + exports.default = KeyStream; }); -enifed("ember-metal/streams/proxy-stream", ["exports", "ember-metal/merge", "ember-metal/streams/stream", "ember-metal/platform/create"], function (exports, _emberMetalMerge, _emberMetalStreamsStream, _emberMetalPlatformCreate) { - "use strict"; +enifed('ember-metal/streams/proxy-stream', ['exports', 'ember-metal/merge', 'ember-metal/streams/stream'], function (exports, _emberMetalMerge, _emberMetalStreamsStream) { function ProxyStream(source, label) { this.init(label); this.sourceDep = this.addMutableDependency(source); } - ProxyStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsStream["default"].prototype); + ProxyStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); - _emberMetalMerge["default"](ProxyStream.prototype, { + _emberMetalMerge.default(ProxyStream.prototype, { compute: function () { return this.sourceDep.getValue(); }, setValue: function (value) { @@ -21477,14 +19147,13 @@ this.sourceDep.replace(source); this.notify(); } }); - exports["default"] = ProxyStream; + exports.default = ProxyStream; }); -enifed("ember-metal/streams/stream", ["exports", "ember-metal/core", "ember-metal/platform/create", "ember-metal/path_cache", "ember-metal/observer", "ember-metal/streams/utils", "ember-metal/streams/subscriber", "ember-metal/streams/dependency"], function (exports, _emberMetalCore, _emberMetalPlatformCreate, _emberMetalPath_cache, _emberMetalObserver, _emberMetalStreamsUtils, _emberMetalStreamsSubscriber, _emberMetalStreamsDependency) { - "use strict"; +enifed('ember-metal/streams/stream', ['exports', 'ember-metal/core', 'ember-metal/path_cache', 'ember-metal/observer', 'ember-metal/streams/utils', 'ember-metal/streams/subscriber', 'ember-metal/streams/dependency'], function (exports, _emberMetalCore, _emberMetalPath_cache, _emberMetalObserver, _emberMetalStreamsUtils, _emberMetalStreamsSubscriber, _emberMetalStreamsDependency) { /** @module ember-metal */ @@ -21518,21 +19187,21 @@ this.dependencyTail = null; this.observedProxy = null; }, _makeChildStream: function (key) { - KeyStream = KeyStream || _emberMetalCore["default"].__loader.require('ember-metal/streams/key-stream')["default"]; + KeyStream = KeyStream || _emberMetalCore.default.__loader.require('ember-metal/streams/key-stream').default; return new KeyStream(this, key); }, removeChild: function (key) { delete this.children[key]; }, getKey: function (key) { if (this.children === undefined) { - this.children = _emberMetalPlatformCreate["default"](null); + this.children = Object.create(null); } var keyStream = this.children[key]; if (keyStream === undefined) { @@ -21546,11 +19215,11 @@ get: function (path) { var firstKey = _emberMetalPath_cache.getFirstKey(path); var tailPath = _emberMetalPath_cache.getTailPath(path); if (this.children === undefined) { - this.children = _emberMetalPlatformCreate["default"](null); + this.children = Object.create(null); } var keyStream = this.children[firstKey]; if (keyStream === undefined) { @@ -21599,11 +19268,11 @@ return this.cache; }, addMutableDependency: function (object) { - var dependency = new _emberMetalStreamsDependency["default"](this, object); + var dependency = new _emberMetalStreamsDependency.default(this, object); if (this.isActive) { dependency.subscribe(); } @@ -21658,11 +19327,11 @@ revalidate: function (value) { if (value !== this.observedProxy) { this._clearObservedProxy(); - ProxyMixin = ProxyMixin || _emberMetalCore["default"].__loader.require('ember-runtime/mixins/-proxy')["default"]; + ProxyMixin = ProxyMixin || _emberMetalCore.default.__loader.require('ember-runtime/mixins/-proxy').default; if (ProxyMixin.detect(value)) { _emberMetalObserver.addObserver(value, 'content', this, this.notify); this.observedProxy = value; } @@ -21679,15 +19348,15 @@ deactivate: function () { this._clearObservedProxy(); }, compute: function () { - throw new Error("Stream error: compute not implemented"); + throw new Error('Stream error: compute not implemented'); }, setValue: function () { - throw new Error("Stream error: setValue not implemented"); + throw new Error('Stream error: setValue not implemented'); }, notify: function () { this.notifyExcept(); }, @@ -21699,11 +19368,11 @@ } }, subscribe: function (callback, context) { - var subscriber = new _emberMetalStreamsSubscriber["default"](callback, context, this); + var subscriber = new _emberMetalStreamsSubscriber.default(callback, context, this); if (this.subscriberHead === null) { this.subscriberHead = this.subscriberTail = subscriber; } else { var tail = this.subscriberTail; tail.next = subscriber; @@ -21790,20 +19459,19 @@ } }; function makeLabel(label) { if (label === undefined) { - return "(no label)"; + return '(no label)'; } else { return label; } } - exports["default"] = Stream; + exports.default = Stream; }); -enifed("ember-metal/streams/subscriber", ["exports", "ember-metal/merge"], function (exports, _emberMetalMerge) { - "use strict"; +enifed('ember-metal/streams/subscriber', ['exports', 'ember-metal/merge'], function (exports, _emberMetalMerge) { /** @module ember-metal */ @@ -21818,11 +19486,11 @@ this.prev = null; this.callback = callback; this.context = context; } - _emberMetalMerge["default"](Subscriber.prototype, { + _emberMetalMerge.default(Subscriber.prototype, { removeFrom: function (stream) { var next = this.next; var prev = this.prev; if (prev) { @@ -21839,15 +19507,13 @@ stream.maybeDeactivate(); } }); - exports["default"] = Subscriber; + exports.default = Subscriber; }); -enifed('ember-metal/streams/utils', ['exports', './stream'], function (exports, _stream) { - 'use strict'; - +enifed('ember-metal/streams/utils', ['exports', 'ember-metal/core', './stream'], function (exports, _emberMetalCore, _stream) { exports.isStream = isStream; exports.subscribe = subscribe; exports.unsubscribe = unsubscribe; exports.read = read; exports.readArray = readArray; @@ -22046,19 +19712,19 @@ // TODO: Create subclass ConcatStream < Stream. Defer // subscribing to streams until the value() is called. var hasStream = scanArray(array); if (hasStream) { var i, l; - var stream = new _stream["default"](function () { + var stream = new _stream.default(function () { return concat(readArray(array), separator); }, function () { var labels = labelsFor(array); return 'concat([' + labels.join(', ') + ']; separator=' + inspect(separator) + ')'; }); for (i = 0, l = array.length; i < l; i++) { - stream.addDependency(array[i]); + subscribe(array[i], stream.notify, stream); } // used by angle bracket components to detect an attribute was provided // as a string literal stream.isConcat = true; @@ -22084,11 +19750,11 @@ for (var prop in streams) { labels.push(prop + ': ' + inspect(streams[prop])); } - return labels.length ? '{ ' + labels.join(', ') + ' }' : "{}"; + return labels.length ? '{ ' + labels.join(', ') + ' }' : '{}'; } function labelFor(maybeStream) { if (isStream(maybeStream)) { var stream = maybeStream; @@ -22101,20 +19767,20 @@ function inspect(value) { switch (typeof value) { case 'string': return '"' + value + '"'; case 'object': - return "{ ... }"; + return '{ ... }'; case 'function': - return "function() { ... }"; + return 'function() { ... }'; default: return String(value); } } function or(first, second) { - var stream = new _stream["default"](function () { + var stream = new _stream.default(function () { return first.value() || second.value(); }, function () { return labelFor(first) + ' || ' + labelFor(second); }); @@ -22130,11 +19796,11 @@ } } function zip(streams, callback, label) { - var stream = new _stream["default"](function () { + var stream = new _stream.default(function () { var array = readArray(streams); return callback ? callback(array) : array; }, function () { return label + '(' + labelsFor(streams) + ')'; }); @@ -22146,11 +19812,11 @@ return stream; } function zipHash(object, callback, label) { - var stream = new _stream["default"](function () { + var stream = new _stream.default(function () { var hash = readHash(object); return callback ? callback(hash) : hash; }, function () { return label + '(' + labelsForObject(object) + ')'; }); @@ -22195,11 +19861,11 @@ function `fn`. */ function chain(value, fn, label) { if (isStream(value)) { - var stream = new _stream["default"](fn, function () { + var stream = new _stream.default(fn, function () { return label + '(' + labelFor(value) + ')'; }); stream.addDependency(value); return stream; } else { @@ -22211,18 +19877,12 @@ if (object && object.isStream) { object.setValue(value); } } }); -enifed("ember-metal/symbol", ["exports"], function (exports) { - "use strict"; -}); -enifed("ember-metal/utils", ["exports", "ember-metal/core", "ember-metal/platform/create", "ember-metal/platform/define_property"], function (exports, _emberMetalCore, _emberMetalPlatformCreate, _emberMetalPlatformDefine_property) { - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - // - +enifed("ember-metal/symbol", ["exports"], function (exports) {}); +enifed('ember-metal/utils', ['exports', 'ember-metal/core', 'ember-metal/features'], function (exports, _emberMetalCore, _emberMetalFeatures) { exports.uuid = uuid; exports.symbol = symbol; exports.generateGuid = generateGuid; exports.guidFor = guidFor; exports.getMeta = getMeta; @@ -22232,11 +19892,14 @@ exports.tryInvoke = tryInvoke; exports.makeArray = makeArray; exports.inspect = inspect; exports.apply = apply; exports.applyStr = applyStr; - "REMOVE_USE_STRICT: true"; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + // + 'REMOVE_USE_STRICT: true'; /** @module ember-metal */ @@ -22250,12 +19913,11 @@ var _uuid = 0; /** Generates a universally unique identifier. This method is used internally by Ember for assisting with - the generation of GUID's and other unique identifiers - such as `bind-attr` data attributes. + the generation of GUID's and other unique identifiers. @public @return {Number} [description] */ @@ -22428,11 +20090,11 @@ } else { GUID_DESC.value = ret; if (obj.__defineNonEnumerable) { obj.__defineNonEnumerable(GUID_KEY_PROPERTY); } else { - _emberMetalPlatformDefine_property.defineProperty(obj, GUID_KEY, GUID_DESC); + Object.defineProperty(obj, GUID_KEY, GUID_DESC); } } } return ret; } @@ -22451,21 +20113,18 @@ @param {Object} obj any object, string, number, Element, or primitive @return {String} the unique guid for this instance. */ function guidFor(obj) { - if (obj && obj[GUID_KEY]) { - return obj[GUID_KEY]; - } // special cases where we don't want to add a key to object if (obj === undefined) { - return "(undefined)"; + return '(undefined)'; } if (obj === null) { - return "(null)"; + return '(null)'; } var ret; var type = typeof obj; @@ -22491,10 +20150,14 @@ case 'boolean': return obj ? '(true)' : '(false)'; default: + if (obj[GUID_KEY]) { + return obj[GUID_KEY]; + } + if (obj === Object) { return '(Object)'; } if (obj === Array) { @@ -22509,11 +20172,11 @@ GUID_DESC.value = ret; if (obj.__defineNonEnumerable) { obj.__defineNonEnumerable(GUID_KEY_PROPERTY); } else { - _emberMetalPlatformDefine_property.defineProperty(obj, GUID_KEY, GUID_DESC); + Object.defineProperty(obj, GUID_KEY, GUID_DESC); } } return ret; } } @@ -22537,26 +20200,13 @@ Meta.prototype = { chainWatchers: null // FIXME }; - if (!_emberMetalPlatformDefine_property.canDefineNonEnumerableProperties) { - // on platforms that don't support enumerable false - // make meta fail jQuery.isPlainObject() to hide from - // jQuery.extend() by having a property that fails - // hasOwnProperty check. - Meta.prototype.__preventPlainObject__ = true; - - // Without non-enumerable properties, meta objects will be output in JSON - // unless explicitly suppressed - Meta.prototype.toJSON = function () {}; - } - // Placeholder for non-writable metas. var EMPTY_META = new Meta(null); - /** Retrieves the meta hash for an object. If `writable` is true ensures the hash is writable for this object as well. The meta object contains information about computed property descriptors as @@ -22578,36 +20228,32 @@ if (writable === false) { return ret || EMPTY_META; } if (!ret) { - if (_emberMetalPlatformDefine_property.canDefineNonEnumerableProperties) { - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(EMBER_META_PROPERTY); - } else { - _emberMetalPlatformDefine_property.defineProperty(obj, '__ember_meta__', META_DESC); - } + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(EMBER_META_PROPERTY); + } else { + Object.defineProperty(obj, '__ember_meta__', META_DESC); } ret = new Meta(obj); - obj.__ember_meta__ = ret; } else if (ret.source !== obj) { if (obj.__defineNonEnumerable) { obj.__defineNonEnumerable(EMBER_META_PROPERTY); } else { - _emberMetalPlatformDefine_property.defineProperty(obj, '__ember_meta__', META_DESC); + Object.defineProperty(obj, '__ember_meta__', META_DESC); } - ret = _emberMetalPlatformCreate["default"](ret); - ret.watching = _emberMetalPlatformCreate["default"](ret.watching); + ret = Object.create(ret); + ret.watching = Object.create(ret.watching); ret.cache = undefined; ret.cacheMeta = undefined; ret.source = obj; - obj['__ember_meta__'] = ret; } return ret; } @@ -22671,11 +20317,11 @@ value = _meta[keyName] = { __ember_source__: obj }; } else if (value.__ember_source__ !== obj) { if (!writable) { return undefined; } - value = _meta[keyName] = _emberMetalPlatformCreate["default"](value); + value = _meta[keyName] = Object.create(value); value.__ember_source__ = obj; } _meta = value; } @@ -22782,195 +20428,16 @@ if (canInvoke(obj, methodName)) { return args ? applyStr(obj, methodName, args) : applyStr(obj, methodName); } } - // https://github.com/emberjs/ember.js/pull/1617 - var needsFinallyFix = (function () { - var count = 0; - try { - // jscs:disable - try {} finally { - count++; - throw new Error('needsFinallyFixTest'); - } - // jscs:enable - } catch (e) {} - - return count !== 1; - })(); - - /** - Provides try/finally functionality, while working - around Safari's double finally bug. - - ```javascript - var tryable = function() { - someResource.lock(); - runCallback(); // May throw error. - }; - - var finalizer = function() { - someResource.unlock(); - }; - - Ember.tryFinally(tryable, finalizer); - ``` - - @method tryFinally - @deprecated Use JavaScript's native try/finally - @for Ember - @param {Function} tryable The function to run the try callback - @param {Function} finalizer The function to run the finally callback - @param {Object} [binding] The optional calling object. Defaults to 'this' - @return {*} The return value is the that of the finalizer, - unless that value is undefined, in which case it is the return value - of the tryable - @private - */ - - var tryFinally; - if (needsFinallyFix) { - exports.tryFinally = tryFinally = function (tryable, finalizer, binding) { - var result, finalResult, finalError; - - binding = binding || this; - - try { - result = tryable.call(binding); - } finally { - try { - finalResult = finalizer.call(binding); - } catch (e) { - finalError = e; - } - } - - if (finalError) { - throw finalError; - } - - return finalResult === undefined ? result : finalResult; - }; - } else { - exports.tryFinally = tryFinally = function (tryable, finalizer, binding) { - var result, finalResult; - - binding = binding || this; - - try { - result = tryable.call(binding); - } finally { - finalResult = finalizer.call(binding); - } - - return finalResult === undefined ? result : finalResult; - }; - } - - var deprecatedTryFinally = function () { - return tryFinally.apply(this, arguments); - }; - - /** - Provides try/catch/finally functionality, while working - around Safari's double finally bug. - - ```javascript - var tryable = function() { - for (i = 0, l = listeners.length; i < l; i++) { - listener = listeners[i]; - beforeValues[i] = listener.before(name, time(), payload); - } - - return callback.call(binding); - }; - - var catchable = function(e) { - payload = payload || {}; - payload.exception = e; - }; - - var finalizer = function() { - for (i = 0, l = listeners.length; i < l; i++) { - listener = listeners[i]; - listener.after(name, time(), payload, beforeValues[i]); - } - }; - - Ember.tryCatchFinally(tryable, catchable, finalizer); - ``` - - @method tryCatchFinally - @deprecated Use JavaScript's native try/catch/finally instead - @for Ember - @param {Function} tryable The function to run the try callback - @param {Function} catchable The function to run the catchable callback - @param {Function} finalizer The function to run the finally callback - @param {Object} [binding] The optional calling object. Defaults to 'this' - @return {*} The return value is the that of the finalizer, - unless that value is undefined, in which case it is the return value - of the tryable. - @private - */ - var tryCatchFinally; - if (needsFinallyFix) { - exports.tryCatchFinally = tryCatchFinally = function (tryable, catchable, finalizer, binding) { - var result, finalResult, finalError; - - binding = binding || this; - - try { - result = tryable.call(binding); - } catch (error) { - result = catchable.call(binding, error); - } finally { - try { - finalResult = finalizer.call(binding); - } catch (e) { - finalError = e; - } - } - - if (finalError) { - throw finalError; - } - - return finalResult === undefined ? result : finalResult; - }; - } else { - exports.tryCatchFinally = tryCatchFinally = function (tryable, catchable, finalizer, binding) { - var result, finalResult; - - binding = binding || this; - - try { - result = tryable.call(binding); - } catch (error) { - result = catchable.call(binding, error); - } finally { - finalResult = finalizer.call(binding); - } - - return finalResult === undefined ? result : finalResult; - }; - } - - var deprecatedTryCatchFinally = function () { - return tryCatchFinally.apply(this, arguments); - }; - // ........................................ // TYPING & ARRAY MESSAGING // var toString = Object.prototype.toString; - var isArray = Array.isArray || function (value) { - return value !== null && value !== undefined && typeof value === 'object' && typeof value.length === 'number' && toString.call(value) === '[object Array]'; - }; - /** Forces the passed object to be part of an array. If the object is already an array, it will return the object. Otherwise, it will add the object to an array. If obj is `null` or `undefined`, it will return an empty array. @@ -22995,11 +20462,11 @@ function makeArray(obj) { if (obj === null || obj === undefined) { return []; } - return isArray(obj) ? obj : [obj]; + return Array.isArray(obj) ? obj : [obj]; } /** Convenience method to inspect an object. This method will attempt to convert the object into a useful string description. @@ -23020,15 +20487,16 @@ return 'null'; } if (obj === undefined) { return 'undefined'; } - if (isArray(obj)) { + if (Array.isArray(obj)) { return '[' + obj + ']'; } // for non objects - if (typeof obj !== 'object') { + var type = typeof obj; + if (type !== 'object' && type !== 'symbol') { return '' + obj; } // overridden toString if (typeof obj.toString === 'function' && obj.toString !== toString) { return obj.toString(); @@ -23042,21 +20510,21 @@ v = obj[key]; if (v === 'toString') { continue; } // ignore useless items if (typeof v === 'function') { - v = "function() { ... }"; + v = 'function() { ... }'; } if (v && typeof v.toString !== 'function') { - ret.push(key + ": " + toString.call(v)); + ret.push(key + ': ' + toString.call(v)); } else { - ret.push(key + ": " + v); + ret.push(key + ': ' + v); } } } - return "{" + ret.join(", ") + "}"; + return '{' + ret.join(', ') + '}'; } // The following functions are intentionally minified to keep the functions // below Chrome's function body size inlining limit of 600 chars. /** @@ -23117,27 +20585,20 @@ exports.GUID_KEY = GUID_KEY; exports.META_DESC = META_DESC; exports.EMPTY_META = EMPTY_META; exports.meta = meta; - exports.isArray = isArray; exports.makeArray = makeArray; - exports.tryCatchFinally = tryCatchFinally; - exports.deprecatedTryCatchFinally = deprecatedTryCatchFinally; exports.canInvoke = canInvoke; - exports.tryFinally = tryFinally; - exports.deprecatedTryFinally = deprecatedTryFinally; }); -enifed("ember-metal/watch_key", ["exports", "ember-metal/core", "ember-metal/utils", "ember-metal/platform/define_property", "ember-metal/properties"], function (exports, _emberMetalCore, _emberMetalUtils, _emberMetalPlatformDefine_property, _emberMetalProperties) { - "use strict"; - +enifed('ember-metal/watch_key', ['exports', 'ember-metal/features', 'ember-metal/utils', 'ember-metal/properties'], function (exports, _emberMetalFeatures, _emberMetalUtils, _emberMetalProperties) { exports.watchKey = watchKey; exports.unwatchKey = unwatchKey; function watchKey(obj, keyName, meta) { // can't watch length on Array - it is special... - if (keyName === 'length' && _emberMetalUtils.isArray(obj)) { + if (keyName === 'length' && Array.isArray(obj)) { return; } var m = meta || _emberMetalUtils.meta(obj); var watching = m.watching; @@ -23153,17 +20614,15 @@ } if ('function' === typeof obj.willWatchProperty) { obj.willWatchProperty(keyName); } - - } else { + } else { watching[keyName] = (watching[keyName] || 0) + 1; } } - // This is super annoying, but required until // https://github.com/babel/babel/issues/906 is resolved ; // jshint ignore:line function unwatchKey(obj, keyName, meta) { @@ -23180,19 +20639,20 @@ } if ('function' === typeof obj.didUnwatchProperty) { obj.didUnwatchProperty(keyName); } - - } else if (watching[keyName] > 1) { + } else if (watching[keyName] > 1) { watching[keyName]--; } } }); -enifed("ember-metal/watch_path", ["exports", "ember-metal/utils", "ember-metal/chains"], function (exports, _emberMetalUtils, _emberMetalChains) { - "use strict"; +// this x in Y deopts, so keeping it in this function is better; + +// redefine to set as enumerable +enifed('ember-metal/watch_path', ['exports', 'ember-metal/utils', 'ember-metal/chains'], function (exports, _emberMetalUtils, _emberMetalChains) { exports.watchPath = watchPath; exports.unwatchPath = unwatchPath; // get the chains for the current object. If the current object has // chains inherited from the proto they will be cloned and reconfigured for @@ -23208,11 +20668,11 @@ return ret; } function watchPath(obj, keyPath, meta) { // can't watch length on Array - it is special... - if (keyPath === 'length' && _emberMetalUtils.isArray(obj)) { + if (keyPath === 'length' && Array.isArray(obj)) { return; } var m = meta || _emberMetalUtils.meta(obj); var watching = m.watching; @@ -23236,17 +20696,11 @@ } else if (watching[keyPath] > 1) { watching[keyPath]--; } } }); -enifed("ember-metal/watching", ["exports", "ember-metal/utils", "ember-metal/chains", "ember-metal/watch_key", "ember-metal/watch_path", "ember-metal/path_cache"], function (exports, _emberMetalUtils, _emberMetalChains, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache) { - /** - @module ember-metal - */ - - "use strict"; - +enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache'], function (exports, _emberMetalChains, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache) { exports.isWatching = isWatching; exports.unwatch = unwatch; exports.destroy = destroy; /** @@ -23262,11 +20716,11 @@ @param obj @param {String} _keyPath */ function watch(obj, _keyPath, m) { // can't watch length on Array - it is special... - if (_keyPath === 'length' && _emberMetalUtils.isArray(obj)) { + if (_keyPath === 'length' && Array.isArray(obj)) { return; } if (!_emberMetalPath_cache.isPath(_keyPath)) { _emberMetalWatch_key.watchKey(obj, _keyPath, m); @@ -23284,11 +20738,11 @@ watch.flushPending = _emberMetalChains.flushPendingChains; function unwatch(obj, _keyPath, m) { // can't watch length on Array - it is special... - if (_keyPath === 'length' && _emberMetalUtils.isArray(obj)) { + if (_keyPath === 'length' && Array.isArray(obj)) { return; } if (!_emberMetalPath_cache.isPath(_keyPath)) { _emberMetalWatch_key.unwatchKey(obj, _keyPath, m); @@ -23325,11 +20779,11 @@ node = NODE_STACK.pop(); // push children nodes = node._chains; if (nodes) { for (key in nodes) { - if (nodes.hasOwnProperty(key)) { + if (nodes[key] !== undefined) { NODE_STACK.push(nodes[key]); } } } // remove chainWatcher in node object @@ -23342,44 +20796,29 @@ } } } } }); -enifed("ember-routing-htmlbars", ["exports", "ember-metal/core", "ember-metal/merge", "ember-htmlbars/helpers", "ember-htmlbars/keywords", "ember-routing-htmlbars/helpers/query-params", "ember-routing-htmlbars/keywords/action", "ember-routing-htmlbars/keywords/element-action", "ember-routing-htmlbars/keywords/link-to", "ember-routing-htmlbars/keywords/render"], function (exports, _emberMetalCore, _emberMetalMerge, _emberHtmlbarsHelpers, _emberHtmlbarsKeywords, _emberRoutingHtmlbarsHelpersQueryParams, _emberRoutingHtmlbarsKeywordsAction, _emberRoutingHtmlbarsKeywordsElementAction, _emberRoutingHtmlbarsKeywordsLinkTo, _emberRoutingHtmlbarsKeywordsRender) { - /** - @module ember - @submodule ember-routing-htmlbars - */ +/** +@module ember-metal +*/ +enifed('ember-routing-htmlbars', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-htmlbars/keywords', 'ember-routing-htmlbars/helpers/query-params', 'ember-routing-htmlbars/keywords/action', 'ember-routing-htmlbars/keywords/element-action', 'ember-routing-htmlbars/keywords/link-to', 'ember-routing-htmlbars/keywords/render'], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberHtmlbarsKeywords, _emberRoutingHtmlbarsHelpersQueryParams, _emberRoutingHtmlbarsKeywordsAction, _emberRoutingHtmlbarsKeywordsElementAction, _emberRoutingHtmlbarsKeywordsLinkTo, _emberRoutingHtmlbarsKeywordsRender) { - "use strict"; - _emberHtmlbarsHelpers.registerHelper('query-params', _emberRoutingHtmlbarsHelpersQueryParams.queryParamsHelper); - _emberHtmlbarsKeywords.registerKeyword('action', _emberRoutingHtmlbarsKeywordsAction["default"]); - _emberHtmlbarsKeywords.registerKeyword('@element_action', _emberRoutingHtmlbarsKeywordsElementAction["default"]); - _emberHtmlbarsKeywords.registerKeyword('link-to', _emberRoutingHtmlbarsKeywordsLinkTo["default"]); - _emberHtmlbarsKeywords.registerKeyword('render', _emberRoutingHtmlbarsKeywordsRender["default"]); + _emberHtmlbarsKeywords.registerKeyword('action', _emberRoutingHtmlbarsKeywordsAction.default); + _emberHtmlbarsKeywords.registerKeyword('@element_action', _emberRoutingHtmlbarsKeywordsElementAction.default); + _emberHtmlbarsKeywords.registerKeyword('link-to', _emberRoutingHtmlbarsKeywordsLinkTo.default); + _emberHtmlbarsKeywords.registerKeyword('render', _emberRoutingHtmlbarsKeywordsRender.default); - var deprecatedLinkTo = _emberMetalMerge["default"]({}, _emberRoutingHtmlbarsKeywordsLinkTo["default"]); - _emberMetalMerge["default"](deprecatedLinkTo, { - link: function (state, params, hash) { - _emberRoutingHtmlbarsKeywordsLinkTo["default"].link.call(this, state, params, hash); - } - }); - - _emberHtmlbarsKeywords.registerKeyword('linkTo', deprecatedLinkTo); - - exports["default"] = _emberMetalCore["default"]; + exports.default = _emberMetalCore.default; }); -enifed("ember-routing-htmlbars/helpers/query-params", ["exports", "ember-metal/core", "ember-routing/system/query_params"], function (exports, _emberMetalCore, _emberRoutingSystemQuery_params) { - /** - @module ember - @submodule ember-routing-htmlbars - */ - - "use strict"; - +/** +@module ember +@submodule ember-routing-htmlbars +*/ +enifed('ember-routing-htmlbars/helpers/query-params', ['exports', 'ember-metal/core', 'ember-routing/system/query_params'], function (exports, _emberMetalCore, _emberRoutingSystemQuery_params) { exports.queryParamsHelper = queryParamsHelper; /** This is a helper to be used in conjunction with the link-to helper. It will supply url query parameters to the target route. @@ -23397,170 +20836,78 @@ @public */ function queryParamsHelper(params, hash) { - return _emberRoutingSystemQuery_params["default"].create({ + return _emberRoutingSystemQuery_params.default.create({ values: hash }); } }); +/** +@module ember +@submodule ember-routing-htmlbars +*/ + // assert -enifed("ember-routing-htmlbars/keywords/action", ["exports", "htmlbars-runtime/hooks", "ember-routing-htmlbars/keywords/closure-action"], function (exports, _htmlbarsRuntimeHooks, _emberRoutingHtmlbarsKeywordsClosureAction) { - /** - @module ember - @submodule ember-templates - */ +enifed('ember-routing-htmlbars/keywords/action', ['exports', 'ember-metal/features', 'htmlbars-runtime/hooks', 'ember-routing-htmlbars/keywords/closure-action'], function (exports, _emberMetalFeatures, _htmlbarsRuntimeHooks, _emberRoutingHtmlbarsKeywordsClosureAction) { - "use strict"; - /** - The `{{action}}` helper provides a way to pass triggers for behavior (usually - just a function) between components, and into components from controllers. + The `{{action}}` helper provides a useful shortcut for registering an HTML + element within a template for a single DOM event and forwarding that + interaction to the template's controller or specified `target` option. - ### Passing functions with the action helper + If the controller does not implement the specified action, the event is sent + to the current route, and it bubbles up the route hierarchy from there. - There are three contexts an action helper can be used in. The first two - contexts to discuss are attribute context, and Handlebars value context. + For more advanced event handling see [Ember.Component](/api/classes/Ember.Component.html) - ```handlebars - {{! An example of attribute context }} - <div onclick={{action "save"}}></div> - {{! Examples of Handlebars value context }} - {{input on-input=(action "save")}} - {{yield (action "refreshData") andAnotherParam}} - ``` - In these contexts, - the helper is called a "closure action" helper. It's behavior is simple: - If passed a function name, read that function off the `actions` property - of the current context. Once that function is read (or if a function was - passed), create a closure over that function and any arguments. + ### Use + Given the following application Handlebars template on the page - The resulting value of an action helper used this way is simply a function. - For example with this attribute context example: - ```handlebars - {{! An example of attribute context }} - <div onclick={{action "save"}}></div> + <div {{action 'anActionName'}}> + click me + </div> ``` - The resulting template render logic would be: + And application code - ```js - var div = document.createElement('div'); - var actionFunction = (function(context){ - return function() { - return context.actions.save.apply(context, arguments); - }; - })(context); - div.onclick = actionFunction; - ``` - - Thus when the div is clicked, the action on that context is called. - Because the `actionFunction` is just a function, closure actions can be - passed between components the still execute in the correct context. - - Here is an example action handler on a component: - - ```js - export default Ember.Component.extend({ + ```javascript + App.ApplicationController = Ember.Controller.extend({ actions: { - save(/* event *\/) { - this.get('model').save(); + anActionName: function() { } } }); ``` - Actions are always looked up on the `actions` property of the current context. - This avoids collisions in the naming of common actions, such as `destroy`. + Will result in the following rendered HTML - Two options can be passed to the `action` helper when it is used in this way. - - * `target=someProperty` will look to `someProperty` instead of the current - context for the `actions` hash. This can be useful when targetting a - service for actions. - * `value="target.value"` will read the path `target.value` off the first - argument to the action when it is called and rewrite the first argument - to be that value. This is useful when attaching actions to event listeners. - - ### Invoking an action - - Closure actions curry both their scope and any arguments. When invoked, any - additional arguments are added to the already curried list. - - Actions should be invoked using the [sendAction](/api/classes/Ember.Component.html#method_sendAction) - method. The first argument to `sendAction` is the action to be called, and - additional arguments are passed to the action function. This has interesting - properties combined with currying of arguments. For example: - - ```js - export default Ember.Component.extend({ - actions: { - // Usage {{input on-input=(action (action 'setName' model) value="target.value")}} - setName(model, name) { - model.set('name', name); - } - } - }); + ```html + <div class="ember-view"> + <div data-ember-action="1"> + click me + </div> + </div> ``` - The first argument (`model`) was curried over, and the run-time argument (`event`) - becomes a second argument. Action calls be nested this way because each simply - returns a function. Any function can be passed to the `{{action` helper, including - other actions. + Clicking "click me" will trigger the `anActionName` action of the + `App.ApplicationController`. In this case, no additional parameters will be passed. - Actions invoked with `sendAction` have the same currying behavior as demonstrated - with `on-input` above. For example: + If you provide additional parameters to the helper: - ```js - export default Ember.Component.extend({ - actions: { - setName(model, name) { - model.set('name', name); - } - } - }); - ``` - ```handlebars - {{my-input submit=(action 'setName' model)}} + <button {{action 'edit' post}}>Edit</button> ``` - ```js - // app/components/my-component.js - export default Ember.Component.extend({ - click() { - // Note that model is not passed, it was curried in the template - this.sendAction('submit', 'bob'); - } - }); - ``` + Those parameters will be passed along as arguments to the JavaScript + function implementing the action. - ### Attaching actions to DOM - - The third context the `{{action` helper can be used in we call "element space". - For example: - - ```handlebars - {{! An example of element space }} - <div {{action "save"}}></div> - ``` - - Used this way, the `{{action}}` helper provides a useful shortcut for - registering an HTML element within a template for a single DOM event and - forwarding that interaction to the template's context (controller or component). - - If the context of a template is a controller, actions used this way will - bubble to routes when the controller does not implement the specified action. - Once an action hits a route, it will bubble through the route hierarchy. - ### Event Propagation - `{{action` helpers called in element space can control event bubbling. - Events triggered through the action helper will automatically have `.preventDefault()` called on them. You do not need to do so in your event handlers. If you need to allow event propagation (to handle file inputs for example) you can supply the `preventDefault=false` option to the `{{action}}` helper: @@ -23581,28 +20928,24 @@ own event handler, or use event methods on your view class. See [Ember.View](/api/classes/Ember.View.html) 'Responding to Browser Events' for more information. ### Specifying DOM event type - `{{action` helpers called in element space can specify an event type. - By default the `{{action}}` helper registers for DOM `click` events. You can supply an `on` option to the helper to specify a different DOM event name: ```handlebars <div {{action "anActionName" on="double-click"}}> click me </div> ``` - See [Event Names](/api/classes/Ember.View.html#toc_event-names) for a list of + See `Ember.View` 'Responding to Browser Events' for a list of acceptable DOM event names. ### Specifying whitelisted modifier keys - `{{action` helpers called in element space can specify modifier keys. - By default the `{{action}}` helper will ignore click event with pressed modifier keys. You can supply an `allowedKeys` option to specify which keys should not be ignored. ```handlebars <div {{action "anActionName" allowedKeys="alt"}}> @@ -23620,60 +20963,86 @@ </div> ``` ### Specifying a Target - A `target` option can be provided to the helper to change + There are several possible target objects for `{{action}}` helpers: + + In a typical Ember application, where templates are managed through use of the + `{{outlet}}` helper, actions will bubble to the current controller, then + to the current route, and then up the route hierarchy. + + Alternatively, a `target` option can be provided to the helper to change which object will receive the method call. This option must be a path to an object, accessible in the current context: ```handlebars - {{! app/templates/application.hbs }} - <div {{action "anActionName" target=someService}}> + {{! the application template }} + <div {{action "anActionName" target=view}}> click me </div> ``` ```javascript - // app/controllers/application.js - export default Ember.Controller.extend({ - someService: Ember.inject.service() + App.ApplicationView = Ember.View.extend({ + actions: { + anActionName: function() {} + } }); + ``` + ### Additional Parameters + + You may specify additional parameters to the `{{action}}` helper. These + parameters are passed along as the arguments to the JavaScript function + implementing the action. + + ```handlebars + {{#each people as |person|}} + <div {{action "edit" person}}> + click me + </div> + {{/each}} + ``` + + Clicking "click me" will trigger the `edit` method on the current controller + with the value of `person` as a parameter. + @method action @for Ember.Templates.helpers @public */ - exports["default"] = function (morph, env, scope, params, hash, template, inverse, visitor) { - - if (morph) { - _htmlbarsRuntimeHooks.keyword('@element_action', morph, env, scope, params, hash, template, inverse, visitor); - return true; - } + exports.default = function (morph, env, scope, params, hash, template, inverse, visitor) { + if (morph) { + _htmlbarsRuntimeHooks.keyword('@element_action', morph, env, scope, params, hash, template, inverse, visitor); + return true; + } - return _emberRoutingHtmlbarsKeywordsClosureAction["default"](morph, env, scope, params, hash, template, inverse, visitor); - }; + return _emberRoutingHtmlbarsKeywordsClosureAction.default(morph, env, scope, params, hash, template, inverse, visitor); + }; }); -enifed("ember-routing-htmlbars/keywords/closure-action", ["exports", "ember-metal/streams/stream", "ember-metal/array", "ember-metal/streams/utils", "ember-metal/keys", "ember-metal/utils", "ember-metal/property_get", "ember-metal/error"], function (exports, _emberMetalStreamsStream, _emberMetalArray, _emberMetalStreamsUtils, _emberMetalKeys, _emberMetalUtils, _emberMetalProperty_get, _emberMetalError) { - "use strict"; - - exports["default"] = closureAction; - var INVOKE = _emberMetalUtils.symbol("INVOKE"); +/** +@module ember +@submodule ember-templates +*/ +enifed('ember-routing-htmlbars/keywords/closure-action', ['exports', 'ember-metal/streams/stream', 'ember-metal/streams/utils', 'ember-metal/utils', 'ember-metal/property_get', 'ember-metal/error'], function (exports, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberMetalUtils, _emberMetalProperty_get, _emberMetalError) { + exports.default = closureAction; + var INVOKE = _emberMetalUtils.symbol('INVOKE'); exports.INVOKE = INVOKE; var ACTION = _emberMetalUtils.symbol('ACTION'); exports.ACTION = ACTION; function closureAction(morph, env, scope, params, hash, template, inverse, visitor) { - return new _emberMetalStreamsStream["default"](function () { + return new _emberMetalStreamsStream.default(function () { var _this = this; - _emberMetalArray.map.call(params, this.addDependency, this); - _emberMetalArray.map.call(_emberMetalKeys["default"](hash), function (item) { - _this.addDependency(item); + params.map(this.addDependency, this); + Object.keys(hash).map(function (item) { + return _this.addDependency(item); }); var rawAction = params[0]; var actionArguments = _emberMetalStreamsUtils.readArray(params.slice(1, params.length)); @@ -23701,11 +21070,11 @@ } else if (target._actions) { action = target._actions[actionName]; } if (!action) { - throw new _emberMetalError["default"]("An action named '" + actionName + "' was not found in " + target + "."); + throw new _emberMetalError.default('An action named \'' + actionName + '\' was not found in ' + target + '.'); } } } if (hash.value) { @@ -23747,28 +21116,26 @@ closureAction[ACTION] = true; return closureAction; } }); -enifed("ember-routing-htmlbars/keywords/element-action", ["exports", "ember-metal/core", "ember-metal/utils", "ember-metal/run_loop", "ember-views/streams/utils", "ember-views/system/utils", "ember-views/system/action_manager"], function (exports, _emberMetalCore, _emberMetalUtils, _emberMetalRun_loop, _emberViewsStreamsUtils, _emberViewsSystemUtils, _emberViewsSystemAction_manager) { - "use strict"; +enifed('ember-routing-htmlbars/keywords/element-action', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/utils', 'ember-metal/run_loop', 'ember-views/streams/utils', 'ember-views/system/utils', 'ember-views/system/action_manager'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalUtils, _emberMetalRun_loop, _emberViewsStreamsUtils, _emberViewsSystemUtils, _emberViewsSystemAction_manager) { function assert(message, test) { // This only exists to prevent defeatureify from error when attempting // to transform the same source twice (tldr; you can't nest stripped statements) } - exports["default"] = { + exports.default = { setupState: function (state, env, scope, params, hash) { var getStream = env.hooks.get; var read = env.hooks.getValue; var actionName = read(params[0]); - - assert("You specified a quoteless path to the {{action}} helper " + "which did not resolve to an action name (a string). " + "Perhaps you meant to use a quoted actionName? (e.g. {{action 'save'}}).", typeof actionName === 'string' || typeof actionName === 'function'); - + assert('You specified a quoteless path to the {{action}} helper ' + 'which did not resolve to an action name (a string). ' + 'Perhaps you meant to use a quoted actionName? (e.g. {{action \'save\'}}).', typeof actionName === 'string' || typeof actionName === 'function'); + var actionArgs = []; for (var i = 1, l = params.length; i < l; i++) { actionArgs.push(_emberViewsStreamsUtils.readUnwrappedModel(params[i])); } @@ -23794,11 +21161,11 @@ var actionId = env.dom.getAttribute(node.element, 'data-ember-action') || _emberMetalUtils.uuid(); ActionHelper.registerAction({ actionId: actionId, node: node, - eventName: hash.on || "click", + eventName: hash.on || 'click', bubbles: hash.bubbles, preventDefault: hash.preventDefault, withKeyCode: hash.withKeyCode, allowedKeys: hash.allowedKeys }); @@ -23813,24 +21180,24 @@ var ActionHelper = {}; exports.ActionHelper = ActionHelper; // registeredActions is re-exported for compatibility with older plugins // that were using this undocumented API. - ActionHelper.registeredActions = _emberViewsSystemAction_manager["default"].registeredActions; + ActionHelper.registeredActions = _emberViewsSystemAction_manager.default.registeredActions; ActionHelper.registerAction = function (_ref) { var actionId = _ref.actionId; var node = _ref.node; var eventName = _ref.eventName; var preventDefault = _ref.preventDefault; var bubbles = _ref.bubbles; var allowedKeys = _ref.allowedKeys; - var actions = _emberViewsSystemAction_manager["default"].registeredActions[actionId]; + var actions = _emberViewsSystemAction_manager.default.registeredActions[actionId]; if (!actions) { - actions = _emberViewsSystemAction_manager["default"].registeredActions[actionId] = []; + actions = _emberViewsSystemAction_manager.default.registeredActions[actionId] = []; } actions.push({ eventName: eventName, handler: function (event) { @@ -23849,17 +21216,16 @@ var _node$state = node.state; var target = _node$state.target; var actionName = _node$state.actionName; var actionArgs = _node$state.actionArgs; - _emberMetalRun_loop["default"](function runRegisteredAction() { - - if (typeof actionName === 'function') { - actionName.apply(target, actionArgs); - return; - } - + _emberMetalRun_loop.default(function runRegisteredAction() { + if (typeof actionName === 'function') { + actionName.apply(target, actionArgs); + return; + } + if (target.send) { target.send.apply(target, [actionName].concat(actionArgs)); } else { target[actionName].apply(target, actionArgs); @@ -23870,47 +21236,41 @@ return actionId; }; ActionHelper.unregisterAction = function (actionId) { - delete _emberViewsSystemAction_manager["default"].registeredActions[actionId]; + delete _emberViewsSystemAction_manager.default.registeredActions[actionId]; }; - var MODIFIERS = ["alt", "shift", "meta", "ctrl"]; + var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl']; var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/; function isAllowedEvent(event, allowedKeys) { - if (typeof allowedKeys === "undefined") { + if (typeof allowedKeys === 'undefined') { if (POINTER_EVENT_TYPE_REGEX.test(event.type)) { return _emberViewsSystemUtils.isSimpleClick(event); } else { allowedKeys = ''; } } - if (allowedKeys.indexOf("any") >= 0) { + if (allowedKeys.indexOf('any') >= 0) { return true; } for (var i = 0, l = MODIFIERS.length; i < l; i++) { - if (event[MODIFIERS[i] + "Key"] && allowedKeys.indexOf(MODIFIERS[i]) === -1) { + if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) { return false; } } return true; } }); // assert enifed('ember-routing-htmlbars/keywords/link-to', ['exports', 'ember-metal/streams/utils', 'ember-metal/core', 'ember-metal/merge'], function (exports, _emberMetalStreamsUtils, _emberMetalCore, _emberMetalMerge) { - /** - @module ember - @submodule ember-routing-htmlbars - */ - 'use strict'; - /** The `{{link-to}}` helper renders a link to the supplied `routeName` passing an optionally supplied model to the route as its `model` context of the route. The block for `{{link-to}}` becomes the innerHTML of the rendered @@ -24040,47 +21400,18 @@ ``` To override this option for your entire application, see "Overriding Application-wide Defaults". - ### Keeping a link active for other routes - - If you need a link to be 'active' even when it doesn't match - the current route, you can use the the `current-when` - argument. - - ```handlebars - {{#link-to 'photoGallery' current-when='photos'}} - Photo Gallery - {{/link-to}} - ``` - - This may be helpful for keeping links active for: - - * non-nested routes that are logically related - * some secondary menu approaches - * 'top navigation' with 'sub navigation' scenarios - - A link will be active if `current-when` is `true` or the current - route is the route this link would transition to. - - To match multiple routes 'space-separate' the routes: - - ```handlebars - {{#link-to 'gallery' current-when='photos drawings paintings'}} - Art Gallery - {{/link-to}} - ``` - ### Supplying a model An optional model argument can be used for routes whose paths contain dynamic segments. This argument will become the model context of the linked route: ```javascript App.Router.map(function() { - this.resource("photoGallery", {path: "hamster-photos/:photo_id"}); + this.route("photoGallery", {path: "hamster-photos/:photo_id"}); }); ``` ```handlebars {{#link-to 'photoGallery' aPhoto}} @@ -24101,11 +21432,11 @@ supplied model argument will become the context for the route with the dynamic segments: ```javascript App.Router.map(function() { - this.resource("photoGallery", {path: "hamster-photos/:photo_id"}, function() { + this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() { this.route("comment", {path: "comments/:comment_id"}); }); }); ``` This argument will become the model context of the linked route: @@ -24128,11 +21459,11 @@ paths contain dynamic segments. This argument will become the value of the dynamic segment: ```javascript App.Router.map(function() { - this.resource("photoGallery", {path: "hamster-photos/:photo_id"}); + this.route("photoGallery", { path: "hamster-photos/:photo_id" }); }); ``` ```handlebars {{#link-to 'photoGallery' aPhotoId}} @@ -24209,18 +21540,16 @@ @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkComponent @return {String} HTML string @see {Ember.LinkComponent} @public */ - exports["default"] = { + exports.default = { link: function (state, params, hash) { }, render: function (morph, env, scope, params, hash, template, inverse, visitor) { - var attrs = _emberMetalMerge["default"]({}, hash); - - // TODO: Rewrite link-to to use arbitrary length positional params. + var attrs = _emberMetalMerge.default({}, _emberMetalStreamsUtils.readHash(hash)); attrs.params = _emberMetalStreamsUtils.readArray(params); // Used for deprecations (to tell the user what view the deprecated syntax // was used in). attrs.view = env.view; @@ -24228,35 +21557,26 @@ // TODO: Remove once `hasBlock` is working again attrs.hasBlock = !!template; attrs.escaped = !morph.parseTextAsHTML; - env.hooks.component(morph, env, scope, '-link-to', params, attrs, { "default": template }, visitor); + env.hooks.component(morph, env, scope, '-link-to', params, attrs, { default: template }, visitor); }, rerender: function (morph, env, scope, params, hash, template, inverse, visitor) { this.render(morph, env, scope, params, hash, template, inverse, visitor); } }; - - /** - See [link-to](/api/classes/Ember.Handlebars.helpers.html#method_link-to) - - @method linkTo - @for Ember.Handlebars.helpers - @deprecated - @param {String} routeName - @param {Object} [context]* - @return {String} HTML string - @private - */ }); -// assert -enifed("ember-routing-htmlbars/keywords/render", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/error", "ember-metal/platform/create", "ember-metal/streams/utils", "ember-runtime/system/string", "ember-routing/system/generate_controller", "ember-htmlbars/node-managers/view-node-manager"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalError, _emberMetalPlatformCreate, _emberMetalStreamsUtils, _emberRuntimeSystemString, _emberRoutingSystemGenerate_controller, _emberHtmlbarsNodeManagersViewNodeManager) { - "use strict"; +/** +@module ember +@submodule ember-routing-htmlbars +*/ - exports["default"] = { +// assert +enifed('ember-routing-htmlbars/keywords/render', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/streams/utils', 'ember-runtime/system/string', 'ember-routing/system/generate_controller', 'ember-htmlbars/node-managers/view-node-manager'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalError, _emberMetalStreamsUtils, _emberRuntimeSystemString, _emberRoutingSystemGenerate_controller, _emberHtmlbarsNodeManagersViewNodeManager) { + exports.default = { willRender: function (renderNode, env) { if (env.view.ownerView._outlets) { // We make sure we will get dirtied when outlet state changes. env.view.ownerView._outlets.push(renderNode); } @@ -24302,17 +21622,16 @@ if (params.length === 1) { // use the singleton controller } else if (params.length !== 2) { - throw new _emberMetalError["default"]("You must pass a templateName to render"); + throw new _emberMetalError.default('You must pass a templateName to render'); } // # legacy namespace - var originalName = name; name = name.replace(/\//g, '.'); - // \ legacy slash as namespace support + // \ legacy slash as namespace support var templateName = 'template:' + name; var view = container.lookup('view:' + name); if (!view) { @@ -24354,11 +21673,11 @@ target: parentController }); node.addDestruction(controller); } else { - controller = container.lookup(controllerFullName) || _emberRoutingSystemGenerate_controller["default"](container, controllerName); + controller = container.lookup(controllerFullName) || _emberRoutingSystemGenerate_controller.default(container, controllerName); controller.setProperties({ target: parentController, parentController: parentController }); @@ -24384,11 +21703,11 @@ if (view) { options.component = view; } - var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager["default"].create(node, env, hash, options, state.parentView, null, null, template); + var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager.default.create(node, env, hash, options, state.parentView, null, null, template); state.manager = nodeManager; if (router && params.length === 1) { router._connectActiveComponentNode(name, nodeManager); } @@ -24417,11 +21736,11 @@ if (!selectedOutletState) { return; } var matched = selectedOutletState.outlets[name]; if (matched) { - var childState = _emberMetalPlatformCreate["default"](null); + var childState = Object.create(null); childState[matched.render.outlet] = matched; matched.wasUsed = true; return childState; } } @@ -24462,39 +21781,27 @@ } return true; } }); // assert -enifed("ember-routing-views", ["exports", "ember-metal/core", "ember-routing-views/views/link", "ember-routing-views/views/outlet"], function (exports, _emberMetalCore, _emberRoutingViewsViewsLink, _emberRoutingViewsViewsOutlet) { - /** - @module ember - @submodule ember-routing-views - */ +enifed('ember-routing-views', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-routing-views/views/link', 'ember-routing-views/views/outlet'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberRoutingViewsViewsLink, _emberRoutingViewsViewsOutlet) { - "use strict"; - - _emberMetalCore["default"].LinkView = _emberRoutingViewsViewsLink.DeprecatedLinkView; - _emberMetalCore["default"].LinkComponent = _emberRoutingViewsViewsLink["default"]; - _emberMetalCore["default"].OutletView = _emberRoutingViewsViewsOutlet.OutletView; - - exports["default"] = _emberMetalCore["default"]; + _emberMetalCore.default.LinkComponent = _emberRoutingViewsViewsLink.default; + _emberMetalCore.default.OutletView = _emberRoutingViewsViewsOutlet.OutletView; + exports.default = _emberMetalCore.default; }); -enifed("ember-routing-views/views/link", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/computed", "ember-views/system/utils", "ember-views/views/component", "ember-runtime/inject", "ember-runtime/mixins/controller", "ember-htmlbars/hooks/get-value", "ember-htmlbars/templates/link-to"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalComputed, _emberViewsSystemUtils, _emberViewsViewsComponent, _emberRuntimeInject, _emberRuntimeMixinsController, _emberHtmlbarsHooksGetValue, _emberHtmlbarsTemplatesLinkTo) { - /** - @module ember - @submodule ember-routing-views - */ +/** +@module ember +@submodule ember-routing-views +*/ +enifed('ember-routing-views/views/link', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-views/system/utils', 'ember-views/views/component', 'ember-runtime/inject', 'ember-runtime/mixins/controller', 'ember-htmlbars/templates/link-to'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberViewsSystemUtils, _emberViewsViewsComponent, _emberRuntimeInject, _emberRuntimeMixinsController, _emberHtmlbarsTemplatesLinkTo) { + _emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.0.0-beta.2'; - "use strict"; - - _emberHtmlbarsTemplatesLinkTo["default"].meta.revision = 'Ember@1.13.13'; - var linkComponentClassNameBindings = ['active', 'loading', 'disabled']; - - linkComponentClassNameBindings = ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut']; - + linkComponentClassNameBindings = ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut']; + /** `Ember.LinkComponent` renders an element whose `click` event triggers a transition of the application's instance of `Ember.Router` to a supplied route by name. @@ -24506,12 +21813,12 @@ @namespace Ember @extends Ember.Component @see {Handlebars.helpers.link-to} @private **/ - var LinkComponent = _emberViewsViewsComponent["default"].extend({ - defaultLayout: _emberHtmlbarsTemplatesLinkTo["default"], + var LinkComponent = _emberViewsViewsComponent.default.extend({ + defaultLayout: _emberHtmlbarsTemplatesLinkTo.default, tagName: 'a', /** @deprecated Use current-when instead. @@ -24521,44 +21828,44 @@ currentWhen: null, /** Used to determine when this LinkComponent is active. @property currentWhen - @public + @private */ 'current-when': null, /** Sets the `title` attribute of the `LinkComponent`'s HTML element. @property title @default null - @public + @private **/ title: null, /** Sets the `rel` attribute of the `LinkComponent`'s HTML element. @property rel @default null - @public + @private **/ rel: null, /** Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. @property tabindex @default null - @public + @private **/ tabindex: null, /** Sets the `target` attribute of the `LinkComponent`'s HTML element. @since 1.8.0 @property target @default null - @public + @private **/ target: null, /** The CSS class to apply to `LinkComponent`'s element when its `active` @@ -24595,32 +21902,32 @@ Determines whether the `LinkComponent` will trigger routing via the `replaceWith` routing strategy. @property replace @type Boolean @default false - @public + @private **/ replace: false, /** By default the `{{link-to}}` helper will bind to the `href` and `title` attributes. It's discouraged that you override these defaults, however you can push onto the array if needed. @property attributeBindings @type Array | String @default ['title', 'rel', 'tabindex', 'target'] - @public + @private */ attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'], /** By default the `{{link-to}}` helper will bind to the `active`, `loading`, and `disabled` classes. It is discouraged to override these directly. @property classNameBindings @type Array @default ['active', 'loading', 'disabled'] - @public + @private */ classNameBindings: linkComponentClassNameBindings, /** By default the `{{link-to}}` helper responds to the `click` event. You @@ -24673,11 +21980,11 @@ // Map desired event name to invoke function var eventName = _emberMetalProperty_get.get(this, 'eventName'); this.on(eventName, this, this._invoke); }, - _routing: _emberRuntimeInject["default"].service('-routing'), + _routing: _emberRuntimeInject.default.service('-routing'), /** Accessed as a classname binding to apply the `LinkComponent`'s `disabledClass` CSS `class` to the element when the link is disabled. When `true` interactions with the element will not trigger route changes. @@ -24771,21 +22078,21 @@ if (_emberMetalProperty_get.get(this, '_isDisabled')) { return false; } if (_emberMetalProperty_get.get(this, 'loading')) { - _emberMetalCore["default"].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."); + _emberMetalCore.default.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.'); return false; } var targetAttribute2 = this.attrs.target; if (targetAttribute2 && targetAttribute2 !== '_self') { return false; } var routing = _emberMetalProperty_get.get(this, '_routing'); - var targetRouteName = this._handleOnlyQueryParamsSupplied(_emberMetalProperty_get.get(this, 'targetRouteName')); + var targetRouteName = _emberMetalProperty_get.get(this, 'targetRouteName'); var models = _emberMetalProperty_get.get(this, 'models'); var queryParamValues = _emberMetalProperty_get.get(this, 'queryParams.values'); var shouldReplace = _emberMetalProperty_get.get(this, 'attrs.replace'); routing.transitionTo(targetRouteName, models, queryParamValues, shouldReplace); @@ -24815,11 +22122,12 @@ } targetRouteName = this._handleOnlyQueryParamsSupplied(targetRouteName); var routing = _emberMetalProperty_get.get(this, '_routing'); - return routing.generateURL(targetRouteName, models, _emberMetalProperty_get.get(this, 'queryParams.values')); + var queryParams = _emberMetalProperty_get.get(this, 'queryParams.values'); + return routing.generateURL(targetRouteName, models, queryParams); }), loading: _emberMetalComputed.computed('models', 'targetRouteName', function () { var targetRouteName = _emberMetalProperty_get.get(this, 'targetRouteName'); var models = _emberMetalProperty_get.get(this, 'models'); @@ -24870,15 +22178,23 @@ queryParams = params.pop(); } else { queryParams = {}; } + if (attrs.disabledClass) { + this.set('disabledClass', attrs.disabledClass); + } + + if (attrs.activeClass) { + this.set('activeClass', attrs.activeClass); + } + if (attrs.disabledWhen) { - this.set('disabled', _emberHtmlbarsHooksGetValue["default"](attrs.disabledWhen)); + this.set('disabled', attrs.disabledWhen); } - var currentWhen = _emberHtmlbarsHooksGetValue["default"](attrs['current-when']); + var currentWhen = attrs['current-when']; if (attrs.currentWhen) { currentWhen = attrs.currentWhen; } @@ -24889,14 +22205,18 @@ // TODO: Change to built-in hasBlock once it's available if (!attrs.hasBlock) { this.set('linkTitle', params.shift()); } + if (attrs.loadingClass) { + _emberMetalProperty_set.set(this, 'loadingClass', attrs.loadingClass); + } + for (var i = 0; i < params.length; i++) { var value = params[i]; - while (_emberRuntimeMixinsController["default"].detect(value)) { + while (_emberRuntimeMixinsController.default.detect(value)) { value = value.get('model'); } params[i] = value; } @@ -24917,11 +22237,11 @@ this.set('resolvedQueryParams', resolvedQueryParams); } }); LinkComponent.toString = function () { - return "LinkComponent"; + return 'LinkComponent'; }; function computeActive(view, routerState) { if (_emberMetalProperty_get.get(view, 'loading')) { return false; @@ -24971,48 +22291,24 @@ } return resolvedQueryParams; } - /* DeprecatedLinkView - Start: TODO: Delete in Ember 2.0 */ - var DeprecatedLinkView = LinkComponent.extend({ - init: function () { - this._super.apply(this, arguments); - } - }); - - DeprecatedLinkView.reopen = function reopenWithDeprecation() { - - return LinkComponent.reopen.apply(LinkComponent, arguments); - }; - - DeprecatedLinkView.reopenClass({ - extend: function () { - return this._super.apply(this, arguments); - } - }); - - exports.DeprecatedLinkView = DeprecatedLinkView; - - /* DeprecatedLinkView - End*/ - - exports["default"] = LinkComponent; + exports.default = LinkComponent; }); +/** +@module ember +@submodule ember-routing-views +*/ + // FEATURES, Logger, assert -enifed("ember-routing-views/views/outlet", ["exports", "ember-views/views/view", "ember-htmlbars/templates/top-level-view"], function (exports, _emberViewsViewsView, _emberHtmlbarsTemplatesTopLevelView) { - /** - @module ember - @submodule ember-routing-views - */ +enifed('ember-routing-views/views/outlet', ['exports', 'ember-views/views/view', 'ember-htmlbars/templates/top-level-view'], function (exports, _emberViewsViewsView, _emberHtmlbarsTemplatesTopLevelView) { + _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.2'; - "use strict"; + var CoreOutletView = _emberViewsViewsView.default.extend({ + defaultTemplate: _emberHtmlbarsTemplatesTopLevelView.default, - _emberHtmlbarsTemplatesTopLevelView["default"].meta.revision = 'Ember@1.13.13'; - - var CoreOutletView = _emberViewsViewsView["default"].extend({ - defaultTemplate: _emberHtmlbarsTemplatesTopLevelView["default"], - init: function () { this._super(); this._outlets = []; }, @@ -25041,51 +22337,47 @@ exports.CoreOutletView = CoreOutletView; var OutletView = CoreOutletView.extend({ tagName: '' }); exports.OutletView = OutletView; }); -enifed("ember-routing", ["exports", "ember-metal/core", "ember-routing/ext/run_loop", "ember-routing/ext/controller", "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/generate_controller", "ember-routing/system/controller_for", "ember-routing/system/dsl", "ember-routing/system/router", "ember-routing/system/route", "ember-routing/initializers/routing-service"], function (exports, _emberMetalCore, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingInitializersRoutingService) { - /** - @module ember - @submodule ember-routing - */ +/** +@module ember +@submodule ember-routing-views +*/ +enifed('ember-routing', ['exports', 'ember-metal/core', 'ember-routing/ext/run_loop', 'ember-routing/ext/controller', '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/generate_controller', 'ember-routing/system/controller_for', 'ember-routing/system/dsl', 'ember-routing/system/router', 'ember-routing/system/route', 'ember-routing/initializers/routing-service'], function (exports, _emberMetalCore, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingInitializersRoutingService) { - "use strict"; + _emberMetalCore.default.Location = _emberRoutingLocationApi.default; + _emberMetalCore.default.AutoLocation = _emberRoutingLocationAuto_location.default; + _emberMetalCore.default.HashLocation = _emberRoutingLocationHash_location.default; + _emberMetalCore.default.HistoryLocation = _emberRoutingLocationHistory_location.default; + _emberMetalCore.default.NoneLocation = _emberRoutingLocationNone_location.default; - _emberMetalCore["default"].Location = _emberRoutingLocationApi["default"]; - _emberMetalCore["default"].AutoLocation = _emberRoutingLocationAuto_location["default"]; - _emberMetalCore["default"].HashLocation = _emberRoutingLocationHash_location["default"]; - _emberMetalCore["default"].HistoryLocation = _emberRoutingLocationHistory_location["default"]; - _emberMetalCore["default"].NoneLocation = _emberRoutingLocationNone_location["default"]; + _emberMetalCore.default.controllerFor = _emberRoutingSystemController_for.default; + _emberMetalCore.default.generateControllerFactory = _emberRoutingSystemGenerate_controller.generateControllerFactory; + _emberMetalCore.default.generateController = _emberRoutingSystemGenerate_controller.default; + _emberMetalCore.default.RouterDSL = _emberRoutingSystemDsl.default; + _emberMetalCore.default.Router = _emberRoutingSystemRouter.default; + _emberMetalCore.default.Route = _emberRoutingSystemRoute.default; - _emberMetalCore["default"].controllerFor = _emberRoutingSystemController_for["default"]; - _emberMetalCore["default"].generateControllerFactory = _emberRoutingSystemGenerate_controller.generateControllerFactory; - _emberMetalCore["default"].generateController = _emberRoutingSystemGenerate_controller["default"]; - _emberMetalCore["default"].RouterDSL = _emberRoutingSystemDsl["default"]; - _emberMetalCore["default"].Router = _emberRoutingSystemRouter["default"]; - _emberMetalCore["default"].Route = _emberRoutingSystemRoute["default"]; - - exports["default"] = _emberMetalCore["default"]; + exports.default = _emberMetalCore.default; }); +/** +@module ember +@submodule ember-routing +*/ // ES6TODO: Cleanup modules with side-effects below -enifed("ember-routing/ext/controller", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/computed", "ember-metal/utils", "ember-metal/merge", "ember-runtime/mixins/controller"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalUtils, _emberMetalMerge, _emberRuntimeMixinsController) { - "use strict"; +enifed('ember-routing/ext/controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/mixins/controller'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeMixinsController) { /** @module ember @submodule ember-routing */ - _emberRuntimeMixinsController["default"].reopen({ + _emberRuntimeMixinsController.default.reopen({ concatenatedProperties: ['queryParams'], - init: function () { - this._super.apply(this, arguments); - listenForQueryParamChanges(this); - }, - /** Defines which query parameters the controller accepts. If you give the names ['category','page'] it will bind the values of these query parameters to the variables `this.category` and `this.page` @@ -25096,145 +22388,25 @@ /** @property _qpDelegate @private */ - _qpDelegate: null, + _qpDelegate: null, // set by route /** - @property _normalizedQueryParams - @private - */ - _normalizedQueryParams: _emberMetalComputed.computed(function () { - var m = _emberMetalUtils.meta(this); - if (m.proto !== this) { - return _emberMetalProperty_get.get(m.proto, '_normalizedQueryParams'); - } - - var queryParams = _emberMetalProperty_get.get(this, 'queryParams'); - if (queryParams._qpMap) { - return queryParams._qpMap; - } - - var qpMap = queryParams._qpMap = {}; - - for (var i = 0, len = queryParams.length; i < len; ++i) { - accumulateQueryParamDescriptors(queryParams[i], qpMap); - } - - return qpMap; - }), - - /** - @property _cacheMeta - @private - */ - _cacheMeta: _emberMetalComputed.computed(function () { - var m = _emberMetalUtils.meta(this); - if (m.proto !== this) { - return _emberMetalProperty_get.get(m.proto, '_cacheMeta'); - } - - var cacheMeta = {}; - var qpMap = _emberMetalProperty_get.get(this, '_normalizedQueryParams'); - for (var prop in qpMap) { - if (!qpMap.hasOwnProperty(prop)) { - continue; - } - - var qp = qpMap[prop]; - var scope = qp.scope; - var parts; - - if (scope === 'controller') { - parts = []; - } - - cacheMeta[prop] = { - parts: parts, // provided by route if 'model' scope - values: null, // provided by route - scope: scope, - prefix: "", - def: _emberMetalProperty_get.get(this, prop) - }; - } - - return cacheMeta; - }), - - /** - @method _updateCacheParams - @private - */ - _updateCacheParams: function (params) { - var cacheMeta = _emberMetalProperty_get.get(this, '_cacheMeta'); - for (var prop in cacheMeta) { - if (!cacheMeta.hasOwnProperty(prop)) { - continue; - } - var propMeta = cacheMeta[prop]; - propMeta.values = params; - - var cacheKey = this._calculateCacheKey(propMeta.prefix, propMeta.parts, propMeta.values); - var cache = this._bucketCache; - - if (cache) { - var value = cache.lookup(cacheKey, prop, propMeta.def); - _emberMetalProperty_set.set(this, prop, value); - } - } - }, - - /** @method _qpChanged @private */ _qpChanged: function (controller, _prop) { var prop = _prop.substr(0, _prop.length - 3); - var cacheMeta = _emberMetalProperty_get.get(controller, '_cacheMeta'); - var propCache = cacheMeta[prop]; - var cacheKey = controller._calculateCacheKey(propCache.prefix || "", propCache.parts, propCache.values); - var value = _emberMetalProperty_get.get(controller, prop); - // 1. Update model-dep cache - var cache = this._bucketCache; - if (cache) { - controller._bucketCache.stash(cacheKey, prop, value); - } - - // 2. Notify a delegate (e.g. to fire a qp transition) var delegate = controller._qpDelegate; - if (delegate) { - delegate(controller, prop); - } + var value = _emberMetalProperty_get.get(controller, prop); + delegate(prop, value); }, /** - @method _calculateCacheKey - @private - */ - _calculateCacheKey: function (prefix, _parts, values) { - var parts = _parts || []; - var suffixes = ''; - for (var i = 0, len = parts.length; i < len; ++i) { - var part = parts[i]; - var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part); - var value; - if (values) { - if (cacheValuePrefix && cacheValuePrefix in values) { - var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part; - value = _emberMetalProperty_get.get(values[cacheValuePrefix], partRemovedPrefix); - } else { - value = _emberMetalProperty_get.get(values, part); - } - } - suffixes += '::' + part + ':' + value; - } - return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-'); - }, - - /** Transition the application into another route. The route may be either a single route or route path: ```javascript aController.transitionToRoute('blogPosts'); aController.transitionToRoute('blogPosts.recentEntries'); @@ -25250,15 +22422,15 @@ hook of the route will be triggered: ```javascript aController.transitionToRoute('blogPost', 1); ``` Multiple models will be applied last to first recursively up the - resource tree. + route tree. ```javascript App.Router.map(function() { - this.resource('blogPost', {path:':blogPostId'}, function() { - this.resource('blogComment', {path: ':blogCommentId'}); + this.route('blogPost', { path: ':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); }); }); aController.transitionToRoute('blogComment', aPost, aComment); aController.transitionToRoute('blogComment', 1, 13); ``` @@ -25325,15 +22497,15 @@ hook of the route will be triggered: ```javascript aController.replaceRoute('blogPost', 1); ``` Multiple models will be applied last to first recursively up the - resource tree. + route tree. ```javascript App.Router.map(function() { - this.resource('blogPost', {path:':blogPostId'}, function() { - this.resource('blogComment', {path: ':blogCommentId'}); + this.route('blogPost', { path: ':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); }); }); aController.replaceRoute('blogComment', aPost, aComment); aController.replaceRoute('blogComment', 1, 13); ``` @@ -25367,104 +22539,41 @@ replaceWith: function () { return this.replaceRoute.apply(this, arguments); } }); - var ALL_PERIODS_REGEX = /\./g; - - function accumulateQueryParamDescriptors(_desc, accum) { - var desc = _desc; - var tmp; - if (typeof desc === 'string') { - tmp = {}; - tmp[desc] = { as: null }; - desc = tmp; - } - - for (var key in desc) { - if (!desc.hasOwnProperty(key)) { - return; - } - - var singleDesc = desc[key]; - if (typeof singleDesc === 'string') { - singleDesc = { as: singleDesc }; - } - - tmp = accum[key] || { as: null, scope: 'model' }; - _emberMetalMerge["default"](tmp, singleDesc); - - accum[key] = tmp; - } - } - - function listenForQueryParamChanges(controller) { - var qpMap = _emberMetalProperty_get.get(controller, '_normalizedQueryParams'); - for (var prop in qpMap) { - if (!qpMap.hasOwnProperty(prop)) { - continue; - } - controller.addObserver(prop + '.[]', controller, controller._qpChanged); - } - } - - function _calculateCacheValuePrefix(prefix, part) { - // calculates the dot seperated sections from prefix that are also - // at the start of part - which gives us the route name - - // given : prefix = site.article.comments, part = site.article.id - // - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below) - - // given : prefix = site.article, part = site.article.id - // - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below) - - var prefixParts = prefix.split('.'); - var currPrefix = ''; - for (var i = 0, len = prefixParts.length; i < len; i++) { - var currPart = prefixParts.slice(0, i + 1).join('.'); - if (part.indexOf(currPart) !== 0) { - break; - } - currPrefix = currPart; - } - return currPrefix; - } - - exports["default"] = _emberRuntimeMixinsController["default"]; + exports.default = _emberRuntimeMixinsController.default; }); // FEATURES, deprecate enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { - 'use strict'; /** @module ember @submodule ember-views */ // Add a new named queue after the 'actions' queue (where RSVP promises // resolve), which is used in router transitions to prevent unnecessary // loading state entry if all context promises resolve on the // 'actions' queue first. - _emberMetalRun_loop["default"]._addQueue('routerTransitions', 'actions'); + _emberMetalRun_loop.default._addQueue('routerTransitions', 'actions'); }); -enifed("ember-routing/initializers/routing-service", ["exports", "ember-runtime/system/lazy_load", "ember-routing/services/routing"], function (exports, _emberRuntimeSystemLazy_load, _emberRoutingServicesRouting) { - "use strict"; +enifed('ember-routing/initializers/routing-service', ['exports', 'ember-runtime/system/lazy_load', 'ember-routing/services/routing'], function (exports, _emberRuntimeSystemLazy_load, _emberRoutingServicesRouting) { _emberRuntimeSystemLazy_load.onLoad('Ember.Application', function (Application) { Application.initializer({ name: 'routing-service', initialize: function (registry) { // Register the routing service... - registry.register('service:-routing', _emberRoutingServicesRouting["default"]); + registry.register('service:-routing', _emberRoutingServicesRouting.default); // Then inject the app router into it registry.injection('service:-routing', 'router', 'router:main'); } }); }); }); -enifed("ember-routing/location/api", ["exports", "ember-metal/core", "ember-metal/environment", "ember-routing/location/util"], function (exports, _emberMetalCore, _emberMetalEnvironment, _emberRoutingLocationUtil) { - "use strict"; +enifed('ember-routing/location/api', ['exports', 'ember-metal/core', 'ember-metal/environment', 'ember-routing/location/util'], function (exports, _emberMetalCore, _emberMetalEnvironment, _emberRoutingLocationUtil) { /** @module ember @submodule ember-routing */ @@ -25486,11 +22595,11 @@ Example: ```javascript App.Router.map(function() { - this.resource('posts', function() { + this.route('posts', function() { this.route('new'); }); }); App.Router.reopen({ @@ -25507,11 +22616,11 @@ Example: ```javascript App.Router.map(function() { - this.resource('posts', function() { + this.route('posts', function() { this.route('new'); }); }); App.Router.reopen({ @@ -25535,11 +22644,11 @@ Example: ```javascript App.Router.map(function() { - this.resource('posts', function() { + this.route('posts', function() { this.route('new'); }); }); App.Router.reopen({ @@ -25584,11 +22693,11 @@ @class Location @namespace Ember @static @private */ - exports["default"] = { + exports.default = { /** This is deprecated in favor of using the container to lookup the location implementation as desired. For example: ```javascript @@ -25635,11 +22744,11 @@ this.implementations[name] = implementation; }, implementations: {}, - _location: _emberMetalEnvironment["default"].location, + _location: _emberMetalEnvironment.default.location, /** Returns the current `location.hash` by parsing location.href since browsers inconsistently URL-decode `location.hash`. https://bugzilla.mozilla.org/show_bug.cgi?id=483304 @@ -25651,13 +22760,11 @@ return _emberRoutingLocationUtil.getHash(this.location); } }; }); // deprecate, assert -enifed("ember-routing/location/auto_location", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/utils", "ember-runtime/system/object", "ember-metal/environment", "ember-routing/location/util"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberRuntimeSystemObject, _emberMetalEnvironment, _emberRoutingLocationUtil) { - "use strict"; - +enifed('ember-routing/location/auto_location', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-runtime/system/object', 'ember-metal/environment', 'ember-routing/location/util'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberRuntimeSystemObject, _emberMetalEnvironment, _emberRoutingLocationUtil) { exports.getHistoryPath = getHistoryPath; exports.getHashPath = getHashPath; /** @module ember @@ -25677,48 +22784,48 @@ @class AutoLocation @namespace Ember @static @private */ - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ /** @private The browser's `location` object. This is typically equivalent to `window.location`, but may be overridden for testing. @property location @default environment.location */ - location: _emberMetalEnvironment["default"].location, + location: _emberMetalEnvironment.default.location, /** @private The browser's `history` object. This is typically equivalent to `window.history`, but may be overridden for testing. @since 1.5.1 @property history @default environment.history */ - history: _emberMetalEnvironment["default"].history, + history: _emberMetalEnvironment.default.history, /** @private The user agent's global variable. In browsers, this will be `window`. @since 1.11 @property global @default environment.global */ - global: _emberMetalEnvironment["default"].global, + global: _emberMetalEnvironment.default.global, /** @private The browser's `userAgent`. This is typically equivalent to `navigator.userAgent`, but may be overridden for testing. @since 1.5.1 @property userAgent @default environment.history */ - userAgent: _emberMetalEnvironment["default"].userAgent, + userAgent: _emberMetalEnvironment.default.userAgent, /** @private This property is used by the router to know whether to cancel the routing setup process, which is needed while we redirect the browser. @@ -25759,11 +22866,11 @@ if (implementation === false) { _emberMetalProperty_set.set(this, 'cancelRouterSetup', true); implementation = 'none'; } - var concrete = this.container.lookup("location:" + implementation); + var concrete = this.container.lookup('location:' + implementation); _emberMetalProperty_set.set(concrete, 'rootURL', rootURL); _emberMetalProperty_set.set(this, 'concreteImplementation', concrete); }, @@ -25894,11 +23001,11 @@ // This is the "expected" final order path = path + routeHash + query; if (hashParts.length) { - path += "#" + hashParts.join('#'); + path += '#' + hashParts.join('#'); } } else { path = path + query + hash; } @@ -25929,12 +23036,11 @@ return path; } }); // FEATURES -enifed("ember-routing/location/hash_location", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/run_loop", "ember-metal/utils", "ember-runtime/system/object", "ember-routing/location/api"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalRun_loop, _emberMetalUtils, _emberRuntimeSystemObject, _emberRoutingLocationApi) { - "use strict"; +enifed('ember-routing/location/hash_location', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/run_loop', 'ember-metal/utils', 'ember-runtime/system/object', 'ember-routing/location/api'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalRun_loop, _emberMetalUtils, _emberRuntimeSystemObject, _emberRoutingLocationApi) { /** @module ember @submodule ember-routing */ @@ -25947,11 +23053,11 @@ @class HashLocation @namespace Ember @extends Ember.Object @private */ - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ implementation: 'hash', init: function () { _emberMetalProperty_set.set(this, 'location', _emberMetalProperty_get.get(this, '_location') || window.location); }, @@ -25960,11 +23066,11 @@ @private Returns normalized location.hash @since 1.5.1 @method getHash */ - getHash: _emberRoutingLocationApi["default"]._getHash, + getHash: _emberRoutingLocationApi.default._getHash, /** Returns the normalized URL, constructed from `location.hash`. e.g. `#/foo` => `/foo` as well as `#/foo#bar` => `/foo#bar`. By convention, hashed paths must begin with a forward slash, otherwise they @@ -25982,11 +23088,11 @@ // Only add the # if the path isn't empty. // We do NOT want `/#` since the ampersand // is only included (conventionally) when // the location.hash has a value if (originalPath) { - outPath += "#" + originalPath; + outPath += '#' + originalPath; } } return outPath; }, @@ -26010,11 +23116,11 @@ @private @method replaceURL @param path {String} */ replaceURL: function (path) { - _emberMetalProperty_get.get(this, 'location').replace("#" + path); + _emberMetalProperty_get.get(this, 'location').replace('#' + path); _emberMetalProperty_set.set(this, 'lastSetURL', path); }, /** Register a callback to be invoked when the hash changes. These @@ -26027,12 +23133,12 @@ onUpdateURL: function (callback) { var _this = this; var guid = _emberMetalUtils.guidFor(this); - _emberMetalCore["default"].$(window).on("hashchange.ember-location-" + guid, function () { - _emberMetalRun_loop["default"](function () { + _emberMetalCore.default.$(window).on('hashchange.ember-location-' + guid, function () { + _emberMetalRun_loop.default(function () { var path = _this.getURL(); if (_emberMetalProperty_get.get(_this, 'lastSetURL') === path) { return; } @@ -26051,27 +23157,26 @@ @private @method formatURL @param url {String} */ formatURL: function (url) { - return "#" + url; + return '#' + url; }, /** Cleans up the HashLocation event listener. @private @method willDestroy */ willDestroy: function () { var guid = _emberMetalUtils.guidFor(this); - _emberMetalCore["default"].$(window).off("hashchange.ember-location-" + guid); + _emberMetalCore.default.$(window).off('hashchange.ember-location-' + guid); } }); }); -enifed("ember-routing/location/history_location", ["exports", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/utils", "ember-runtime/system/object", "ember-routing/location/api", "ember-views/system/jquery"], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberRuntimeSystemObject, _emberRoutingLocationApi, _emberViewsSystemJquery) { - "use strict"; +enifed('ember-routing/location/history_location', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-runtime/system/object', 'ember-routing/location/api', 'ember-views/system/jquery'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberRuntimeSystemObject, _emberRoutingLocationApi, _emberViewsSystemJquery) { /** @module ember @submodule ember-routing */ @@ -26085,16 +23190,16 @@ @class HistoryLocation @namespace Ember @extends Ember.Object @private */ - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ implementation: 'history', init: function () { _emberMetalProperty_set.set(this, 'location', _emberMetalProperty_get.get(this, 'location') || window.location); - _emberMetalProperty_set.set(this, 'baseURL', _emberViewsSystemJquery["default"]('base').attr('href') || ''); + _emberMetalProperty_set.set(this, 'baseURL', _emberViewsSystemJquery.default('base').attr('href') || ''); }, /** Used to set state on first call to setURL @private @@ -26234,11 +23339,11 @@ onUpdateURL: function (callback) { var _this = this; var guid = _emberMetalUtils.guidFor(this); - _emberViewsSystemJquery["default"](window).on("popstate.ember-location-" + guid, function (e) { + _emberViewsSystemJquery.default(window).on('popstate.ember-location-' + guid, function (e) { // Ignore initial page load popstate event in Chrome if (!popstateFired) { popstateFired = true; if (_this.getURL() === _this._previousURL) { return; @@ -26275,23 +23380,22 @@ @method willDestroy */ willDestroy: function () { var guid = _emberMetalUtils.guidFor(this); - _emberViewsSystemJquery["default"](window).off("popstate.ember-location-" + guid); + _emberViewsSystemJquery.default(window).off('popstate.ember-location-' + guid); }, /** @private Returns normalized location.hash @method getHash */ - getHash: _emberRoutingLocationApi["default"]._getHash + getHash: _emberRoutingLocationApi.default._getHash }); }); -enifed("ember-routing/location/none_location", ["exports", "ember-metal/property_get", "ember-metal/property_set", "ember-runtime/system/object"], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemObject) { - "use strict"; +enifed('ember-routing/location/none_location', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/object'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemObject) { /** @module ember @submodule ember-routing */ @@ -26305,11 +23409,11 @@ @class NoneLocation @namespace Ember @extends Ember.Object @private */ - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ implementation: 'none', path: '', /** Returns the current path. @@ -26372,25 +23476,23 @@ return url; } }); }); enifed('ember-routing/location/util', ['exports'], function (exports) { - /** - @private - - Returns the current `location.pathname`, normalized for IE inconsistencies. - */ - 'use strict'; - exports.getPath = getPath; exports.getQuery = getQuery; exports.getHash = getHash; exports.getFullPath = getFullPath; exports.getOrigin = getOrigin; exports.supportsHashChange = supportsHashChange; exports.supportsHistory = supportsHistory; exports.replacePath = replacePath; + /** + @private + + Returns the current `location.pathname`, normalized for IE inconsistencies. + */ function getPath(location) { var pathname = location.pathname; // Various versions of IE/Opera don't always return a leading slash if (pathname.charAt(0) !== '/') { @@ -26498,18 +23600,12 @@ function replacePath(location, path) { location.replace(getOrigin(location) + path); } }); -enifed("ember-routing/services/routing", ["exports", "ember-runtime/system/service", "ember-metal/property_get", "ember-metal/computed_macros", "ember-routing/utils", "ember-metal/keys", "ember-metal/merge"], function (exports, _emberRuntimeSystemService, _emberMetalProperty_get, _emberMetalComputed_macros, _emberRoutingUtils, _emberMetalKeys, _emberMetalMerge) { - /** - @module ember - @submodule ember-routing - */ +enifed('ember-routing/services/routing', ['exports', 'ember-runtime/system/service', 'ember-metal/property_get', 'ember-metal/computed_macros', 'ember-routing/utils', 'ember-metal/merge'], function (exports, _emberRuntimeSystemService, _emberMetalProperty_get, _emberMetalComputed_macros, _emberRoutingUtils, _emberMetalMerge) { - "use strict"; - /** The Routing service is used by LinkComponent, and provides facilities for the component/view layer to interact with the router. While still private, this service can eventually be opened up, and provides @@ -26517,19 +23613,19 @@ with router internals. @private @class RoutingService */ - var RoutingService = _emberRuntimeSystemService["default"].extend({ + exports.default = _emberRuntimeSystemService.default.extend({ router: null, targetState: _emberMetalComputed_macros.readOnly('router.targetState'), currentState: _emberMetalComputed_macros.readOnly('router.currentState'), currentRouteName: _emberMetalComputed_macros.readOnly('router.currentRouteName'), availableRoutes: function () { - return _emberMetalKeys["default"](_emberMetalProperty_get.get(this, 'router').router.recognizer.names); + return Object.keys(_emberMetalProperty_get.get(this, 'router').router.recognizer.names); }, hasRoute: function (routeName) { return _emberMetalProperty_get.get(this, 'router').hasRoute(routeName); }, @@ -26543,21 +23639,22 @@ transition.method('replace'); } }, normalizeQueryParams: function (routeName, models, queryParams) { - _emberMetalProperty_get.get(this, 'router')._prepareQueryParams(routeName, models, queryParams); + var router = _emberMetalProperty_get.get(this, 'router'); + router._prepareQueryParams(routeName, models, queryParams); }, generateURL: function (routeName, models, queryParams) { var router = _emberMetalProperty_get.get(this, 'router'); if (!router.router) { return; } var visibleQueryParams = {}; - _emberMetalMerge["default"](visibleQueryParams, queryParams); + _emberMetalMerge.default(visibleQueryParams, queryParams); this.normalizeQueryParams(routeName, models, visibleQueryParams); var args = _emberRoutingUtils.routeArgs(routeName, models, visibleQueryParams); return router.generate.apply(router, args); @@ -26586,28 +23683,28 @@ return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified); } }); - var numberOfContextsAcceptedByHandler = function (handler, handlerInfos) { + function numberOfContextsAcceptedByHandler(handler, handlerInfos) { var req = 0; for (var i = 0, l = handlerInfos.length; i < l; i++) { req = req + handlerInfos[i].names.length; if (handlerInfos[i].handler === handler) { break; } } return req; - }; - - exports["default"] = RoutingService; + } }); -enifed("ember-routing/system/cache", ["exports", "ember-runtime/system/object"], function (exports, _emberRuntimeSystemObject) { - "use strict"; - - exports["default"] = _emberRuntimeSystemObject["default"].extend({ +/** +@module ember +@submodule ember-routing +*/ +enifed('ember-routing/system/cache', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + exports.default = _emberRuntimeSystemObject.default.extend({ init: function () { this.cache = {}; }, has: function (bucketKey) { return bucketKey in this.cache; @@ -26633,10 +23730,11 @@ }, cache: null }); }); enifed("ember-routing/system/controller_for", ["exports"], function (exports) { + exports.default = controllerFor; /** @module ember @submodule ember-routing */ @@ -26646,20 +23744,16 @@ @for Ember @method controllerFor @private */ - "use strict"; - exports["default"] = controllerFor; - function controllerFor(container, controllerName, lookupOptions) { return container.lookup("controller:" + controllerName, lookupOptions); } }); -enifed("ember-routing/system/dsl", ["exports", "ember-metal/core", "ember-metal/array"], function (exports, _emberMetalCore, _emberMetalArray) { - "use strict"; +enifed('ember-routing/system/dsl', ['exports', 'ember-metal/core', 'ember-metal/features'], function (exports, _emberMetalCore, _emberMetalFeatures) { /** @module ember @submodule ember-routing */ @@ -26667,32 +23761,29 @@ function DSL(name, options) { this.parent = name; this.enableLoadingSubstates = options && options.enableLoadingSubstates; this.matches = []; } - exports["default"] = DSL; + exports.default = DSL; DSL.prototype = { route: function (name, options, callback) { - var dummyErrorRoute = "/_unused_dummy_error_path_route_" + name + "/:error"; + var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; if (arguments.length === 2 && typeof options === 'function') { callback = options; options = {}; } if (arguments.length === 1) { options = {}; } - var type = options.resetNamespace === true ? 'resource' : 'route'; - - if (this.enableLoadingSubstates) { - createRoute(this, name + "_loading", { resetNamespace: options.resetNamespace }); - createRoute(this, name + "_error", { path: dummyErrorRoute }); - } - + if (this.enableLoadingSubstates) { + createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); + createRoute(this, name + '_error', { path: dummyErrorRoute }); + } if (callback) { var fullName = getFullName(this, name, options.resetNamespace); var dsl = new DSL(fullName, { enableLoadingSubstates: this.enableLoadingSubstates @@ -26709,11 +23800,11 @@ } }, push: function (url, name, callback) { var parts = name.split('.'); - if (url === "" || url === "/" || parts[parts.length - 1] === "index") { + if (url === '' || url === '/' || parts[parts.length - 1] === 'index') { this.explicitIndex = true; } this.matches.push([url, name, callback]); }, @@ -26727,18 +23818,18 @@ if (arguments.length === 1) { options = {}; } options.resetNamespace = true; - this.route(name, options, callback); + this.route(name, options, callback); }, generate: function () { var dslMatches = this.matches; if (!this.explicitIndex) { - this.route("index", { path: "/" }); + this.route('index', { path: '/' }); } return function (match) { for (var i = 0, l = dslMatches.length; i < l; i++) { var dslMatch = dslMatches[i]; @@ -26752,11 +23843,11 @@ return dsl.parent && dsl.parent !== 'application'; } function getFullName(dsl, name, resetNamespace) { if (canNest(dsl) && resetNamespace !== true) { - return dsl.parent + "." + name; + return dsl.parent + '.' + name; } else { return name; } } @@ -26764,11 +23855,11 @@ options = options || {}; var fullName = getFullName(dsl, name, options.resetNamespace); if (typeof options.path !== 'string') { - options.path = "/" + name; + options.path = '/' + name; } dsl.push(options.path, fullName, callback); } @@ -26777,15 +23868,13 @@ callback.call(dsl); return dsl; }; }); // FEATURES, assert -enifed("ember-routing/system/generate_controller", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-runtime/utils"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeUtils) { - "use strict"; - +enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/utils'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeUtils) { exports.generateControllerFactory = generateControllerFactory; - exports["default"] = generateController; + exports.default = generateController; /** @module ember @submodule ember-routing */ @@ -26793,15 +23882,13 @@ /** Generates a controller factory The type of the generated controller factory is derived from the context. If the context is an array an array controller - is generated, if an object, an object controller otherwise, a basic - controller is generated. + is generated, otherwise, a basic controller is generated. - You can customize your generated controllers by defining - `App.ObjectController` or `App.ArrayController`. + You can customize your generated controllers by defining `App.ArrayController`. @for Ember @method generateControllerFactory @private */ @@ -26809,26 +23896,24 @@ function generateControllerFactory(container, controllerName, context) { var Factory, fullName, factoryName, controllerType; if (context && _emberRuntimeUtils.isArray(context)) { controllerType = 'array'; - } else if (context) { - controllerType = 'object'; } else { controllerType = 'basic'; } - factoryName = "controller:" + controllerType; + factoryName = 'controller:' + controllerType; Factory = container.lookupFactory(factoryName).extend({ isGenerated: true, toString: function () { - return "(generated " + controllerName + " controller)"; + return '(generated ' + controllerName + ' controller)'; } }); - fullName = "controller:" + controllerName; + fullName = 'controller:' + controllerName; container._registry.register(fullName, Factory); return Factory; } @@ -26847,31 +23932,29 @@ @since 1.3.0 */ function generateController(container, controllerName, context) { generateControllerFactory(container, controllerName, context); - var fullName = "controller:" + controllerName; + + var fullName = 'controller:' + controllerName; var instance = container.lookup(fullName); if (_emberMetalProperty_get.get(instance, 'namespace.LOG_ACTIVE_GENERATION')) { - _emberMetalCore["default"].Logger.info("generated -> " + fullName, { fullName: fullName }); + _emberMetalCore.default.Logger.info('generated -> ' + fullName, { fullName: fullName }); } return instance; } }); // Logger enifed('ember-routing/system/query_params', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { - 'use strict'; - - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ isQueryParams: true, values: null }); }); -enifed("ember-routing/system/route", ["exports", "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/merge", "ember-runtime/utils", "ember-metal/run_loop", "ember-metal/keys", "ember-runtime/copy", "ember-runtime/system/string", "ember-runtime/system/object", "ember-runtime/mixins/evented", "ember-runtime/mixins/action_handler", "ember-routing/system/generate_controller", "ember-routing/utils"], function (exports, _emberMetalCore, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalGet_properties, _emberMetalEnumerable_utils, _emberMetalIs_none, _emberMetalComputed, _emberMetalMerge, _emberRuntimeUtils, _emberMetalRun_loop, _emberMetalKeys, _emberRuntimeCopy, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRuntimeMixinsAction_handler, _emberRoutingSystemGenerate_controller, _emberRoutingUtils) { - "use strict"; +enifed('ember-routing/system/route', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/get_properties', 'ember-metal/is_none', 'ember-metal/computed', 'ember-metal/merge', 'ember-runtime/utils', 'ember-metal/run_loop', 'ember-runtime/copy', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/action_handler', 'ember-routing/system/generate_controller', 'ember-routing/utils'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalGet_properties, _emberMetalIs_none, _emberMetalComputed, _emberMetalMerge, _emberRuntimeUtils, _emberMetalRun_loop, _emberRuntimeCopy, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRuntimeMixinsAction_handler, _emberRoutingSystemGenerate_controller, _emberRoutingUtils) { var slice = Array.prototype.slice; function K() { return this; @@ -26891,11 +23974,11 @@ @extends Ember.Object @uses Ember.ActionHandler @uses Ember.Evented @public */ - var Route = _emberRuntimeSystemObject["default"].extend(_emberRuntimeMixinsAction_handler["default"], _emberRuntimeMixinsEvented["default"], { + var Route = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsAction_handler.default, _emberRuntimeMixinsEvented.default, { /** Configuration hash for this route's queryParams. The possible configuration options and their defaults are as follows (assuming a query param whose controller property is `page`): ```javascript @@ -26939,67 +24022,126 @@ @property _qp */ _qp: _emberMetalComputed.computed(function () { var _this = this; + var controllerProto, combinedQueryParameterConfiguration; + var controllerName = this.controllerName || this.routeName; - var controllerClass = this.container.lookupFactory("controller:" + controllerName); + var definedControllerClass = this.container.lookupFactory('controller:' + controllerName); + var queryParameterConfiguraton = _emberMetalProperty_get.get(this, 'queryParams'); + var hasRouterDefinedQueryParams = !!Object.keys(queryParameterConfiguraton).length; - if (!controllerClass) { - return defaultQPMeta; + if (definedControllerClass) { + // the developer has authored a controller class in their application for this route + // access the prototype, find its query params and normalize their object shape + // them merge in the query params for the route. As a mergedProperty, Route#queryParams is always + // at least `{}` + controllerProto = definedControllerClass.proto(); + + var controllerDefinedQueryParameterConfiguration = _emberMetalProperty_get.get(controllerProto, 'queryParams'); + var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration); + combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton); + } else if (hasRouterDefinedQueryParams) { + // the developer has not defined a controller but *has* supplied route query params. + // Generate a class for them so we can later insert default values + var generatedControllerClass = _emberRoutingSystemGenerate_controller.generateControllerFactory(this.container, controllerName); + controllerProto = generatedControllerClass.proto(); + combinedQueryParameterConfiguration = queryParameterConfiguraton; } - var controllerProto = controllerClass.proto(); - var qpProps = _emberMetalProperty_get.get(controllerProto, '_normalizedQueryParams'); - var cacheMeta = _emberMetalProperty_get.get(controllerProto, '_cacheMeta'); - var qps = []; var map = {}; - for (var propName in qpProps) { - if (!qpProps.hasOwnProperty(propName)) { + var propertyNames = []; + + for (var propName in combinedQueryParameterConfiguration) { + if (!combinedQueryParameterConfiguration.hasOwnProperty(propName)) { continue; } - var desc = qpProps[propName]; + // to support the dubious feature of using unknownProperty + // on queryParams configuration + if (propName === 'unknownProperty' || propName === '_super') { + // possible todo: issue deprecation warning? + continue; + } + + var desc = combinedQueryParameterConfiguration[propName]; + + var scope = desc.scope || 'model'; + var parts; + + if (scope === 'controller') { + parts = []; + } + var urlKey = desc.as || this.serializeQueryParamKey(propName); var defaultValue = _emberMetalProperty_get.get(controllerProto, propName); - if (_emberRuntimeUtils.isArray(defaultValue)) { - defaultValue = _emberMetalCore["default"].A(defaultValue.slice()); + if (Array.isArray(defaultValue)) { + defaultValue = _emberMetalCore.default.A(defaultValue.slice()); } - var type = _emberRuntimeUtils.typeOf(defaultValue); + var type = desc.type || _emberRuntimeUtils.typeOf(defaultValue); + var defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type); - var fprop = controllerName + ":" + propName; + var scopedPropertyName = controllerName + ':' + propName; var qp = { - def: defaultValue, - sdef: defaultValueSerialized, + undecoratedDefaultValue: _emberMetalProperty_get.get(controllerProto, propName), + defaultValue: defaultValue, + serializedDefaultValue: defaultValueSerialized, + serializedValue: defaultValueSerialized, + type: type, urlKey: urlKey, prop: propName, - fprop: fprop, + scopedPropertyName: scopedPropertyName, ctrl: controllerName, - cProto: controllerProto, - svalue: defaultValueSerialized, - cacheType: desc.scope, route: this, - cacheMeta: cacheMeta[propName] + parts: parts, // provided later when stashNames is called if 'model' scope + values: null, // provided later when setup is called. no idea why. + scope: scope, + prefix: '' }; - map[propName] = map[urlKey] = map[fprop] = qp; + map[propName] = map[urlKey] = map[scopedPropertyName] = qp; qps.push(qp); + propertyNames.push(propName); } return { qps: qps, map: map, + propertyNames: propertyNames, states: { - active: function (controller, prop) { - return _this._activeQPChanged(controller, map[prop]); + /* + Called when a query parameter changes in the URL, this route cares + about that query parameter, but the route is not currently + in the active route hierarchy. + */ + inactive: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); }, - allowOverrides: function (controller, prop) { - return _this._updatingQPChanged(controller, map[prop]); + /* + Called when a query parameter changes in the URL, this route cares + about that query parameter, and the route is currently + in the active route hierarchy. + */ + active: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + return _this._activeQPChanged(map[prop], value); + }, + /* + Called when a value of a query parameter this route handles changes in a controller + and the route is currently in the active route hierarchy. + */ + allowOverrides: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + return _this._updatingQPChanged(map[prop]); } } }; }), @@ -27028,52 +24170,38 @@ var qps = _emberMetalProperty_get.get(this, '_qp.qps'); var len = qps.length; var namePaths = new Array(names.length); for (var a = 0, nlen = names.length; a < nlen; ++a) { - namePaths[a] = handlerInfo.name + "." + names[a]; + namePaths[a] = handlerInfo.name + '.' + names[a]; } for (var i = 0; i < len; ++i) { var qp = qps[i]; - var cacheMeta = qp.cacheMeta; - if (cacheMeta.scope === 'model') { - cacheMeta.parts = namePaths; + if (qp.scope === 'model') { + qp.parts = namePaths; } - cacheMeta.prefix = qp.ctrl; + qp.prefix = qp.ctrl; } }, /** @private - @property _updateSerializedQPValue - */ - _updateSerializedQPValue: function (controller, qp) { - var value = _emberMetalProperty_get.get(controller, qp.prop); - qp.svalue = this.serializeQueryParam(value, qp.urlKey, qp.type); - }, - - /** - @private @property _activeQPChanged */ - _activeQPChanged: function (controller, qp) { - var value = _emberMetalProperty_get.get(controller, qp.prop); - this.router._queuedQPChanges[qp.fprop] = value; - _emberMetalRun_loop["default"].once(this, this._fireQueryParamTransition); + _activeQPChanged: function (qp, value) { + var router = this.router; + router._activeQPChanged(qp.scopedPropertyName, value); }, /** @private @method _updatingQPChanged */ - _updatingQPChanged: function (controller, qp) { + _updatingQPChanged: function (qp) { var router = this.router; - if (!router._qpUpdates) { - router._qpUpdates = {}; - } - router._qpUpdates[qp.urlKey] = true; + router._updatingQPChanged(qp.urlKey); }, mergedProperties: ['events', 'queryParams'], /** @@ -27082,22 +24210,22 @@ @method paramsFor @param {String} name @public */ paramsFor: function (name) { - var route = this.container.lookup("route:" + name); + var route = this.container.lookup('route:' + name); if (!route) { return {}; } var transition = this.router.router.activeTransition; var state = transition ? transition.state : this.router.router.state; var params = {}; - _emberMetalMerge["default"](params, state.params[name]); - _emberMetalMerge["default"](params, getQueryParamsFor(route, state)); + _emberMetalMerge.default(params, state.params[name]); + _emberMetalMerge.default(params, getQueryParamsFor(route, state)); return params; }, /** @@ -27123,11 +24251,11 @@ // can use it to provide serialization specific // to a certain query param. if (defaultValueType === 'array') { return JSON.stringify(value); } - return "" + value; + return '' + value; }, /** Deserializes value of the query parameter based on defaultValueType @method deserializeQueryParam @@ -27146,30 +24274,21 @@ if (defaultValueType === 'boolean') { return value === 'true' ? true : false; } else if (defaultValueType === 'number') { return Number(value).valueOf(); } else if (defaultValueType === 'array') { - return _emberMetalCore["default"].A(JSON.parse(value)); + return _emberMetalCore.default.A(JSON.parse(value)); } return value; }, /** @private - @property _fireQueryParamTransition - */ - _fireQueryParamTransition: function () { - this.transitionTo({ queryParams: this.router._queuedQPChanges }); - this.router._queuedQPChanges = {}; - }, - - /** - @private @property _optionsForQueryParam */ _optionsForQueryParam: function (qp) { - return _emberMetalProperty_get.get(this, "queryParams." + qp.urlKey) || _emberMetalProperty_get.get(this, "queryParams." + qp.prop) || {}; + return _emberMetalProperty_get.get(this, 'queryParams.' + qp.urlKey) || _emberMetalProperty_get.get(this, 'queryParams.' + qp.prop) || {}; }, /** A hook you can use to reset controller values either when the model changes or the route is exiting. @@ -27207,13 +24326,12 @@ @method _reset @since 1.7.0 */ _reset: function (isExiting, transition) { var controller = this.controller; + controller._qpDelegate = _emberMetalProperty_get.get(this, '_qp.states.inactive'); - controller._qpDelegate = null; - this.resetController(controller, isExiting, transition); }, /** @private @@ -27466,19 +24584,19 @@ }); ``` @property controller @type Ember.Controller @since 1.6.0 - @public + @private */ _actions: { queryParamsDidChange: function (changed, totalPresent, removed) { var qpMap = _emberMetalProperty_get.get(this, '_qp').map; - var totalChanged = _emberMetalKeys["default"](changed).concat(_emberMetalKeys["default"](removed)); + var totalChanged = Object.keys(changed).concat(Object.keys(removed)); for (var i = 0, len = totalChanged.length; i < len; ++i) { var qp = qpMap[totalChanged[i]]; if (qp && _emberMetalProperty_get.get(this._optionsForQueryParam(qp), 'refreshModel')) { this.refresh(); } @@ -27523,18 +24641,18 @@ if (presentKey) { svalue = params[presentKey]; value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type); } else { // No QP provided; use default value. - svalue = qp.sdef; - value = copyDefaultValue(qp.def); + svalue = qp.serializedDefaultValue; + value = copyDefaultValue(qp.defaultValue); } } - controller._qpDelegate = null; + controller._qpDelegate = _emberMetalProperty_get.get(route, '_qp.states.inactive'); - var thisQueryParamChanged = svalue !== qp.svalue; + var thisQueryParamChanged = svalue !== qp.serializedValue; if (thisQueryParamChanged) { if (transition.queryParamsOnly && replaceUrl !== false) { var options = route._optionsForQueryParam(qp); var replaceConfigValue = _emberMetalProperty_get.get(options, 'replace'); if (replaceConfigValue) { @@ -27547,13 +24665,13 @@ _emberMetalProperty_set.set(controller, qp.prop, value); } // Stash current serialized value of controller. - qp.svalue = svalue; + qp.serializedValue = svalue; - var thisQueryParamHasDefaultValue = qp.sdef === svalue; + var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue; if (!thisQueryParamHasDefaultValue) { finalParams.push({ value: svalue, visible: true, key: presentKey || qp.urlKey @@ -27563,11 +24681,11 @@ if (replaceUrl) { transition.method('replace'); } - _emberMetalEnumerable_utils.forEach(qpMeta.qps, function (qp) { + qpMeta.qps.forEach(function (qp) { var routeQpMeta = _emberMetalProperty_get.get(qp.route, '_qp'); var finalizedController = qp.route.controller; finalizedController._qpDelegate = _emberMetalProperty_get.get(routeQpMeta, 'states.active'); }); @@ -27617,15 +24735,15 @@ hook of the route will be triggered: ```javascript this.transitionTo('blogPost', 1); ``` Multiple models will be applied last to first recursively up the - resource tree. + route tree. ```javascript App.Router.map(function() { - this.resource('blogPost', { path:':blogPostId' }, function() { - this.resource('blogComment', { path: ':blogCommentId' }); + this.route('blogPost', { path:':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); }); }); this.transitionTo('blogComment', aPost, aComment); this.transitionTo('blogComment', 1, 13); ``` @@ -27667,11 +24785,11 @@ }); ``` Transition to a nested route ```javascript App.Router.map(function() { - this.resource('articles', { path: '/articles' }, function() { + this.route('articles', { path: '/articles' }, function() { this.route('new'); }); }); App.IndexRoute = Ember.Route.extend({ actions: { @@ -27683,12 +24801,12 @@ ``` Multiple Models Example ```javascript App.Router.map(function() { this.route('index'); - this.resource('breakfast', { path: ':breakfastId' }, function() { - this.resource('cereal', { path: ':cerealId' }); + this.route('breakfast', { path: ':breakfastId' }, function() { + this.route('cereal', { path: ':cerealId', resetNamespace: true }); }); }); App.IndexRoute = Ember.Route.extend({ actions: { moveToChocolateCereal: function() { @@ -27700,11 +24818,11 @@ }); ``` Nested Route with Query String Example ```javascript App.Router.map(function() { - this.resource('fruits', function() { + this.route('fruits', function() { this.route('apples'); }); }); App.IndexRoute = Ember.Route.extend({ actions: { @@ -27837,11 +24955,11 @@ send: function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - if (this.router && this.router.router || !_emberMetalCore["default"].testing) { + if (this.router && this.router.router || !_emberMetalCore.default.testing) { var _router; (_router = this.router).send.apply(_router, args); } else { var name = args[0]; @@ -27857,30 +24975,56 @@ This hook is the entry point for router.js @private @method setup */ setup: function (context, transition) { + var controller; + var controllerName = this.controllerName || this.routeName; - var controller = this.controllerFor(controllerName, true); + var definedController = this.controllerFor(controllerName, true); - if (!controller) { + if (!definedController) { controller = this.generateController(controllerName, context); + } else { + controller = definedController; } // Assign the route's controller so that it can more easily be - // referenced in action handlers - this.controller = controller; + // referenced in action handlers. Side effects. Side effects everywhere. + if (!this.controller) { + var propNames = _emberMetalProperty_get.get(this, '_qp.propertyNames'); + addQueryParamsObservers(controller, propNames); + this.controller = controller; + } if (this.setupControllers) { this.setupControllers(controller, context); } else { - var states = _emberMetalProperty_get.get(this, '_qp.states'); + var queryParams = _emberMetalProperty_get.get(this, '_qp'); + + var states = queryParams.states; if (transition) { // Update the model dep values used to calculate cache keys. _emberRoutingUtils.stashParamNames(this.router, transition.state.handlerInfos); - controller._updateCacheParams(transition.params); + + var params = transition.params; + var allParams = queryParams.propertyNames; + var cache = this._bucketCache; + + allParams.forEach(function (prop) { + var aQp = queryParams.map[prop]; + + aQp.values = params; + var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.prefix, aQp.parts, aQp.values); + + if (cache) { + var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); + _emberMetalProperty_set.set(controller, prop, value); + } + }); } + controller._qpDelegate = states.allowOverrides; if (transition) { var qpValues = getQueryParamsFor(this, transition.state); controller.setProperties(qpValues); @@ -27894,10 +25038,28 @@ } else { this.renderTemplate(controller, context); } }, + /* + Called when a query parameter for this route changes, regardless of whether the route + is currently part of the active route hierarchy. This will update the query parameter's + value in the cache so if this route becomes active, the cache value has been updated. + */ + _qpChanged: function (prop, value, qp) { + if (!qp) { + return; + } + + var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.prefix || '', qp.parts, qp.values); + + // Update model-dep cache + var cache = this._bucketCache; + if (cache) { + cache.stash(cacheKey, prop, value); + } + }, /** This hook is the first of the route entry validation hooks called when an attempt is made to transition into a route or one of its children. It is called before `model` and `afterModel`, and is appropriate for cases when: @@ -28032,11 +25194,11 @@ /** A hook you can implement to convert the URL into the model for this route. ```javascript App.Router.map(function() { - this.resource('post', { path: '/posts/:post_id' }); + this.route('post', { path: '/posts/:post_id' }); }); ``` The model for the `post` route is `store.find('post', params.post_id)`. By default, if your route has a dynamic segment ending in `_id`: * The model class is determined from the segment (`post_id`'s @@ -28085,11 +25247,10 @@ will be used as the model for this route. @public */ model: function (params, transition) { var match, name, sawParams, value; - var queryParams = _emberMetalProperty_get.get(this, '_qp.map'); for (var prop in params) { if (prop === 'queryParams' || queryParams && prop in queryParams) { continue; @@ -28101,11 +25262,11 @@ } sawParams = true; } if (!name && sawParams) { - return _emberRuntimeCopy["default"](params); + return _emberRuntimeCopy.default(params); } else if (!name) { if (transition.resolveIndex < 1) { return; } @@ -28155,11 +25316,11 @@ var routeName = this.routeName; var namespace = _emberMetalProperty_get.get(this, 'router.namespace'); return { find: function (name, value) { - var modelClass = container.lookupFactory("model:" + name); + var modelClass = container.lookupFactory('model:' + name); if (!modelClass) { return; } @@ -28173,11 +25334,11 @@ /** A hook you can implement to convert the route's model into parameters for the URL. ```javascript App.Router.map(function() { - this.resource('post', { path: '/posts/:post_id' }); + this.route('post', { path: '/posts/:post_id' }); }); App.PostRoute = Ember.Route.extend({ model: function(params) { // the server returns `{ id: 12 }` return Ember.$.getJSON('/posts/' + params.post_id); @@ -28193,11 +25354,11 @@ If the route has multiple dynamic segments or does not contain '_id', `serialize` will return `Ember.getProperties(model, params)` This method is called when `transitionTo` is called with a context in order to populate the URL. @method serialize - @param {Object} model the route's model + @param {Object} model the routes model @param {Array} params an Array of parameter names for the current route (in the example, `['post_id']`. @return {Object} the serialized parameters @public */ @@ -28214,14 +25375,14 @@ if (params.length === 1) { if (name in model) { object[name] = _emberMetalProperty_get.get(model, name); } else if (/_id$/.test(name)) { - object[name] = _emberMetalProperty_get.get(model, "id"); + object[name] = _emberMetalProperty_get.get(model, 'id'); } } else { - object = _emberMetalGet_properties["default"](model, params); + object = _emberMetalGet_properties.default(model, params); } return object; }, @@ -28246,27 +25407,25 @@ // Implement your custom setup after this.controllerFor('application').set('showingPhotos', true); } }); ``` - This means that your template will get a proxy for the model as its - context, and you can act as though the model itself was the context. The provided controller will be one resolved based on the name of this route. If no explicit controller is defined, Ember will automatically create an appropriate controller for the model. * if the model is an `Ember.Array` (including record arrays from Ember Data), the controller is an `Ember.ArrayController`. - * otherwise, the controller is an `Ember.ObjectController`. + * otherwise, the controller is basic `Ember.Controller`. As an example, consider the router: ```javascript App.Router.map(function() { - this.resource('post', { path: '/posts/:post_id' }); + this.route('post', { path: '/posts/:post_id' }); }); ``` For the `post` route, a controller named `App.PostController` would - be used if it is defined. If it is not defined, an `Ember.ObjectController` + be used if it is defined. If it is not defined, a basic `Ember.Controller` instance would be used. Example ```javascript App.PostRoute = Ember.Route.extend({ setupController: function(controller, model) { @@ -28302,18 +25461,18 @@ @return {Ember.Controller} @public */ controllerFor: function (name, _skipAssert) { var container = this.container; - var route = container.lookup("route:" + name); + var route = container.lookup('route:' + name); var controller; if (route && route.controllerName) { name = route.controllerName; } - controller = container.lookup("controller:" + name); + controller = container.lookup('controller:' + name); // NOTE: We're specifically checking that skipAssert is true, because according // to the old API the second parameter was model. We do not want people who // passed a model to skip the assertion. @@ -28341,11 +25500,11 @@ generateController: function (name, model) { var container = this.container; model = model || this.modelFor(name); - return _emberRoutingSystemGenerate_controller["default"](container, name, model); + return _emberRoutingSystemGenerate_controller.default(container, name, model); }, /** Returns the model of a parent (or any ancestor) route in a route hierarchy. During a transition, all routes @@ -28355,27 +25514,27 @@ it can call `this.modelFor(theNameOfParentRoute)` to retrieve it. Example ```javascript App.Router.map(function() { - this.resource('post', { path: '/post/:post_id' }, function() { - this.resource('comments'); + this.route('post', { path: '/post/:post_id' }, function() { + this.route('comments', { resetNamespace: true }); }); }); App.CommentsRoute = Ember.Route.extend({ afterModel: function() { - this.set('post', this.modelFor('post')); + this.set('post', this.modelFor('post')); } }); ``` @method modelFor @param {String} name the name of the route @return {Object} the model object @public */ modelFor: function (name) { - var route = this.container.lookup("route:" + name); + var route = this.container.lookup('route:' + name); var transition = this.router ? this.router.router.activeTransition : null; // If we are mid-transition, we want to try and look up // resolved parent contexts on the current transitionEvent. if (transition) { @@ -28410,11 +25569,11 @@ }); ``` @method renderTemplate @param {Object} controller the route's controller @param {Object} model the route's model - @public + @private */ renderTemplate: function (controller, model) { this.render(); }, @@ -28424,11 +25583,11 @@ phase of routing (via the `renderTemplate` hook) and later in response to user interaction. For example, given the following minimal router and templates: ```javascript Router.map(function() { - this.resource('photos'); + this.route('photos'); }); ``` ```handlebars <!-- application.hbs --> <div class='something-in-the-app-hbs'> @@ -28478,11 +25637,11 @@ For example: ```javascript // router Router.map(function() { this.route('index'); - this.resource('post', { path: '/posts/:post_id' }); + this.route('post', { path: '/posts/:post_id' }); }); ``` ```javascript // post route PostRoute = App.Route.extend({ @@ -28519,11 +25678,11 @@ @public */ render: function (_name, options) { var namePassed = typeof _name === 'string' && !!_name; - var isDefaultRender = arguments.length === 0 || _emberMetalCore["default"].isEmpty(arguments[0]); + var isDefaultRender = arguments.length === 0 || _emberMetalCore.default.isEmpty(arguments[0]); var name; if (typeof _name === 'object' && !options) { name = this.routeName; options = _name; @@ -28531,11 +25690,11 @@ name = _name; } var renderOptions = buildRenderOptions(this, namePassed, isDefaultRender, name, options); this.connections.push(renderOptions); - _emberMetalRun_loop["default"].once(this.router, '_setOutlets'); + _emberMetalRun_loop.default.once(this.router, '_setOutlets'); }, /** Disconnects a view that has been rendered into an outlet. You may pass any or all of the following options to `disconnectOutlet`: @@ -28573,11 +25732,11 @@ @private */ disconnectOutlet: function (options) { var outletName; var parentView; - if (!options || typeof options === "string") { + if (!options || typeof options === 'string') { outletName = options; } else { outletName = options.outlet; parentView = options.parentView; } @@ -28610,11 +25769,11 @@ this.connections[i] = { into: connection.into, outlet: connection.outlet, name: connection.name }; - _emberMetalRun_loop["default"].once(this.router, '_setOutlets'); + _emberMetalRun_loop.default.once(this.router, '_setOutlets'); } } }, willDestroy: function () { @@ -28626,25 +25785,19 @@ @method teardownViews */ teardownViews: function () { if (this.connections && this.connections.length > 0) { this.connections = []; - _emberMetalRun_loop["default"].once(this.router, '_setOutlets'); + _emberMetalRun_loop.default.once(this.router, '_setOutlets'); } } }); Route.reopenClass({ isRouteFactory: true }); - var defaultQPMeta = { - qps: [], - map: {}, - states: {} - }; - function parentRoute(route) { var handlerInfo = handlerInfoFor(route, route.router.router.state.handlerInfos, -1); return handlerInfo && handlerInfo.handler; } @@ -28681,35 +25834,35 @@ templateName = route.templateName || name; } if (!controller) { if (namePassed) { - controller = route.container.lookup("controller:" + name) || route.controllerName || route.routeName; + controller = route.container.lookup('controller:' + name) || route.controllerName || route.routeName; } else { - controller = route.controllerName || route.container.lookup("controller:" + name); + controller = route.controllerName || route.container.lookup('controller:' + name); } } if (typeof controller === 'string') { var controllerName = controller; - controller = route.container.lookup("controller:" + controllerName); + controller = route.container.lookup('controller:' + controllerName); if (!controller) { - throw new _emberMetalError["default"]("You passed `controller: '" + controllerName + "'` into the `render` method, but no such controller could be found."); + throw new _emberMetalError.default('You passed `controller: \'' + controllerName + '\'` into the `render` method, but no such controller could be found.'); } } if (options && options.model) { controller.set('model', options.model); } viewName = options && options.view || namePassed && name || route.viewName || name; - ViewClass = route.container.lookupFactory("view:" + viewName); - template = route.container.lookup("template:" + templateName); + ViewClass = route.container.lookupFactory('view:' + viewName); + template = route.container.lookup('template:' + templateName); if (!ViewClass && !template) { if (LOG_VIEW_LOOKUPS) { - var fullName = "template:" + name; - _emberMetalCore["default"].Logger.info("Could not find \"" + name + "\" template or view. Nothing will be rendered", { fullName: fullName }); + var fullName = 'template:' + name; + _emberMetalCore.default.Logger.info('Could not find "' + name + '" template or view. Nothing will be rendered', { fullName: fullName }); } } var parent; if (into && (parent = parentRoute(route)) && into === parentRoute(route).routeName) { @@ -28732,11 +25885,11 @@ if (state.fullQueryParams) { return state.fullQueryParams; } state.fullQueryParams = {}; - _emberMetalMerge["default"](state.fullQueryParams, state.queryParams); + _emberMetalMerge.default(state.fullQueryParams, state.queryParams); var targetRouteName = state.handlerInfos[state.handlerInfos.length - 1].name; router._deserializeQueryParams(targetRouteName, state.fullQueryParams); return state.fullQueryParams; } @@ -28759,29 +25912,90 @@ for (var i = 0, len = qps.length; i < len; ++i) { // Put deserialized qp on params hash. var qp = qps[i]; var qpValueWasPassedIn = (qp.prop in fullQueryParams); - params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.def); + params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue); } return params; } function copyDefaultValue(value) { - if (_emberRuntimeUtils.isArray(value)) { - return _emberMetalCore["default"].A(value.slice()); + if (Array.isArray(value)) { + return _emberMetalCore.default.A(value.slice()); } return value; } - exports["default"] = Route; + /* + Merges all query parameters from a controller with those from + a route, returning a new object and avoiding any mutations to + the existing objects. + */ + function mergeEachQueryParams(controllerQP, routeQP) { + var keysAlreadyMergedOrSkippable; + var qps = {}; + + keysAlreadyMergedOrSkippable = { + defaultValue: true, + type: true, + scope: true, + as: true + }; + + // first loop over all controller qps, merging them with any matching route qps + // into a new empty object to avoid mutating. + for (var cqpName in controllerQP) { + if (!controllerQP.hasOwnProperty(cqpName)) { + continue; + } + + var newControllerParameterConfiguration = {}; + _emberMetalMerge.default(newControllerParameterConfiguration, controllerQP[cqpName]); + _emberMetalMerge.default(newControllerParameterConfiguration, routeQP[cqpName]); + + qps[cqpName] = newControllerParameterConfiguration; + + // allows us to skip this QP when we check route QPs. + keysAlreadyMergedOrSkippable[cqpName] = true; + } + + // loop over all route qps, skipping those that were merged in the first pass + // because they also appear in controller qps + for (var rqpName in routeQP) { + if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) { + continue; + } + + var newRouteParameterConfiguration = {}; + _emberMetalMerge.default(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]); + qps[rqpName] = newRouteParameterConfiguration; + } + + return qps; + } + + function addQueryParamsObservers(controller, propNames) { + propNames.forEach(function (prop) { + controller.addObserver(prop + '.[]', controller, controller._qpChanged); + }); + } + + function deprecateQueryParamDefaultValuesSetOnController(controllerName, routeName, propName) { + } + + exports.default = Route; }); // FEATURES, A, deprecate, assert, Logger -enifed("ember-routing/system/router", ["exports", "ember-metal/core", "ember-metal/error", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/properties", "ember-metal/computed", "ember-metal/merge", "ember-metal/run_loop", "ember-runtime/system/string", "ember-runtime/system/object", "ember-runtime/mixins/evented", "ember-routing/system/dsl", "ember-routing/location/api", "ember-routing/utils", "ember-metal/platform/create", "./router_state", "router", "router/transition"], function (exports, _emberMetalCore, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalProperties, _emberMetalComputed, _emberMetalMerge, _emberMetalRun_loop, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberMetalPlatformCreate, _router_state, _router4, _routerTransition) { - "use strict"; +// apply default values to controllers +// detect that default value defined on router config + +// detect that property was not defined on controller +enifed('ember-routing/system/router', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/merge', 'ember-metal/run_loop', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', './router_state', 'router', 'router/transition'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalProperties, _emberMetalComputed, _emberMetalMerge, _emberMetalRun_loop, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _router_state, _router4, _routerTransition) { + function K() { return this; } var slice = [].slice; @@ -28794,11 +26008,11 @@ @namespace Ember @extends Ember.Object @uses Ember.Evented @public */ - var EmberRouter = _emberRuntimeSystemObject["default"].extend(_emberRuntimeMixinsEvented["default"], { + var EmberRouter = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default, { /** The `location` property determines the type of URL's that your application will use. The following location types are currently available: * `auto` @@ -28820,41 +26034,50 @@ @public */ rootURL: '/', _initRouterJs: function (moduleBasedResolver) { - var router = this.router = new _router4["default"](); + var router = this.router = new _router4.default(); router.triggerEvent = triggerEvent; router._triggerWillChangeContext = K; router._triggerWillLeave = K; var dslCallbacks = this.constructor.dslCallbacks || [K]; - var dsl = new _emberRoutingSystemDsl["default"](null, { + var dsl = new _emberRoutingSystemDsl.default(null, { enableLoadingSubstates: !!moduleBasedResolver }); function generateDSL() { - this.resource('application', { path: "/", overrideNameAssertion: true }, function () { + this.route('application', { path: '/', resetNamespace: true, overrideNameAssertion: true }, function () { for (var i = 0; i < dslCallbacks.length; i++) { dslCallbacks[i].call(this); } }); } generateDSL.call(dsl); if (_emberMetalProperty_get.get(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) { - router.log = _emberMetalCore["default"].Logger.debug; + router.log = _emberMetalCore.default.Logger.debug; } router.map(dsl.generate()); }, init: function () { this._activeViews = {}; this._qpCache = {}; + this._resetQueuedQueryParameterChanges(); + }, + + /* + Resets all pending query paramter changes. + Called after transitioning to a new route + based on query parameter changes. + */ + _resetQueuedQueryParameterChanges: function () { this._queuedQPChanges = {}; }, /** Represents the current URL. @@ -28876,11 +26099,11 @@ */ startRouting: function (moduleBasedResolver) { var initialURL = _emberMetalProperty_get.get(this, 'initialURL'); if (this.setupRouter(moduleBasedResolver)) { - if (typeof initialURL === "undefined") { + if (typeof initialURL === 'undefined') { initialURL = _emberMetalProperty_get.get(this, 'location').getURL(); } var initialTransition = this.handleURL(initialURL); if (initialTransition && initialTransition.error) { throw initialTransition.error; @@ -28915,11 +26138,11 @@ /** Handles updating the paths and notifying any listeners of the URL change. Triggers the router level `didTransition` hook. @method didTransition - @public + @private @since 1.2.0 */ didTransition: function (infos) { updatePaths(this); @@ -28928,14 +26151,14 @@ this.notifyPropertyChange('url'); this.set('currentState', this.targetState); // Put this in the runloop so url will be accurate. Seems // less surprising than didTransition being out of sync. - _emberMetalRun_loop["default"].once(this, this.trigger, 'didTransition'); + _emberMetalRun_loop.default.once(this, this.trigger, 'didTransition'); if (_emberMetalProperty_get.get(this, 'namespace').LOG_TRANSITIONS) { - _emberMetalCore["default"].Logger.log("Transitioned into '" + EmberRouter._routePath(infos) + "'"); + _emberMetalCore.default.Logger.log('Transitioned into \'' + EmberRouter._routePath(infos) + '\''); } }, _setOutlets: function () { var handlerInfos = this.router.currentHandlerInfos; @@ -28975,18 +26198,18 @@ /** Handles notifying any listeners of an impending URL change. Triggers the router level `willTransition` hook. @method willTransition - @public + @private @since 1.11.0 */ willTransition: function (oldInfos, newInfos, transition) { - _emberMetalRun_loop["default"].once(this, this.trigger, 'willTransition', transition); + _emberMetalRun_loop.default.once(this, this.trigger, 'willTransition', transition); if (_emberMetalProperty_get.get(this, 'namespace').LOG_TRANSITIONS) { - _emberMetalCore["default"].Logger.log("Preparing to transition from '" + EmberRouter._routePath(oldInfos) + "' to ' " + EmberRouter._routePath(newInfos) + "'"); + _emberMetalCore.default.Logger.log('Preparing to transition from \'' + EmberRouter._routePath(oldInfos) + '\' to \' ' + EmberRouter._routePath(newInfos) + '\''); } }, handleURL: function (url) { // Until we have an ember-idiomatic way of accessing #hashes, we need to @@ -29030,11 +26253,11 @@ updatePaths(this); var infos = this.router.currentHandlerInfos; if (_emberMetalProperty_get.get(this, 'namespace').LOG_TRANSITIONS) { - _emberMetalCore["default"].Logger.log("Intermediate-transitioned into '" + EmberRouter._routePath(infos) + "'"); + _emberMetalCore.default.Logger.log('Intermediate-transitioned into \'' + EmberRouter._routePath(infos) + '\''); } }, replaceWith: function () { return this.transitionTo.apply(this, arguments).method('replace'); @@ -29114,10 +26337,45 @@ _lookupActiveComponentNode: function (templateName) { return this._activeViews[templateName]; }, + /* + Called when an active route's query parameter has changed. + These changes are batched into a runloop run and trigger + a single transition. + */ + _activeQPChanged: function (queryParameterName, newValue) { + this._queuedQPChanges[queryParameterName] = newValue; + _emberMetalRun_loop.default.once(this, this._fireQueryParamTransition); + }, + + _updatingQPChanged: function (queryParameterName) { + if (!this._qpUpdates) { + this._qpUpdates = {}; + } + this._qpUpdates[queryParameterName] = true; + }, + + /* + Triggers a transition to a route based on query parameter changes. + This is called once per runloop, to batch changes. + e.g. + if these methods are called in succession: + this._activeQPChanged('foo', '10'); + // results in _queuedQPChanges = {foo: '10'} + this._activeQPChanged('bar', false); + // results in _queuedQPChanges = {foo: '10', bar: false} + _queuedQPChanges will represent both of these changes + and the transition using `transitionTo` will be triggered + once. + */ + _fireQueryParamTransition: function () { + this.transitionTo({ queryParams: this._queuedQPChanges }); + this._resetQueuedQueryParameterChanges(); + }, + _connectActiveComponentNode: function (templateName, componentNode) { var _activeViews = this._activeViews; function disconnectActiveView() { delete _activeViews[templateName]; @@ -29130,21 +26388,21 @@ _setupLocation: function () { var location = _emberMetalProperty_get.get(this, 'location'); var rootURL = _emberMetalProperty_get.get(this, 'rootURL'); if ('string' === typeof location && this.container) { - var resolvedLocation = this.container.lookup("location:" + location); + var resolvedLocation = this.container.lookup('location:' + location); if ('undefined' !== typeof resolvedLocation) { location = _emberMetalProperty_set.set(this, 'location', resolvedLocation); } else { // Allow for deprecated registration of custom location API's var options = { implementation: location }; - location = _emberMetalProperty_set.set(this, 'location', _emberRoutingLocationApi["default"].create(options)); + location = _emberMetalProperty_set.set(this, 'location', _emberRoutingLocationApi.default.create(options)); } } if (location !== null && typeof location === 'object') { if (rootURL) { @@ -29167,11 +26425,11 @@ }, _getHandlerFunction: function () { var _this2 = this; - var seen = _emberMetalPlatformCreate["default"](null); + var seen = Object.create(null); var container = this.container; var DefaultRoute = container.lookupFactory('route:basic'); return function (name) { var routeName = 'route:' + name; @@ -29186,11 +26444,11 @@ if (!handler) { container._registry.register(routeName, DefaultRoute.extend()); handler = container.lookup(routeName); if (_emberMetalProperty_get.get(_this2, 'namespace.LOG_ACTIVE_GENERATION')) { - _emberMetalCore["default"].Logger.info("generated -> " + routeName, { fullName: routeName }); + _emberMetalCore.default.Logger.info('generated -> ' + routeName, { fullName: routeName }); } } handler.routeName = name; return handler; @@ -29207,33 +26465,31 @@ location.setURL(lastURL); }; router.updateURL = function (path) { lastURL = path; - _emberMetalRun_loop["default"].once(doUpdateURL); + _emberMetalRun_loop.default.once(doUpdateURL); }; if (location.replaceURL) { var doReplaceURL = function () { location.replaceURL(lastURL); }; router.replaceURL = function (path) { lastURL = path; - _emberMetalRun_loop["default"].once(doReplaceURL); + _emberMetalRun_loop.default.once(doReplaceURL); }; } router.didTransition = function (infos) { emberRouter.didTransition(infos); }; - - router.willTransition = function (oldInfos, newInfos, transition) { - emberRouter.willTransition(oldInfos, newInfos, transition); - }; - + router.willTransition = function (oldInfos, newInfos, transition) { + emberRouter.willTransition(oldInfos, newInfos, transition); + }; }, _serializeQueryParams: function (targetRouteName, queryParams) { var groupedByUrlKey = {}; @@ -29265,21 +26521,21 @@ _pruneDefaultQueryParamValues: function (targetRouteName, queryParams) { var qps = this._queryParamsFor(targetRouteName); for (var key in queryParams) { var qp = qps.map[key]; - if (qp && qp.sdef === queryParams[key]) { + if (qp && qp.serializedDefaultValue === queryParams[key]) { delete queryParams[key]; } } }, _doTransition: function (_targetRouteName, models, _queryParams) { var targetRouteName = _targetRouteName || _emberRoutingUtils.getActiveTargetName(this.router); var queryParams = {}; - _emberMetalMerge["default"](queryParams, _queryParams); + _emberMetalMerge.default(queryParams, _queryParams); this._prepareQueryParams(targetRouteName, models, queryParams); var transitionArgs = _emberRoutingUtils.routeArgs(targetRouteName, models, queryParams); var transitionPromise = this.router.transitionTo.apply(this.router, transitionArgs); @@ -29321,71 +26577,51 @@ if (!qpMeta) { continue; } - _emberMetalMerge["default"](map, qpMeta.map); + _emberMetalMerge.default(map, qpMeta.map); qps.push.apply(qps, qpMeta.qps); } return { qps: qps, map: map }; }, - /* - becomeResolved: function(payload, resolvedContext) { - var params = this.serialize(resolvedContext); - if (payload) { - this.stashResolvedModel(payload, resolvedContext); - payload.params = payload.params || {}; - payload.params[this.name] = params; - } - return this.factory('resolved', { - context: resolvedContext, - name: this.name, - handler: this.handler, - params: params - }); - }, - */ - _hydrateUnsuppliedQueryParams: function (leafRouteName, contexts, queryParams) { var state = calculatePostTransitionState(this, leafRouteName, contexts); var handlerInfos = state.handlerInfos; var appCache = this._bucketCache; - _emberRoutingUtils.stashParamNames(this, handlerInfos); for (var i = 0, len = handlerInfos.length; i < len; ++i) { var route = handlerInfos[i].handler; var qpMeta = _emberMetalProperty_get.get(route, '_qp'); for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { var qp = qpMeta.qps[j]; - var presentProp = qp.prop in queryParams && qp.prop || qp.fprop in queryParams && qp.fprop; + var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName; + if (presentProp) { - if (presentProp !== qp.fprop) { - queryParams[qp.fprop] = queryParams[presentProp]; + if (presentProp !== qp.scopedPropertyName) { + queryParams[qp.scopedPropertyName] = queryParams[presentProp]; delete queryParams[presentProp]; } } else { - var controllerProto = qp.cProto; - var cacheMeta = _emberMetalProperty_get.get(controllerProto, '_cacheMeta'); - - var cacheKey = controllerProto._calculateCacheKey(qp.ctrl, cacheMeta[qp.prop].parts, state.params); - queryParams[qp.fprop] = appCache.lookup(cacheKey, qp.prop, qp.def); + var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.ctrl, qp.parts, state.params); + queryParams[qp.scopedPropertyName] = appCache.lookup(cacheKey, qp.prop, qp.defaultValue); } } } }, _scheduleLoadingEvent: function (transition, originRoute) { this._cancelSlowTransitionTimer(); - this._slowTransitionTimer = _emberMetalRun_loop["default"].scheduleOnce('routerTransitions', this, '_handleSlowTransition', transition, originRoute); + this._slowTransitionTimer = _emberMetalRun_loop.default.scheduleOnce('routerTransitions', this, '_handleSlowTransition', transition, originRoute); }, currentState: null, targetState: null, @@ -29394,22 +26630,22 @@ // Don't fire an event if we've since moved on from // the transition that put us in a loading state. return; } - this.set('targetState', _router_state["default"].create({ + this.set('targetState', _router_state.default.create({ emberRouter: this, routerJs: this.router, routerJsState: this.router.activeTransition.state })); transition.trigger(true, 'loading', transition, originRoute); }, _cancelSlowTransitionTimer: function () { if (this._slowTransitionTimer) { - _emberMetalRun_loop["default"].cancel(this._slowTransitionTimer); + _emberMetalRun_loop.default.cancel(this._slowTransitionTimer); } this._slowTransitionTimer = null; } }); @@ -29524,52 +26760,50 @@ } if (error.stack) { errorArgs.push(error.stack); } - if (typeof error === "string") { + if (typeof error === 'string') { errorArgs.push(error); } } - _emberMetalCore["default"].Logger.error.apply(this, errorArgs); + _emberMetalCore.default.Logger.error.apply(this, errorArgs); } function findChildRouteName(parentRoute, originatingChildRoute, name) { var router = parentRoute.router; var childName; var targetChildRouteName = originatingChildRoute.routeName.split('.').pop(); var namespace = parentRoute.routeName === 'application' ? '' : parentRoute.routeName + '.'; - - // First, try a named loading state, e.g. 'foo_loading' - childName = namespace + targetChildRouteName + '_' + name; - if (routeHasBeenDefined(router, childName)) { - return childName; - } - + // First, try a named loading state, e.g. 'foo_loading' + childName = namespace + targetChildRouteName + '_' + name; + if (routeHasBeenDefined(router, childName)) { + return childName; + } // Second, try general loading state, e.g. 'loading' childName = namespace + name; if (routeHasBeenDefined(router, childName)) { return childName; } } function routeHasBeenDefined(router, name) { var container = router.container; - return router.hasRoute(name) && (container._registry.has("template:" + name) || container._registry.has("route:" + name)); + return router.hasRoute(name) && (container._registry.has('template:' + name) || container._registry.has('route:' + name)); } function triggerEvent(handlerInfos, ignoreFailure, args) { var name = args.shift(); if (!handlerInfos) { if (ignoreFailure) { return; } - throw new _emberMetalError["default"]("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."); + throw new _emberMetalError.default('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.'); } var eventWasHandled = false; var handlerInfo, handler; @@ -29590,11 +26824,11 @@ defaultActionHandlers[name].apply(null, args); return; } if (!eventWasHandled && !ignoreFailure) { - throw new _emberMetalError["default"]("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."); + throw new _emberMetalError.default('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.'); } } function calculatePostTransitionState(emberRouter, leafRouteName, contexts) { var routerjs = emberRouter.router; @@ -29643,19 +26877,38 @@ EmberRouter.reopenClass({ router: null, /** The `Router.map` function allows you to define mappings from URLs to routes - and resources in your application. These mappings are defined within the - supplied callback function using `this.resource` and `this.route`. + in your application. These mappings are defined within the + supplied callback function using `this.route`. + The first parameter is the name of the route which is used by default as the + path name as well. + The second parameter is the optional options hash. Available options are: + * `path`: allows you to provide your own path as well as mark dynamic + segments. + * `resetNamespace`: false by default; when nesting routes, ember will + combine the route names to form the fully-qualified route name, which is + used with `{{link-to}}` or manually transitioning to routes. Setting + `resetNamespace: true` will cause the route not to inherit from its + parent route's names. This is handy for resources which can be accessed + in multiple places as well as preventing extremely long route names. + Keep in mind that the actual URL path behavior is still retained. + The third parameter is a function, which can be used to nest routes. + Nested routes, by default, will have the parent route tree's route name and + path prepended to it's own. ```javascript App.Router.map(function(){ - this.route('about'); - this.resource('article'); + this.route('post', { path: '/post/:post_id' }, function() { + this.route('edit'); + this.route('comments', { resetNamespace: true }, function() { + this.route('new'); + }); + }); }); ``` - For more detailed examples please see + For more detailed documentation and examples please see [the guides](http://emberjs.com/guides/routing/defining-your-routes/). @method map @param callback @public */ @@ -29688,11 +26941,11 @@ } var name, nameParts, oldNameParts; for (var i = 1, l = handlerInfos.length; i < l; i++) { name = handlerInfos[i].name; - nameParts = name.split("."); + nameParts = name.split('.'); oldNameParts = slice.call(path); while (oldNameParts.length) { if (intersectionMatches(oldNameParts, nameParts)) { break; @@ -29701,16 +26954,16 @@ } path.push.apply(path, nameParts.slice(oldNameParts.length)); } - return path.join("."); + return path.join('.'); } }); function didBeginTransition(transition, router) { - var routerState = _router_state["default"].create({ + var routerState = _router_state.default.create({ emberRouter: router, routerJs: router.router, routerJsState: transition.state }); @@ -29768,11 +27021,11 @@ function appendLiveRoute(liveRoutes, defaultParentState, renderOptions) { var target; var myState = { render: renderOptions, - outlets: _emberMetalPlatformCreate["default"](null) + outlets: Object.create(null) }; if (renderOptions.into) { target = findLiveRoute(liveRoutes, renderOptions.into); } else { target = defaultParentState; @@ -29802,15 +27055,15 @@ if (!liveRoutes.outlets.__ember_orphans__) { liveRoutes.outlets.__ember_orphans__ = { render: { name: '__ember_orphans__' }, - outlets: _emberMetalPlatformCreate["default"](null) + outlets: Object.create(null) }; } liveRoutes.outlets.__ember_orphans__.outlets[into] = myState; - _emberMetalCore["default"].run.schedule('afterRender', function () { + _emberMetalCore.default.run.schedule('afterRender', function () { // `wasUsed` gets set by the render helper. See the function // `impersonateAnOutlet`. }); } @@ -29835,37 +27088,36 @@ }; return defaultParentState; } } - exports["default"] = EmberRouter; + exports.default = EmberRouter; }); // FEATURES, Logger, assert /** @module ember @submodule ember-routing */ enifed('ember-routing/system/router_state', ['exports', 'ember-metal/is_empty', 'ember-metal/keys', 'ember-runtime/system/object', 'ember-metal/merge'], function (exports, _emberMetalIs_empty, _emberMetalKeys, _emberRuntimeSystemObject, _emberMetalMerge) { - 'use strict'; - var RouterState = _emberRuntimeSystemObject["default"].extend({ + var RouterState = _emberRuntimeSystemObject.default.extend({ emberRouter: null, routerJs: null, routerJsState: null, isActiveIntent: function (routeName, models, queryParams, queryParamsMustMatch) { var state = this.routerJsState; if (!this.routerJs.isActiveIntent(routeName, models, null, state)) { return false; } - var emptyQueryParams = _emberMetalIs_empty["default"](_emberMetalKeys["default"](queryParams)); + var emptyQueryParams = _emberMetalIs_empty.default(_emberMetalKeys.default(queryParams)); if (queryParamsMustMatch && !emptyQueryParams) { var visibleQueryParams = {}; - _emberMetalMerge["default"](visibleQueryParams, queryParams); + _emberMetalMerge.default(visibleQueryParams, queryParams); this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams); return shallowEqual(visibleQueryParams, state.queryParams); } @@ -29886,18 +27138,18 @@ } } return true; } - exports["default"] = RouterState; + exports.default = RouterState; }); -enifed('ember-routing/utils', ['exports'], function (exports) { - 'use strict'; - +enifed('ember-routing/utils', ['exports', 'ember-metal/merge', 'ember-metal/property_get'], function (exports, _emberMetalMerge, _emberMetalProperty_get) { exports.routeArgs = routeArgs; exports.getActiveTargetName = getActiveTargetName; exports.stashParamNames = stashParamNames; + exports.calculateCacheKey = calculateCacheKey; + exports.normalizeControllerQueryParams = normalizeControllerQueryParams; function routeArgs(targetRouteName, models, queryParams) { var args = []; if (typeof targetRouteName === 'string') { args.push('' + targetRouteName); @@ -29939,119 +27191,222 @@ route._stashNames(handlerInfo, dynamicParent); } handlerInfos._namesStashed = true; } -}); -enifed('ember-runtime', ['exports', 'ember-metal', 'ember-runtime/core', 'ember-runtime/compare', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/system/namespace', 'ember-runtime/system/object', 'ember-runtime/system/tracked_array', 'ember-runtime/system/subarray', 'ember-runtime/system/container', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', '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/-proxy', '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/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/utils'], function (exports, _emberMetal, _emberRuntimeCore, _emberRuntimeCompare, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject, _emberRuntimeSystemTracked_array, _emberRuntimeSystemSubarray, _emberRuntimeSystemContainer, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeSystemSet, _emberRuntimeSystemString, _emberRuntimeSystemDeferred, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeMixinsObservable, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsDeferred, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeMixinsSortable, _emberRuntimeComputedArray_computed, _emberRuntimeComputedReduce_computed, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersArray_controller, _emberRuntimeControllersObject_controller, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeUtils) { - /** - @module ember - @submodule ember-runtime + + function _calculateCacheValuePrefix(prefix, part) { + // calculates the dot seperated sections from prefix that are also + // at the start of part - which gives us the route name + + // given : prefix = site.article.comments, part = site.article.id + // - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below) + + // given : prefix = site.article, part = site.article.id + // - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below) + + var prefixParts = prefix.split('.'); + var currPrefix = ''; + for (var i = 0, len = prefixParts.length; i < len; i++) { + var currPart = prefixParts.slice(0, i + 1).join('.'); + if (part.indexOf(currPart) !== 0) { + break; + } + currPrefix = currPart; + } + return currPrefix; + } + + /* + Stolen from Controller */ - // BEGIN IMPORTS - 'use strict'; + function calculateCacheKey(prefix, _parts, values) { + var parts = _parts || []; + var suffixes = ''; + for (var i = 0, len = parts.length; i < len; ++i) { + var part = parts[i]; + var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part); + var value; + if (cacheValuePrefix && cacheValuePrefix in values) { + var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part; + value = _emberMetalProperty_get.get(values[cacheValuePrefix], partRemovedPrefix); + } else { + value = _emberMetalProperty_get.get(values, part); + } + suffixes += '::' + part + ':' + value; + } + return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-'); + } - // END IMPORTS + var ALL_PERIODS_REGEX = /\./g; - // BEGIN EXPORTS - _emberMetal["default"].compare = _emberRuntimeCompare["default"]; - _emberMetal["default"].copy = _emberRuntimeCopy["default"]; - _emberMetal["default"].isEqual = _emberRuntimeCore.isEqual; + /* + Controller-defined query parameters can come in three shapes: + + Array + queryParams: ['foo', 'bar'] + Array of simple objects where value is an alias + queryParams: [ + { + 'foo': 'rename_foo_to_this' + }, + { + 'bar': 'call_bar_this_instead' + } + ] + Array of fully defined objects + queryParams: [ + { + 'foo': { + as: 'rename_foo_to_this' + }, + } + { + 'bar': { + as: 'call_bar_this_instead', + scope: 'controller' + } + } + ] + + This helper normalizes all three possible styles into the + 'Array of fully defined objects' style. + */ - _emberMetal["default"].inject = _emberRuntimeInject["default"]; + function normalizeControllerQueryParams(queryParams) { + if (queryParams._qpMap) { + return queryParams._qpMap; + } - _emberMetal["default"].Array = _emberRuntimeMixinsArray["default"]; + var qpMap = queryParams._qpMap = {}; - _emberMetal["default"].Comparable = _emberRuntimeMixinsComparable["default"]; - _emberMetal["default"].Copyable = _emberRuntimeMixinsCopyable["default"]; + for (var i = 0, len = queryParams.length; i < len; ++i) { + accumulateQueryParamDescriptors(queryParams[i], qpMap); + } - _emberMetal["default"].SortableMixin = _emberRuntimeMixinsSortable["default"]; + return qpMap; + } - _emberMetal["default"].Freezable = _emberRuntimeMixinsFreezable.Freezable; - _emberMetal["default"].FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR; + function accumulateQueryParamDescriptors(_desc, accum) { + var desc = _desc; + var tmp; + if (typeof desc === 'string') { + tmp = {}; + tmp[desc] = { as: null }; + desc = tmp; + } - _emberMetal["default"].DeferredMixin = _emberRuntimeMixinsDeferred["default"]; + for (var key in desc) { + if (!desc.hasOwnProperty(key)) { + return; + } - _emberMetal["default"].MutableEnumerable = _emberRuntimeMixinsMutable_enumerable["default"]; - _emberMetal["default"].MutableArray = _emberRuntimeMixinsMutable_array["default"]; + var singleDesc = desc[key]; + if (typeof singleDesc === 'string') { + singleDesc = { as: singleDesc }; + } - _emberMetal["default"].TargetActionSupport = _emberRuntimeMixinsTarget_action_support["default"]; - _emberMetal["default"].Evented = _emberRuntimeMixinsEvented["default"]; + tmp = accum[key] || { as: null, scope: 'model' }; + _emberMetalMerge.default(tmp, singleDesc); - _emberMetal["default"].PromiseProxyMixin = _emberRuntimeMixinsPromise_proxy["default"]; + accum[key] = tmp; + } + } +}); +enifed('ember-runtime', ['exports', 'ember-metal', 'ember-runtime/core', 'ember-runtime/compare', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/system/namespace', 'ember-runtime/system/object', 'ember-runtime/system/tracked_array', 'ember-runtime/system/subarray', 'ember-runtime/system/container', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/system/string', '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/-proxy', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/action_handler', '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/reduce_computed_macros', 'ember-runtime/controllers/array_controller', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/utils'], function (exports, _emberMetal, _emberRuntimeCore, _emberRuntimeCompare, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject, _emberRuntimeSystemTracked_array, _emberRuntimeSystemSubarray, _emberRuntimeSystemContainer, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeSystemString, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeMixinsObservable, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeMixinsSortable, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersArray_controller, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeUtils) { + // END IMPORTS - _emberMetal["default"].Observable = _emberRuntimeMixinsObservable["default"]; + // BEGIN EXPORTS + _emberMetal.default.compare = _emberRuntimeCompare.default; + _emberMetal.default.copy = _emberRuntimeCopy.default; + _emberMetal.default.isEqual = _emberRuntimeCore.isEqual; - _emberMetal["default"].arrayComputed = _emberRuntimeComputedArray_computed.arrayComputed; - _emberMetal["default"].ArrayComputedProperty = _emberRuntimeComputedArray_computed.ArrayComputedProperty; - _emberMetal["default"].reduceComputed = _emberRuntimeComputedReduce_computed.reduceComputed; - _emberMetal["default"].ReduceComputedProperty = _emberRuntimeComputedReduce_computed.ReduceComputedProperty; + _emberMetal.default.inject = _emberRuntimeInject.default; - _emberMetal["default"].typeOf = _emberRuntimeUtils.typeOf; - _emberMetal["default"].isArray = _emberRuntimeUtils.isArray; + _emberMetal.default.Array = _emberRuntimeMixinsArray.default; + _emberMetal.default.Comparable = _emberRuntimeMixinsComparable.default; + _emberMetal.default.Copyable = _emberRuntimeMixinsCopyable.default; + + _emberMetal.default.SortableMixin = _emberRuntimeMixinsSortable.default; + + _emberMetal.default.Freezable = _emberRuntimeMixinsFreezable.Freezable; + _emberMetal.default.FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR; + + _emberMetal.default.MutableEnumerable = _emberRuntimeMixinsMutable_enumerable.default; + _emberMetal.default.MutableArray = _emberRuntimeMixinsMutable_array.default; + + _emberMetal.default.TargetActionSupport = _emberRuntimeMixinsTarget_action_support.default; + _emberMetal.default.Evented = _emberRuntimeMixinsEvented.default; + + _emberMetal.default.PromiseProxyMixin = _emberRuntimeMixinsPromise_proxy.default; + + _emberMetal.default.Observable = _emberRuntimeMixinsObservable.default; + + _emberMetal.default.typeOf = _emberRuntimeUtils.typeOf; + _emberMetal.default.isArray = Array.isArray; + // ES6TODO: this seems a less than ideal way/place to add properties to Ember.computed - var EmComputed = _emberMetal["default"].computed; + var EmComputed = _emberMetal.default.computed; EmComputed.sum = _emberRuntimeComputedReduce_computed_macros.sum; EmComputed.min = _emberRuntimeComputedReduce_computed_macros.min; EmComputed.max = _emberRuntimeComputedReduce_computed_macros.max; EmComputed.map = _emberRuntimeComputedReduce_computed_macros.map; EmComputed.sort = _emberRuntimeComputedReduce_computed_macros.sort; EmComputed.setDiff = _emberRuntimeComputedReduce_computed_macros.setDiff; EmComputed.mapBy = _emberRuntimeComputedReduce_computed_macros.mapBy; - EmComputed.mapProperty = _emberRuntimeComputedReduce_computed_macros.mapProperty; EmComputed.filter = _emberRuntimeComputedReduce_computed_macros.filter; EmComputed.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy; - EmComputed.filterProperty = _emberRuntimeComputedReduce_computed_macros.filterProperty; EmComputed.uniq = _emberRuntimeComputedReduce_computed_macros.uniq; EmComputed.union = _emberRuntimeComputedReduce_computed_macros.union; EmComputed.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; - _emberMetal["default"].String = _emberRuntimeSystemString["default"]; - _emberMetal["default"].Object = _emberRuntimeSystemObject["default"]; - _emberMetal["default"].TrackedArray = _emberRuntimeSystemTracked_array["default"]; - _emberMetal["default"].SubArray = _emberRuntimeSystemSubarray["default"]; - _emberMetal["default"].Container = _emberRuntimeSystemContainer.Container; - _emberMetal["default"].Registry = _emberRuntimeSystemContainer.Registry; - _emberMetal["default"].Namespace = _emberRuntimeSystemNamespace["default"]; - _emberMetal["default"].Enumerable = _emberRuntimeMixinsEnumerable["default"]; - _emberMetal["default"].ArrayProxy = _emberRuntimeSystemArray_proxy["default"]; - _emberMetal["default"].ObjectProxy = _emberRuntimeSystemObject_proxy["default"]; - _emberMetal["default"].ActionHandler = _emberRuntimeMixinsAction_handler["default"]; - _emberMetal["default"].CoreObject = _emberRuntimeSystemCore_object["default"]; - _emberMetal["default"].NativeArray = _emberRuntimeSystemNative_array["default"]; + _emberMetal.default.String = _emberRuntimeSystemString.default; + _emberMetal.default.Object = _emberRuntimeSystemObject.default; + _emberMetal.default.TrackedArray = _emberRuntimeSystemTracked_array.default; + _emberMetal.default.SubArray = _emberRuntimeSystemSubarray.default; + _emberMetal.default.Container = _emberRuntimeSystemContainer.Container; + _emberMetal.default.Registry = _emberRuntimeSystemContainer.Registry; + _emberMetal.default.Namespace = _emberRuntimeSystemNamespace.default; + _emberMetal.default.Enumerable = _emberRuntimeMixinsEnumerable.default; + _emberMetal.default.ArrayProxy = _emberRuntimeSystemArray_proxy.default; + _emberMetal.default.ObjectProxy = _emberRuntimeSystemObject_proxy.default; + _emberMetal.default.ActionHandler = _emberRuntimeMixinsAction_handler.default; + _emberMetal.default.CoreObject = _emberRuntimeSystemCore_object.default; + _emberMetal.default.NativeArray = _emberRuntimeSystemNative_array.default; // ES6TODO: Currently we must rely on the global from ember-metal/core to avoid circular deps // Ember.A = A; - _emberMetal["default"].Set = _emberRuntimeSystemSet["default"]; - _emberMetal["default"].Deferred = _emberRuntimeSystemDeferred["default"]; - _emberMetal["default"].onLoad = _emberRuntimeSystemLazy_load.onLoad; - _emberMetal["default"].runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks; + _emberMetal.default.onLoad = _emberRuntimeSystemLazy_load.onLoad; + _emberMetal.default.runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks; - _emberMetal["default"].ArrayController = _emberRuntimeControllersArray_controller["default"]; - _emberMetal["default"].ObjectController = _emberRuntimeControllersObject_controller["default"]; - _emberMetal["default"].Controller = _emberRuntimeControllersController["default"]; - _emberMetal["default"].ControllerMixin = _emberRuntimeMixinsController["default"]; + _emberMetal.default.ArrayController = _emberRuntimeControllersArray_controller.default; + _emberMetal.default.Controller = _emberRuntimeControllersController.default; + _emberMetal.default.ControllerMixin = _emberRuntimeMixinsController.default; - _emberMetal["default"].Service = _emberRuntimeSystemService["default"]; + _emberMetal.default.Service = _emberRuntimeSystemService.default; - _emberMetal["default"]._ProxyMixin = _emberRuntimeMixinsProxy["default"]; + _emberMetal.default._ProxyMixin = _emberRuntimeMixinsProxy.default; - _emberMetal["default"].RSVP = _emberRuntimeExtRsvp["default"]; + _emberMetal.default.RSVP = _emberRuntimeExtRsvp.default; // END EXPORTS - exports["default"] = _emberMetal["default"]; + exports.default = _emberMetal.default; }); +/** +@module ember +@submodule ember-runtime +*/ + +// BEGIN IMPORTS // just for side effect of extending Ember.RSVP // just for side effect of extending String.prototype // just for side effect of extending Function.prototype enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeMixinsComparable) { - 'use strict'; + exports.default = compare; - exports["default"] = compare; - var TYPE_ORDER = { 'undefined': 0, 'null': 1, 'boolean': 2, 'number': 3, @@ -30103,16 +27458,16 @@ } var type1 = _emberRuntimeUtils.typeOf(v); var type2 = _emberRuntimeUtils.typeOf(w); - if (_emberRuntimeMixinsComparable["default"]) { - if (type1 === 'instance' && _emberRuntimeMixinsComparable["default"].detect(v) && v.constructor.compare) { + if (_emberRuntimeMixinsComparable.default) { + if (type1 === 'instance' && _emberRuntimeMixinsComparable.default.detect(v) && v.constructor.compare) { return v.constructor.compare(v, w); } - if (type2 === 'instance' && _emberRuntimeMixinsComparable["default"].detect(w) && w.constructor.compare) { + if (type2 === 'instance' && _emberRuntimeMixinsComparable.default.detect(w) && w.constructor.compare) { return w.constructor.compare(w, v) * -1; } } var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]); @@ -30145,11 +27500,11 @@ // all elements are equal now // shorter array should be ordered first return spaceship(vLen, wLen); case 'instance': - if (_emberRuntimeMixinsComparable["default"] && _emberRuntimeMixinsComparable["default"].detect(v)) { + if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) { return v.compare(v, w); } return 0; case 'date': @@ -30158,1087 +27513,61 @@ default: return 0; } } }); -enifed('ember-runtime/computed/array_computed', ['exports', 'ember-metal/core', 'ember-runtime/computed/reduce_computed', 'ember-metal/enumerable_utils', 'ember-metal/platform/create', 'ember-metal/observer', 'ember-metal/error'], function (exports, _emberMetalCore, _emberRuntimeComputedReduce_computed, _emberMetalEnumerable_utils, _emberMetalPlatformCreate, _emberMetalObserver, _emberMetalError) { - 'use strict'; +enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/computed', 'ember-metal/observer', 'ember-runtime/compare', 'ember-runtime/utils'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalError, _emberMetalComputed, _emberMetalObserver, _emberRuntimeCompare, _emberRuntimeUtils) { + exports.sum = sum; + exports.max = max; + exports.min = min; + exports.map = map; + exports.mapBy = mapBy; + exports.filter = filter; + exports.filterBy = filterBy; + exports.uniq = uniq; + exports.intersect = intersect; + exports.setDiff = setDiff; + exports.sort = sort; - var a_slice = [].slice; - - function ArrayComputedProperty() { - var cp = this; - - this._isArrayComputed = true; - _emberRuntimeComputedReduce_computed.ReduceComputedProperty.apply(this, arguments); - - this._getter = (function (reduceFunc) { - return function (propertyName) { - if (!cp._hasInstanceMeta(this, propertyName)) { - // When we recompute an array computed property, we need already - // retrieved arrays to be updated; we can't simply empty the cache and - // hope the array is re-retrieved. - _emberMetalEnumerable_utils.forEach(cp._dependentKeys, function (dependentKey) { - _emberMetalObserver.addObserver(this, dependentKey, function () { - cp.recomputeOnce.call(this, propertyName); - }); - }, this); - } - - return reduceFunc.apply(this, arguments); - }; - })(this._getter); - - return this; + function reduceMacro(dependentKey, callback, initialValue) { + return _emberMetalComputed.computed(dependentKey + '.[]', function () { + return _emberMetalProperty_get.get(this, dependentKey).reduce(callback, initialValue); + }).readOnly(); } - ArrayComputedProperty.prototype = _emberMetalPlatformCreate["default"](_emberRuntimeComputedReduce_computed.ReduceComputedProperty.prototype); - - ArrayComputedProperty.prototype.initialValue = function () { - return _emberMetalCore["default"].A(); - }; - - ArrayComputedProperty.prototype.resetValue = function (array) { - array.clear(); - return array; - }; - - // This is a stopgap to keep the reference counts correct with lazy CPs. - ArrayComputedProperty.prototype.didChange = function (obj, keyName) { - return; - }; - - /** - Creates a computed property which operates on dependent arrays and - is updated with "one at a time" semantics. When items are added or - removed from the dependent array(s) an array computed only operates - on the change instead of re-evaluating the entire array. This should - return an array, if you'd like to use "one at a time" semantics and - compute some value other then an array look at - `Ember.reduceComputed`. - - If there are more than one arguments the first arguments are - considered to be dependent property keys. The last argument is - required to be an options object. The options object can have the - following three properties. - - `initialize` - An optional initialize function. Typically this will be used - to set up state on the instanceMeta object. - - `removedItem` - A function that is called each time an element is - removed from the array. - - `addedItem` - A function that is called each time an element is - added to the array. - - - The `initialize` function has the following signature: - - ```javascript - function(array, changeMeta, instanceMeta) - ``` - - `array` - The initial value of the arrayComputed, an empty array. - - `changeMeta` - An object which contains meta information about the - computed. It contains the following properties: - - - `property` the computed property - - `propertyName` the name of the property on the object - - `instanceMeta` - An object that can be used to store meta - information needed for calculating your computed. For example a - unique computed might use this to store the number of times a given - element is found in the dependent array. - - - The `removedItem` and `addedItem` functions both have the following signature: - - ```javascript - function(accumulatedValue, item, changeMeta, instanceMeta) - ``` - - `accumulatedValue` - The value returned from the last time - `removedItem` or `addedItem` was called or an empty array. - - `item` - the element added or removed from the array - - `changeMeta` - An object which contains meta information about the - change. It contains the following properties: - - - `property` the computed property - - `propertyName` the name of the property on the object - - `index` the index of the added or removed item - - `item` the added or removed item: this is exactly the same as - the second arg - - `arrayChanged` the array that triggered the change. Can be - useful when depending on multiple arrays. - - For property changes triggered on an item property change (when - depKey is something like `someArray.@each.someProperty`), - `changeMeta` will also contain the following property: - - - `previousValues` an object whose keys are the properties that changed on - the item, and whose values are the item's previous values. - - `previousValues` is important Ember coalesces item property changes via - Ember.run.once. This means that by the time removedItem gets called, item has - the new values, but you may need the previous value (eg for sorting & - filtering). - - `instanceMeta` - An object that can be used to store meta - information needed for calculating your computed. For example a - unique computed might use this to store the number of times a given - element is found in the dependent array. - - The `removedItem` and `addedItem` functions should return the accumulated - value. It is acceptable to not return anything (ie return undefined) - to invalidate the computation. This is generally not a good idea for - arrayComputed but it's used in eg max and min. - - Example - - ```javascript - Ember.computed.map = function(dependentKey, callback) { - var options = { - addedItem: function(array, item, changeMeta, instanceMeta) { - var mapped = callback(item); - array.insertAt(changeMeta.index, mapped); - return array; - }, - removedItem: function(array, item, changeMeta, instanceMeta) { - array.removeAt(changeMeta.index, 1); - return array; - } - }; - - return Ember.arrayComputed(dependentKey, options); - }; - ``` - - @method arrayComputed - @for Ember - @param {String} [dependentKeys*] - @param {Object} options - @return {Ember.ComputedProperty} - @deprecated - @private - */ - function arrayComputed(options) { - var args; - - if (arguments.length > 1) { - args = a_slice.call(arguments, 0, -1); - options = a_slice.call(arguments, -1)[0]; - } - - if (typeof options !== 'object') { - throw new _emberMetalError["default"]('Array Computed Property declared without an options hash'); - } - - var cp = new ArrayComputedProperty(options); - - if (args) { - cp.property.apply(cp, args); - } - - return cp; - } - - exports.arrayComputed = arrayComputed; - exports.ArrayComputedProperty = ArrayComputedProperty; -}); -enifed('ember-runtime/computed/reduce_computed', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/error', 'ember-metal/property_events', 'ember-metal/expand_properties', 'ember-metal/observer', 'ember-metal/computed', 'ember-metal/platform/create', 'ember-metal/enumerable_utils', 'ember-runtime/system/tracked_array', 'ember-runtime/mixins/array', 'ember-metal/run_loop'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberMetalError, _emberMetalProperty_events, _emberMetalExpand_properties, _emberMetalObserver, _emberMetalComputed, _emberMetalPlatformCreate, _emberMetalEnumerable_utils, _emberRuntimeSystemTracked_array, _emberRuntimeMixinsArray, _emberMetalRun_loop) { - 'use strict'; - - exports.reduceComputed = reduceComputed; - - var cacheSet = _emberMetalComputed.cacheFor.set; - var cacheGet = _emberMetalComputed.cacheFor.get; - var cacheRemove = _emberMetalComputed.cacheFor.remove; - var a_slice = [].slice; - // Here we explicitly don't allow `@each.foo`; it would require some special - // testing, but there's no particular reason why it should be disallowed. - var eachPropertyPattern = /^(.*)\.@each\.(.*)/; - var doubleEachPropertyPattern = /(.*\.@each){2,}/; - var arrayBracketPattern = /\.\[\]$/; - - function get(obj, key) { - if (key === '@this') { - return obj; - } - - return _emberMetalProperty_get.get(obj, key); - } - - /* - Tracks changes to dependent arrays, as well as to properties of items in - dependent arrays. - - @class DependentArraysObserver - */ - function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) { - // user specified callbacks for `addedItem` and `removedItem` - this.callbacks = callbacks; - - // the computed property: remember these are shared across instances - this.cp = cp; - - // the ReduceComputedPropertyInstanceMeta this DependentArraysObserver is - // associated with - this.instanceMeta = instanceMeta; - - // A map of array guids to dependentKeys, for the given context. We track - // this because we want to set up the computed property potentially before the - // dependent array even exists, but when the array observer fires, we lack - // enough context to know what to update: we can recover that context by - // getting the dependentKey. - this.dependentKeysByGuid = {}; - - // a map of dependent array guids -> TrackedArray instances. We use - // this to lazily recompute indexes for item property observers. - this.trackedArraysByGuid = {}; - - // We suspend observers to ignore replacements from `reset` when totally - // recomputing. Unfortunately we cannot properly suspend the observers - // because we only have the key; instead we make the observers no-ops - this.suspended = false; - - // This is used to coalesce item changes from property observers within a - // single item. - this.changedItems = {}; - // This is used to coalesce item changes for multiple items that depend on - // some shared state. - this.changedItemCount = 0; - } - - function ItemPropertyObserverContext(dependentArray, index, trackedArray) { - - this.dependentArray = dependentArray; - this.index = index; - this.item = dependentArray.objectAt(index); - this.trackedArray = trackedArray; - this.beforeObserver = null; - this.observer = null; - this.destroyed = false; - } - - DependentArraysObserver.prototype = { - setValue: function (newValue) { - this.instanceMeta.setValue(newValue, true); - }, - - getValue: function () { - return this.instanceMeta.getValue(); - }, - - setupObservers: function (dependentArray, dependentKey) { - this.dependentKeysByGuid[_emberMetalUtils.guidFor(dependentArray)] = dependentKey; - - dependentArray.addArrayObserver(this, { - willChange: 'dependentArrayWillChange', - didChange: 'dependentArrayDidChange' - }); - - if (this.cp._itemPropertyKeys[dependentKey]) { - this.setupPropertyObservers(dependentKey, this.cp._itemPropertyKeys[dependentKey]); - } - }, - - teardownObservers: function (dependentArray, dependentKey) { - var itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || []; - - delete this.dependentKeysByGuid[_emberMetalUtils.guidFor(dependentArray)]; - - this.teardownPropertyObservers(dependentKey, itemPropertyKeys); - - dependentArray.removeArrayObserver(this, { - willChange: 'dependentArrayWillChange', - didChange: 'dependentArrayDidChange' - }); - }, - - suspendArrayObservers: function (callback, binding) { - var oldSuspended = this.suspended; - this.suspended = true; - callback.call(binding); - this.suspended = oldSuspended; - }, - - setupPropertyObservers: function (dependentKey, itemPropertyKeys) { - var dependentArray = get(this.instanceMeta.context, dependentKey); - var length = get(dependentArray, 'length'); - var observerContexts = new Array(length); - - this.resetTransformations(dependentKey, observerContexts); - - _emberMetalEnumerable_utils.forEach(dependentArray, function (item, index) { - var observerContext = this.createPropertyObserverContext(dependentArray, index, this.trackedArraysByGuid[dependentKey]); - observerContexts[index] = observerContext; - - _emberMetalEnumerable_utils.forEach(itemPropertyKeys, function (propertyKey) { - _emberMetalObserver._addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver); - _emberMetalObserver.addObserver(item, propertyKey, this, observerContext.observer); - }, this); - }, this); - }, - - teardownPropertyObservers: function (dependentKey, itemPropertyKeys) { - var dependentArrayObserver = this; - var trackedArray = this.trackedArraysByGuid[dependentKey]; - var beforeObserver, observer, item; - - if (!trackedArray) { - return; - } - - trackedArray.apply(function (observerContexts, offset, operation) { - if (operation === _emberRuntimeSystemTracked_array["default"].DELETE) { - return; - } - - _emberMetalEnumerable_utils.forEach(observerContexts, function (observerContext) { - observerContext.destroyed = true; - beforeObserver = observerContext.beforeObserver; - observer = observerContext.observer; - item = observerContext.item; - - _emberMetalEnumerable_utils.forEach(itemPropertyKeys, function (propertyKey) { - _emberMetalObserver._removeBeforeObserver(item, propertyKey, dependentArrayObserver, beforeObserver); - _emberMetalObserver.removeObserver(item, propertyKey, dependentArrayObserver, observer); - }); - }); - }); - }, - - createPropertyObserverContext: function (dependentArray, index, trackedArray) { - var observerContext = new ItemPropertyObserverContext(dependentArray, index, trackedArray); - - this.createPropertyObserver(observerContext); - - return observerContext; - }, - - createPropertyObserver: function (observerContext) { - var dependentArrayObserver = this; - - observerContext.beforeObserver = function (obj, keyName) { - return dependentArrayObserver.itemPropertyWillChange(obj, keyName, observerContext.dependentArray, observerContext); - }; - - observerContext.observer = function (obj, keyName) { - return dependentArrayObserver.itemPropertyDidChange(obj, keyName, observerContext.dependentArray, observerContext); - }; - }, - - resetTransformations: function (dependentKey, observerContexts) { - this.trackedArraysByGuid[dependentKey] = new _emberRuntimeSystemTracked_array["default"](observerContexts, true); - }, - - trackAdd: function (dependentKey, index, newItems) { - var trackedArray = this.trackedArraysByGuid[dependentKey]; - - if (trackedArray) { - trackedArray.addItems(index, newItems); - } - }, - - trackRemove: function (dependentKey, index, removedCount) { - var trackedArray = this.trackedArraysByGuid[dependentKey]; - - if (trackedArray) { - return trackedArray.removeItems(index, removedCount); - } - - return []; - }, - - updateIndexes: function (trackedArray, array) { - var length = get(array, 'length'); - // OPTIMIZE: we could stop updating once we hit the object whose observer - // fired; ie partially apply the transformations - trackedArray.apply(function (observerContexts, offset, operation, operationIndex) { - // we don't even have observer contexts for removed items, even if we did, - // they no longer have any index in the array - if (operation === _emberRuntimeSystemTracked_array["default"].DELETE) { - return; - } - if (operationIndex === 0 && operation === _emberRuntimeSystemTracked_array["default"].RETAIN && observerContexts.length === length && offset === 0) { - // If we update many items we don't want to walk the array each time: we - // only need to update the indexes at most once per run loop. - return; - } - - _emberMetalEnumerable_utils.forEach(observerContexts, function (context, index) { - context.index = index + offset; - }); - }); - }, - - dependentArrayWillChange: function (dependentArray, index, removedCount, addedCount) { - if (this.suspended) { - return; - } - - var removedItem = this.callbacks.removedItem; - var changeMeta; - var guid = _emberMetalUtils.guidFor(dependentArray); - var dependentKey = this.dependentKeysByGuid[guid]; - var itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || []; - var length = get(dependentArray, 'length'); - var normalizedIndex = normalizeIndex(index, length, 0); - var normalizedRemoveCount = normalizeRemoveCount(normalizedIndex, length, removedCount); - var item, itemIndex, sliceIndex, observerContexts; - - observerContexts = this.trackRemove(dependentKey, normalizedIndex, normalizedRemoveCount); - - function removeObservers(propertyKey) { - observerContexts[sliceIndex].destroyed = true; - _emberMetalObserver._removeBeforeObserver(item, propertyKey, this, observerContexts[sliceIndex].beforeObserver); - _emberMetalObserver.removeObserver(item, propertyKey, this, observerContexts[sliceIndex].observer); - } - - for (sliceIndex = normalizedRemoveCount - 1; sliceIndex >= 0; --sliceIndex) { - itemIndex = normalizedIndex + sliceIndex; - if (itemIndex >= length) { - break; - } - - item = dependentArray.objectAt(itemIndex); - - _emberMetalEnumerable_utils.forEach(itemPropertyKeys, removeObservers, this); - - changeMeta = new ChangeMeta(dependentArray, item, itemIndex, this.instanceMeta.propertyName, this.cp, normalizedRemoveCount); - this.setValue(removedItem.call(this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta)); - } - this.callbacks.flushedChanges.call(this.instanceMeta.context, this.getValue(), this.instanceMeta.sugarMeta); - }, - - dependentArrayDidChange: function (dependentArray, index, removedCount, addedCount) { - if (this.suspended) { - return; - } - - var addedItem = this.callbacks.addedItem; - var guid = _emberMetalUtils.guidFor(dependentArray); - var dependentKey = this.dependentKeysByGuid[guid]; - var observerContexts = new Array(addedCount); - var itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey]; - var length = get(dependentArray, 'length'); - var normalizedIndex = normalizeIndex(index, length, addedCount); - var endIndex = normalizedIndex + addedCount; - var changeMeta, observerContext; - - _emberMetalEnumerable_utils.forEach(dependentArray.slice(normalizedIndex, endIndex), function (item, sliceIndex) { - if (itemPropertyKeys) { - observerContext = this.createPropertyObserverContext(dependentArray, normalizedIndex + sliceIndex, this.trackedArraysByGuid[dependentKey]); - observerContexts[sliceIndex] = observerContext; - - _emberMetalEnumerable_utils.forEach(itemPropertyKeys, function (propertyKey) { - _emberMetalObserver._addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver); - _emberMetalObserver.addObserver(item, propertyKey, this, observerContext.observer); - }, this); - } - - changeMeta = new ChangeMeta(dependentArray, item, normalizedIndex + sliceIndex, this.instanceMeta.propertyName, this.cp, addedCount); - this.setValue(addedItem.call(this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta)); - }, this); - this.callbacks.flushedChanges.call(this.instanceMeta.context, this.getValue(), this.instanceMeta.sugarMeta); - this.trackAdd(dependentKey, normalizedIndex, observerContexts); - }, - - itemPropertyWillChange: function (obj, keyName, array, observerContext) { - var guid = _emberMetalUtils.guidFor(obj); - - if (!this.changedItems[guid]) { - this.changedItems[guid] = { - array: array, - observerContext: observerContext, - obj: obj, - previousValues: {} - }; - } - - ++this.changedItemCount; - this.changedItems[guid].previousValues[keyName] = get(obj, keyName); - }, - - itemPropertyDidChange: function (obj, keyName, array, observerContext) { - if (--this.changedItemCount === 0) { - this.flushChanges(); - } - }, - - flushChanges: function () { - var changedItems = this.changedItems; - var key, c, changeMeta; - - for (key in changedItems) { - c = changedItems[key]; - if (c.observerContext.destroyed) { - continue; - } - - this.updateIndexes(c.observerContext.trackedArray, c.observerContext.dependentArray); - - changeMeta = new ChangeMeta(c.array, c.obj, c.observerContext.index, this.instanceMeta.propertyName, this.cp, changedItems.length, c.previousValues); - this.setValue(this.callbacks.removedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta)); - this.setValue(this.callbacks.addedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta)); - } - - this.changedItems = {}; - this.callbacks.flushedChanges.call(this.instanceMeta.context, this.getValue(), this.instanceMeta.sugarMeta); - } - }; - - function normalizeIndex(index, length, newItemsOffset) { - if (index < 0) { - return Math.max(0, length + index); - } else if (index < length) { - return index; + function arrayMacro(dependentKey, callback) { + // This is a bit ugly + var propertyName; + if (/@each/.test(dependentKey)) { + propertyName = dependentKey.replace(/\.@each.*$/, ''); } else { - // index > length - return Math.min(length - newItemsOffset, index); + propertyName = dependentKey; + dependentKey += '.[]'; } - } - function normalizeRemoveCount(index, length, removedCount) { - return Math.min(removedCount, length - index); - } - - function ChangeMeta(dependentArray, item, index, propertyName, property, changedCount, previousValues) { - this.arrayChanged = dependentArray; - this.index = index; - this.item = item; - this.propertyName = propertyName; - this.property = property; - this.changedCount = changedCount; - - if (previousValues) { - // previous values only available for item property changes - this.previousValues = previousValues; - } - } - - function addItems(dependentArray, callbacks, cp, propertyName, meta) { - _emberMetalEnumerable_utils.forEach(dependentArray, function (item, index) { - meta.setValue(callbacks.addedItem.call(this, meta.getValue(), item, new ChangeMeta(dependentArray, item, index, propertyName, cp, dependentArray.length), meta.sugarMeta)); - }, this); - callbacks.flushedChanges.call(this, meta.getValue(), meta.sugarMeta); - } - - function reset(cp, propertyName) { - var hadMeta = cp._hasInstanceMeta(this, propertyName); - var meta = cp._instanceMeta(this, propertyName); - - if (hadMeta) { - meta.setValue(cp.resetValue(meta.getValue())); - } - - if (cp.options.initialize) { - cp.options.initialize.call(this, meta.getValue(), { - property: cp, - propertyName: propertyName - }, meta.sugarMeta); - } - } - - function partiallyRecomputeFor(obj, dependentKey) { - if (arrayBracketPattern.test(dependentKey)) { - return false; - } - - var value = get(obj, dependentKey); - return _emberRuntimeMixinsArray["default"].detect(value); - } - - function ReduceComputedPropertyInstanceMeta(context, propertyName, initialValue) { - this.context = context; - this.propertyName = propertyName; - var contextMeta = _emberMetalUtils.meta(context); - var contextCache = contextMeta.cache; - if (!contextCache) { - contextCache = contextMeta.cache = {}; - } - this.cache = contextCache; - this.dependentArrays = {}; - this.sugarMeta = {}; - this.initialValue = initialValue; - } - - ReduceComputedPropertyInstanceMeta.prototype = { - getValue: function () { - var value = cacheGet(this.cache, this.propertyName); - - if (value !== undefined) { - return value; + return _emberMetalComputed.computed(dependentKey, function () { + var value = _emberMetalProperty_get.get(this, propertyName); + if (_emberRuntimeUtils.isArray(value)) { + return _emberMetalCore.default.A(callback(value)); } else { - return this.initialValue; + return _emberMetalCore.default.A(); } - }, - - setValue: function (newValue, triggerObservers) { - // This lets sugars force a recomputation, handy for very simple - // implementations of eg max. - if (newValue === cacheGet(this.cache, this.propertyName)) { - return; - } - - if (triggerObservers) { - _emberMetalProperty_events.propertyWillChange(this.context, this.propertyName); - } - - if (newValue === undefined) { - cacheRemove(this.cache, this.propertyName); - } else { - cacheSet(this.cache, this.propertyName, newValue); - } - - if (triggerObservers) { - _emberMetalProperty_events.propertyDidChange(this.context, this.propertyName); - } - } - }; - - /** - A computed property whose dependent keys are arrays and which is updated with - "one at a time" semantics. - - @class ReduceComputedProperty - @namespace Ember - @extends Ember.ComputedProperty - @constructor - @private - */ - - exports.ReduceComputedProperty = ReduceComputedProperty; - // TODO: default export - - function ReduceComputedProperty(options) { - var cp = this; - - // use options._suppressDeprecation to allow us to deprecate - // arrayComputed and reduceComputed themselves, but not the - // default internal macros which will be reimplemented as plain - // array methods - if (this._isArrayComputed) { - } else { - } - - this.options = options; - this._dependentKeys = null; - this._cacheable = true; - // A map of dependentKey -> [itemProperty, ...] that tracks what properties of - // items in the array we must track to update this property. - this._itemPropertyKeys = {}; - this._previousItemPropertyKeys = {}; - - this.readOnly(); - - this.recomputeOnce = function (propertyName) { - // What we really want to do is coalesce by <cp, propertyName>. - // We need a form of `scheduleOnce` that accepts an arbitrary token to - // coalesce by, in addition to the target and method. - _emberMetalRun_loop["default"].once(this, recompute, propertyName); - }; - - var recompute = function (propertyName) { - var meta = cp._instanceMeta(this, propertyName); - var callbacks = cp._callbacks(); - - reset.call(this, cp, propertyName); - - meta.dependentArraysObserver.suspendArrayObservers(function () { - _emberMetalEnumerable_utils.forEach(cp._dependentKeys, function (dependentKey) { - - if (!partiallyRecomputeFor(this, dependentKey)) { - return; - } - - var dependentArray = get(this, dependentKey); - var previousDependentArray = meta.dependentArrays[dependentKey]; - - if (dependentArray === previousDependentArray) { - - // The array may be the same, but our item property keys may have - // changed, so we set them up again. We can't easily tell if they've - // changed: the array may be the same object, but with different - // contents. - if (cp._previousItemPropertyKeys[dependentKey]) { - meta.dependentArraysObserver.teardownPropertyObservers(dependentKey, cp._previousItemPropertyKeys[dependentKey]); - delete cp._previousItemPropertyKeys[dependentKey]; - meta.dependentArraysObserver.setupPropertyObservers(dependentKey, cp._itemPropertyKeys[dependentKey]); - } - } else { - meta.dependentArrays[dependentKey] = dependentArray; - - if (previousDependentArray) { - meta.dependentArraysObserver.teardownObservers(previousDependentArray, dependentKey); - } - - if (dependentArray) { - meta.dependentArraysObserver.setupObservers(dependentArray, dependentKey); - } - } - }, this); - }, this); - - _emberMetalEnumerable_utils.forEach(cp._dependentKeys, function (dependentKey) { - if (!partiallyRecomputeFor(this, dependentKey)) { - return; - } - - var dependentArray = get(this, dependentKey); - - if (dependentArray) { - addItems.call(this, dependentArray, callbacks, cp, propertyName, meta); - } - }, this); - }; - - this._getter = function (propertyName) { - - recompute.call(this, propertyName); - - return cp._instanceMeta(this, propertyName).getValue(); - }; + }).readOnly(); } - ReduceComputedProperty.prototype = _emberMetalPlatformCreate["default"](_emberMetalComputed.ComputedProperty.prototype); - - function defaultCallback(computedValue) { - return computedValue; - } - - ReduceComputedProperty.prototype._callbacks = function () { - if (!this.callbacks) { - var options = this.options; - - this.callbacks = { - removedItem: options.removedItem || defaultCallback, - addedItem: options.addedItem || defaultCallback, - flushedChanges: options.flushedChanges || defaultCallback - }; - } - - return this.callbacks; - }; - - ReduceComputedProperty.prototype._hasInstanceMeta = function (context, propertyName) { - var contextMeta = context.__ember_meta__; - var cacheMeta = contextMeta && contextMeta.cacheMeta; - return !!(cacheMeta && cacheMeta[propertyName]); - }; - - ReduceComputedProperty.prototype._instanceMeta = function (context, propertyName) { - var contextMeta = context.__ember_meta__; - var cacheMeta = contextMeta.cacheMeta; - var meta = cacheMeta && cacheMeta[propertyName]; - - if (!cacheMeta) { - cacheMeta = contextMeta.cacheMeta = {}; - } - if (!meta) { - meta = cacheMeta[propertyName] = new ReduceComputedPropertyInstanceMeta(context, propertyName, this.initialValue()); - meta.dependentArraysObserver = new DependentArraysObserver(this._callbacks(), this, meta, context, propertyName, meta.sugarMeta); - } - - return meta; - }; - - ReduceComputedProperty.prototype.initialValue = function () { - if (typeof this.options.initialValue === 'function') { - return this.options.initialValue(); - } else { - return this.options.initialValue; - } - }; - - ReduceComputedProperty.prototype.resetValue = function (value) { - return this.initialValue(); - }; - - ReduceComputedProperty.prototype.itemPropertyKey = function (dependentArrayKey, itemPropertyKey) { - this._itemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey] || []; - this._itemPropertyKeys[dependentArrayKey].push(itemPropertyKey); - }; - - ReduceComputedProperty.prototype.clearItemPropertyKeys = function (dependentArrayKey) { - if (this._itemPropertyKeys[dependentArrayKey]) { - this._previousItemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey]; - this._itemPropertyKeys[dependentArrayKey] = []; - } - }; - - ReduceComputedProperty.prototype.property = function () { - var cp = this; - var args = a_slice.call(arguments); - var propertyArgs = {}; - var match, dependentArrayKey; - - _emberMetalEnumerable_utils.forEach(args, function (dependentKey) { - if (doubleEachPropertyPattern.test(dependentKey)) { - throw new _emberMetalError["default"]('Nested @each properties not supported: ' + dependentKey); - } else if (match = eachPropertyPattern.exec(dependentKey)) { - dependentArrayKey = match[1]; - - var itemPropertyKeyPattern = match[2]; - var addItemPropertyKey = function (itemPropertyKey) { - cp.itemPropertyKey(dependentArrayKey, itemPropertyKey); - }; - - _emberMetalExpand_properties["default"](itemPropertyKeyPattern, addItemPropertyKey); - propertyArgs[_emberMetalUtils.guidFor(dependentArrayKey)] = dependentArrayKey; - } else { - propertyArgs[_emberMetalUtils.guidFor(dependentKey)] = dependentKey; - } + function multiArrayMacro(dependentKeys, callback) { + var args = dependentKeys.map(function (key) { + return key + '.[]'; }); - var propertyArgsToArray = []; - for (var guid in propertyArgs) { - propertyArgsToArray.push(propertyArgs[guid]); - } - - return _emberMetalComputed.ComputedProperty.prototype.property.apply(this, propertyArgsToArray); - }; - - /** - Creates a computed property which operates on dependent arrays and - is updated with "one at a time" semantics. When items are added or - removed from the dependent array(s) a reduce computed only operates - on the change instead of re-evaluating the entire array. - - If there are more than one arguments the first arguments are - considered to be dependent property keys. The last argument is - required to be an options object. The options object can have the - following four properties: - - `initialValue` - A value or function that will be used as the initial - value for the computed. If this property is a function the result of calling - the function will be used as the initial value. This property is required. - - `initialize` - An optional initialize function. Typically this will be used - to set up state on the instanceMeta object. - - `removedItem` - A function that is called each time an element is removed - from the array. - - `addedItem` - A function that is called each time an element is added to - the array. - - - The `initialize` function has the following signature: - - ```javascript - function(initialValue, changeMeta, instanceMeta) - ``` - - `initialValue` - The value of the `initialValue` property from the - options object. - - `changeMeta` - An object which contains meta information about the - computed. It contains the following properties: - - - `property` the computed property - - `propertyName` the name of the property on the object - - `instanceMeta` - An object that can be used to store meta - information needed for calculating your computed. For example a - unique computed might use this to store the number of times a given - element is found in the dependent array. - - - The `removedItem` and `addedItem` functions both have the following signature: - - ```javascript - function(accumulatedValue, item, changeMeta, instanceMeta) - ``` - - `accumulatedValue` - The value returned from the last time - `removedItem` or `addedItem` was called or `initialValue`. - - `item` - the element added or removed from the array - - `changeMeta` - An object which contains meta information about the - change. It contains the following properties: - - - `property` the computed property - - `propertyName` the name of the property on the object - - `index` the index of the added or removed item - - `item` the added or removed item: this is exactly the same as - the second arg - - `arrayChanged` the array that triggered the change. Can be - useful when depending on multiple arrays. - - For property changes triggered on an item property change (when - depKey is something like `someArray.@each.someProperty`), - `changeMeta` will also contain the following property: - - - `previousValues` an object whose keys are the properties that changed on - the item, and whose values are the item's previous values. - - `previousValues` is important Ember coalesces item property changes via - Ember.run.once. This means that by the time removedItem gets called, item has - the new values, but you may need the previous value (eg for sorting & - filtering). - - `instanceMeta` - An object that can be used to store meta - information needed for calculating your computed. For example a - unique computed might use this to store the number of times a given - element is found in the dependent array. - - The `removedItem` and `addedItem` functions should return the accumulated - value. It is acceptable to not return anything (ie return undefined) - to invalidate the computation. This is generally not a good idea for - arrayComputed but it's used in eg max and min. - - Note that observers will be fired if either of these functions return a value - that differs from the accumulated value. When returning an object that - mutates in response to array changes, for example an array that maps - everything from some other array (see `Ember.computed.map`), it is usually - important that the *same* array be returned to avoid accidentally triggering observers. - - Example - - ```javascript - Ember.computed.max = function(dependentKey) { - return Ember.reduceComputed(dependentKey, { - initialValue: -Infinity, - - addedItem: function(accumulatedValue, item, changeMeta, instanceMeta) { - return Math.max(accumulatedValue, item); - }, - - removedItem: function(accumulatedValue, item, changeMeta, instanceMeta) { - if (item < accumulatedValue) { - return accumulatedValue; - } - } - }); - }; - ``` - - Dependent keys may refer to `@this` to observe changes to the object itself, - which must be array-like, rather than a property of the object. This is - mostly useful for array proxies, to ensure objects are retrieved via - `objectAtContent`. This is how you could sort items by properties defined on an item controller. - - Example - - ```javascript - App.PeopleController = Ember.ArrayController.extend({ - itemController: 'person', - - sortedPeople: Ember.computed.sort('@this.@each.reversedName', function(personA, personB) { - // `reversedName` isn't defined on Person, but we have access to it via - // the item controller App.PersonController. If we'd used - // `content.@each.reversedName` above, we would be getting the objects - // directly and not have access to `reversedName`. - // - var reversedNameA = get(personA, 'reversedName'); - var reversedNameB = get(personB, 'reversedName'); - - return Ember.compare(reversedNameA, reversedNameB); - }) + args.push(function () { + return _emberMetalCore.default.A(callback.call(this, dependentKeys)); }); - - App.PersonController = Ember.ObjectController.extend({ - reversedName: function() { - return reverse(get(this, 'name')); - }.property('name') - }); - ``` - - Dependent keys whose values are not arrays are treated as regular - dependencies: when they change, the computed property is completely - recalculated. It is sometimes useful to have dependent arrays with similar - semantics. Dependent keys which end in `.[]` do not use "one at a time" - semantics. When an item is added or removed from such a dependency, the - computed property is completely recomputed. - - When the computed property is completely recomputed, the `accumulatedValue` - is discarded, it starts with `initialValue` again, and each item is passed - to `addedItem` in turn. - - Example - - ```javascript - Ember.Object.extend({ - // When `string` is changed, `computed` is completely recomputed. - string: 'a string', - - // When an item is added to `array`, `addedItem` is called. - array: [], - - // When an item is added to `anotherArray`, `computed` is completely - // recomputed. - anotherArray: [], - - computed: Ember.reduceComputed('string', 'array', 'anotherArray.[]', { - addedItem: addedItemCallback, - removedItem: removedItemCallback - }) - }); - ``` - - @method reduceComputed - @for Ember - @param {String} [dependentKeys*] - @param {Object} options - @return {Ember.ComputedProperty} - @deprecated - @public - */ - function reduceComputed(options) { - var args; - - if (arguments.length > 1) { - args = a_slice.call(arguments, 0, -1); - options = a_slice.call(arguments, -1)[0]; - } - - if (typeof options !== 'object') { - throw new _emberMetalError["default"]('Reduce Computed Property declared without an options hash'); - } - - if (!('initialValue' in options)) { - throw new _emberMetalError["default"]('Reduce Computed Property declared without an initial value'); - } - - var cp = new ReduceComputedProperty(options); - - if (args) { - cp.property.apply(cp, args); - } - - return cp; + return _emberMetalComputed.computed.apply(this, args).readOnly(); } -}); -// Ember.assert -enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal/core', 'ember-metal/property_get', '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/subarray', 'ember-metal/keys', 'ember-runtime/compare'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberMetalError, _emberMetalEnumerable_utils, _emberMetalRun_loop, _emberMetalObserver, _emberRuntimeComputedArray_computed, _emberRuntimeComputedReduce_computed, _emberRuntimeSystemSubarray, _emberMetalKeys, _emberRuntimeCompare) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; - - exports.sum = sum; - exports.max = max; - exports.min = min; - exports.map = map; - exports.mapBy = mapBy; - exports.filter = filter; - exports.filterBy = filterBy; - exports.uniq = uniq; - exports.intersect = intersect; - exports.setDiff = setDiff; - exports.sort = sort; - - var a_slice = [].slice; - /** A computed property that returns the sum of the value in the dependent array. @method sum @@ -31248,22 +27577,13 @@ @since 1.4.0 @public */ function sum(dependentKey) { - return _emberRuntimeComputedReduce_computed.reduceComputed(dependentKey, { - _suppressDeprecation: true, - initialValue: 0, - - addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) { - return accumulatedValue + item; - }, - - removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) { - return accumulatedValue - item; - } - }); + return reduceMacro(dependentKey, function (sum, item) { + return sum + item; + }, 0); } /** A computed property that calculates the maximum value in the dependent array. This will return `-Infinity` when the dependent @@ -31298,24 +27618,13 @@ @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array @public */ function max(dependentKey) { - return _emberRuntimeComputedReduce_computed.reduceComputed(dependentKey, { - _suppressDeprecation: true, - initialValue: -Infinity, - - addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) { - return Math.max(accumulatedValue, item); - }, - - removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) { - if (item < accumulatedValue) { - return accumulatedValue; - } - } - }); + return reduceMacro(dependentKey, function (max, item) { + return Math.max(max, item); + }, -Infinity); } /** A computed property that calculates the minimum value in the dependent array. This will return `Infinity` when the dependent @@ -31350,25 +27659,13 @@ @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array @public */ function min(dependentKey) { - return _emberRuntimeComputedReduce_computed.reduceComputed(dependentKey, { - _suppressDeprecation: true, - - initialValue: Infinity, - - addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) { - return Math.min(accumulatedValue, item); - }, - - removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) { - if (item > accumulatedValue) { - return accumulatedValue; - } - } - }); + return reduceMacro(dependentKey, function (min, item) { + return Math.min(min, item); + }, Infinity); } /** Returns an array mapped via the callback @@ -31403,25 +27700,13 @@ @return {Ember.ComputedProperty} an array mapped via the callback @public */ function map(dependentKey, callback) { - var options = { - _suppressDeprecation: true, - - addedItem: function (array, item, changeMeta, instanceMeta) { - var mapped = callback.call(this, item, changeMeta.index); - array.insertAt(changeMeta.index, mapped); - return array; - }, - removedItem: function (array, item, changeMeta, instanceMeta) { - array.removeAt(changeMeta.index, 1); - return array; - } - }; - - return _emberRuntimeComputedArray_computed.arrayComputed(dependentKey, options); + return arrayMacro(dependentKey, function (value) { + return value.map(callback); + }); } /** Returns an array mapped to the specified key. @@ -31452,28 +27737,17 @@ @return {Ember.ComputedProperty} an array mapped to the specified key @public */ function mapBy(dependentKey, propertyKey) { - var callback = function (item) { + + return map(dependentKey + '.@each.' + propertyKey, function (item) { return _emberMetalProperty_get.get(item, propertyKey); - }; - return map(dependentKey + '.@each.' + propertyKey, callback); + }); } /** - @method mapProperty - @for Ember.computed - @deprecated Use `Ember.computed.mapBy` instead - @param dependentKey - @param propertyKey - @public - */ - var mapProperty = mapBy; - - exports.mapProperty = mapProperty; - /** Filters the array by the callback. The callback method you provide should have the following signature. `item` is the current item in the iteration. `index` is the integer index of the current item in the iteration. @@ -31508,40 +27782,13 @@ @return {Ember.ComputedProperty} the filtered array @public */ function filter(dependentKey, callback) { - var options = { - _suppressDeprecation: true, - - initialize: function (array, changeMeta, instanceMeta) { - instanceMeta.filteredArrayIndexes = new _emberRuntimeSystemSubarray["default"](undefined, true); - }, - - addedItem: function (array, item, changeMeta, instanceMeta) { - var match = !!callback.call(this, item, changeMeta.index, changeMeta.arrayChanged); - var filterIndex = instanceMeta.filteredArrayIndexes.addItem(changeMeta.index, match); - - if (match) { - array.insertAt(filterIndex, item); - } - - return array; - }, - - removedItem: function (array, item, changeMeta, instanceMeta) { - var filterIndex = instanceMeta.filteredArrayIndexes.removeItem(changeMeta.index); - - if (filterIndex > -1) { - array.removeAt(filterIndex); - } - - return array; - } - }; - - return _emberRuntimeComputedArray_computed.arrayComputed(dependentKey, options); + return arrayMacro(dependentKey, function (value) { + return value.filter(callback); + }); } /** Filters the array by the property and value @@ -31585,22 +27832,10 @@ return filter(dependentKey + '.@each.' + propertyKey, callback); } /** - @method filterProperty - @for Ember.computed - @param dependentKey - @param propertyKey - @param value - @deprecated Use `Ember.computed.filterBy` instead - @public - */ - var filterProperty = filterBy; - - exports.filterProperty = filterProperty; - /** A computed property which returns a new array with all the unique elements from one or more dependent arrays. Example @@ -31628,44 +27863,32 @@ unique elements from the dependent array @public */ function uniq() { - var args = a_slice.call(arguments); + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - args.push({ - _suppressDeprecation: true, + return multiArrayMacro(args, function (dependentKeys) { + var _this = this; - initialize: function (array, changeMeta, instanceMeta) { - instanceMeta.itemCounts = {}; - }, + var uniq = _emberMetalCore.default.A(); - addedItem: function (array, item, changeMeta, instanceMeta) { - var guid = _emberMetalUtils.guidFor(item); - - if (!instanceMeta.itemCounts[guid]) { - instanceMeta.itemCounts[guid] = 1; - array.pushObject(item); - } else { - ++instanceMeta.itemCounts[guid]; + dependentKeys.forEach(function (dependentKey) { + var value = _emberMetalProperty_get.get(_this, dependentKey); + if (_emberRuntimeUtils.isArray(value)) { + value.forEach(function (item) { + if (uniq.indexOf(item) === -1) { + uniq.push(item); + } + }); } - return array; - }, + }); - removedItem: function (array, item, _, instanceMeta) { - var guid = _emberMetalUtils.guidFor(item); - var itemCounts = instanceMeta.itemCounts; - - if (--itemCounts[guid] === 0) { - array.removeObject(item); - } - - return array; - } + return uniq; }); - - return _emberRuntimeComputedArray_computed.arrayComputed.apply(null, args); } /** Alias for [Ember.computed.uniq](/api/#method_computed_uniq). @@ -31703,66 +27926,44 @@ duplicated elements from the dependent arrays @public */ function intersect() { - var args = a_slice.call(arguments); + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - args.push({ - _suppressDeprecation: true, + return multiArrayMacro(args, function (dependentKeys) { + var _this2 = this; - initialize: function (array, changeMeta, instanceMeta) { - instanceMeta.itemCounts = {}; - }, + var arrays = dependentKeys.map(function (dependentKey) { + var array = _emberMetalProperty_get.get(_this2, dependentKey); - addedItem: function (array, item, changeMeta, instanceMeta) { - var itemGuid = _emberMetalUtils.guidFor(item); - var dependentGuid = _emberMetalUtils.guidFor(changeMeta.arrayChanged); - var numberOfDependentArrays = changeMeta.property._dependentKeys.length; - var itemCounts = instanceMeta.itemCounts; + return _emberRuntimeUtils.isArray(array) ? array : []; + }); - if (!itemCounts[itemGuid]) { - itemCounts[itemGuid] = {}; - } - - if (itemCounts[itemGuid][dependentGuid] === undefined) { - itemCounts[itemGuid][dependentGuid] = 0; - } - - if (++itemCounts[itemGuid][dependentGuid] === 1 && numberOfDependentArrays === _emberMetalKeys["default"](itemCounts[itemGuid]).length) { - array.addObject(item); - } - - return array; - }, - - removedItem: function (array, item, changeMeta, instanceMeta) { - var itemGuid = _emberMetalUtils.guidFor(item); - var dependentGuid = _emberMetalUtils.guidFor(changeMeta.arrayChanged); - var numberOfArraysItemAppearsIn; - var itemCounts = instanceMeta.itemCounts; - - if (itemCounts[itemGuid][dependentGuid] === undefined) { - itemCounts[itemGuid][dependentGuid] = 0; - } - - if (--itemCounts[itemGuid][dependentGuid] === 0) { - delete itemCounts[itemGuid][dependentGuid]; - numberOfArraysItemAppearsIn = _emberMetalKeys["default"](itemCounts[itemGuid]).length; - - if (numberOfArraysItemAppearsIn === 0) { - delete itemCounts[itemGuid]; + var results = arrays.pop().filter(function (candidate) { + for (var i = 0; i < arrays.length; i++) { + var found = false; + var array = arrays[i]; + for (var j = 0; j < array.length; j++) { + if (array[j] === candidate) { + found = true; + break; + } } - array.removeObject(item); + if (found === false) { + return false; + } } - return array; - } - }); + return true; + }); - return _emberRuntimeComputedArray_computed.arrayComputed.apply(null, args); + return _emberMetalCore.default.A(results); + }); } /** A computed property which returns a new array with all the properties from the first dependent array that are not in the second @@ -31796,86 +27997,28 @@ @public */ function setDiff(setAProperty, setBProperty) { if (arguments.length !== 2) { - throw new _emberMetalError["default"]('setDiff requires exactly two dependent arrays.'); + throw new _emberMetalError.default('setDiff requires exactly two dependent arrays.'); } - return _emberRuntimeComputedArray_computed.arrayComputed(setAProperty, setBProperty, { - _suppressDeprecation: true, + return _emberMetalComputed.computed(setAProperty + '.[]', setBProperty + '.[]', function () { + var setA = this.get(setAProperty); + var setB = this.get(setBProperty); - addedItem: function (array, item, changeMeta, instanceMeta) { - var setA = _emberMetalProperty_get.get(this, setAProperty); - var setB = _emberMetalProperty_get.get(this, setBProperty); - - if (changeMeta.arrayChanged === setA) { - if (!setB.contains(item)) { - array.addObject(item); - } - } else { - array.removeObject(item); - } - - return array; - }, - - removedItem: function (array, item, changeMeta, instanceMeta) { - var setA = _emberMetalProperty_get.get(this, setAProperty); - var setB = _emberMetalProperty_get.get(this, setBProperty); - - if (changeMeta.arrayChanged === setB) { - if (setA.contains(item)) { - array.addObject(item); - } - } else { - array.removeObject(item); - } - - return array; + if (!_emberRuntimeUtils.isArray(setA)) { + return _emberMetalCore.default.A(); } - }); - } + if (!_emberRuntimeUtils.isArray(setB)) { + return _emberMetalCore.default.A(setA); + } - function binarySearch(array, item, low, high) { - var mid, midItem, res, guidMid, guidItem; - - if (arguments.length < 4) { - high = _emberMetalProperty_get.get(array, 'length'); - } - - if (arguments.length < 3) { - low = 0; - } - - if (low === high) { - return low; - } - - mid = low + Math.floor((high - low) / 2); - midItem = array.objectAt(mid); - - guidMid = _emberMetalUtils.guidFor(midItem); - guidItem = _emberMetalUtils.guidFor(item); - - if (guidMid === guidItem) { - return mid; - } - - res = this.order(midItem, item); - - if (res === 0) { - res = guidMid < guidItem ? -1 : 1; - } - - if (res < 0) { - return this.binarySearch(array, item, mid + 1, high); - } else if (res > 0) { - return this.binarySearch(array, item, low, mid); - } - - return mid; + return setA.filter(function (x) { + return setB.indexOf(x) === -1; + }); + }).readOnly(); } /** A computed property which returns a new array with all the properties from the first dependent array sorted based on a property @@ -31950,167 +28093,91 @@ return propertySort(itemsKey, sortDefinition); } } function customSort(itemsKey, comparator) { - return _emberRuntimeComputedArray_computed.arrayComputed(itemsKey, { - _suppressDeprecation: true, - - initialize: function (array, changeMeta, instanceMeta) { - instanceMeta.order = comparator; - instanceMeta.binarySearch = binarySearch; - instanceMeta.waitingInsertions = []; - instanceMeta.insertWaiting = function () { - var index, item; - var waiting = instanceMeta.waitingInsertions; - instanceMeta.waitingInsertions = []; - for (var i = 0; i < waiting.length; i++) { - item = waiting[i]; - index = instanceMeta.binarySearch(array, item); - array.insertAt(index, item); - } - }; - instanceMeta.insertLater = function (item) { - this.waitingInsertions.push(item); - }; - }, - - addedItem: function (array, item, changeMeta, instanceMeta) { - instanceMeta.insertLater(item); - return array; - }, - - removedItem: function (array, item, changeMeta, instanceMeta) { - array.removeObject(item); - return array; - }, - - flushedChanges: function (array, instanceMeta) { - instanceMeta.insertWaiting(); - } + return arrayMacro(itemsKey, function (value) { + return value.slice().sort(comparator); }); } + // This one needs to dynamically set up and tear down observers on the itemsKey + // depending on the sortProperties function propertySort(itemsKey, sortPropertiesKey) { - return _emberRuntimeComputedArray_computed.arrayComputed(itemsKey, { - _suppressDeprecation: true, + var cp = new _emberMetalComputed.ComputedProperty(function (key) { + var _this3 = this; - initialize: function (array, changeMeta, instanceMeta) { - function setupSortProperties() { - var sortPropertyDefinitions = _emberMetalProperty_get.get(this, sortPropertiesKey); - var sortProperties = instanceMeta.sortProperties = []; - var sortPropertyAscending = instanceMeta.sortPropertyAscending = {}; - var sortProperty, idx, asc; + function didChange() { + this.notifyPropertyChange(key); + } - - changeMeta.property.clearItemPropertyKeys(itemsKey); + var items = itemsKey === '@this' ? this : _emberMetalProperty_get.get(this, itemsKey); + var sortProperties = _emberMetalProperty_get.get(this, sortPropertiesKey); - _emberMetalEnumerable_utils.forEach(sortPropertyDefinitions, function (sortPropertyDefinition) { - if ((idx = sortPropertyDefinition.indexOf(':')) !== -1) { - sortProperty = sortPropertyDefinition.substring(0, idx); - asc = sortPropertyDefinition.substring(idx + 1).toLowerCase() !== 'desc'; - } else { - sortProperty = sortPropertyDefinition; - asc = true; - } + // TODO: Ideally we'd only do this if things have changed + if (cp._sortPropObservers) { + cp._sortPropObservers.forEach(function (args) { + return _emberMetalObserver.removeObserver.apply(null, args); + }); + } - sortProperties.push(sortProperty); - sortPropertyAscending[sortProperty] = asc; - changeMeta.property.itemPropertyKey(itemsKey, sortProperty); - }); + cp._sortPropObservers = []; - this.addObserver(sortPropertiesKey + '.@each', this, updateSortPropertiesOnce); - } + if (!_emberRuntimeUtils.isArray(sortProperties)) { + return items; + } - function updateSortPropertiesOnce() { - _emberMetalRun_loop["default"].once(this, updateSortProperties, changeMeta.propertyName); - } + // Normalize properties + var normalizedSort = sortProperties.map(function (p) { + var _p$split = p.split(':'); - function updateSortProperties(propertyName) { - setupSortProperties.call(this); - changeMeta.property.recomputeOnce.call(this, propertyName); - } + var prop = _p$split[0]; + var direction = _p$split[1]; - _emberMetalObserver.addObserver(this, sortPropertiesKey, updateSortPropertiesOnce); - setupSortProperties.call(this); + direction = direction || 'asc'; - instanceMeta.order = function (itemA, itemB) { - var sortProperty, result, asc; - var keyA = this.keyFor(itemA); - var keyB = this.keyFor(itemB); + return [prop, direction]; + }); - for (var i = 0; i < this.sortProperties.length; ++i) { - sortProperty = this.sortProperties[i]; + // TODO: Ideally we'd only do this if things have changed + // Add observers + normalizedSort.forEach(function (prop) { + var args = [_this3, itemsKey + '.@each.' + prop[0], didChange]; + cp._sortPropObservers.push(args); + _emberMetalObserver.addObserver.apply(null, args); + }); - result = _emberRuntimeCompare["default"](keyA[sortProperty], keyB[sortProperty]); + return _emberMetalCore.default.A(items.slice().sort(function (itemA, itemB) { - if (result !== 0) { - asc = this.sortPropertyAscending[sortProperty]; - return asc ? result : -1 * result; - } + for (var i = 0; i < normalizedSort.length; ++i) { + var _normalizedSort$i = normalizedSort[i]; + var prop = _normalizedSort$i[0]; + var direction = _normalizedSort$i[1]; + + var result = _emberRuntimeCompare.default(_emberMetalProperty_get.get(itemA, prop), _emberMetalProperty_get.get(itemB, prop)); + if (result !== 0) { + return direction === 'desc' ? -1 * result : result; } + } - return 0; - }; - - instanceMeta.binarySearch = binarySearch; - setupKeyCache(instanceMeta); - }, - - addedItem: function (array, item, changeMeta, instanceMeta) { - var index = instanceMeta.binarySearch(array, item); - array.insertAt(index, item); - return array; - }, - - removedItem: function (array, item, changeMeta, instanceMeta) { - var index = instanceMeta.binarySearch(array, item); - array.removeAt(index); - instanceMeta.dropKeyFor(item); - return array; - } + return 0; + })); }); - } - function setupKeyCache(instanceMeta) { - instanceMeta.keyFor = function (item) { - var guid = _emberMetalUtils.guidFor(item); - if (this.keyCache[guid]) { - return this.keyCache[guid]; - } - var sortProperty; - var key = {}; - for (var i = 0; i < this.sortProperties.length; ++i) { - sortProperty = this.sortProperties[i]; - key[sortProperty] = _emberMetalProperty_get.get(item, sortProperty); - } - return this.keyCache[guid] = key; - }; - - instanceMeta.dropKeyFor = function (item) { - var guid = _emberMetalUtils.guidFor(item); - this.keyCache[guid] = null; - }; - - instanceMeta.keyCache = {}; + return cp.property(itemsKey + '.[]', sortPropertiesKey + '.[]').readOnly(); } }); -// Ember.assert -enifed('ember-runtime/controllers/array_controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/enumerable_utils', 'ember-runtime/system/array_proxy', 'ember-runtime/mixins/sortable', 'ember-runtime/mixins/controller', 'ember-metal/computed', 'ember-metal/error', 'ember-runtime/mixins/array'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalEnumerable_utils, _emberRuntimeSystemArray_proxy, _emberRuntimeMixinsSortable, _emberRuntimeMixinsController, _emberMetalComputed, _emberMetalError, _emberRuntimeMixinsArray) { - /** - @module ember - @submodule ember-runtime - */ +/** +@module ember +@submodule ember-runtime +*/ - 'use strict'; - +// Ember.assert +enifed('ember-runtime/controllers/array_controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/system/array_proxy', 'ember-runtime/mixins/sortable', 'ember-runtime/mixins/controller', 'ember-metal/computed', 'ember-metal/error', 'ember-runtime/mixins/array', 'ember-metal/replace'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeSystemArray_proxy, _emberRuntimeMixinsSortable, _emberRuntimeMixinsController, _emberMetalComputed, _emberMetalError, _emberRuntimeMixinsArray, _emberMetalReplace) { var arrayControllerDeprecation = '`Ember.ArrayController` is deprecated.'; exports.arrayControllerDeprecation = arrayControllerDeprecation; - var arrayControllerDeprecation = '`Ember.ArrayController` is deprecated.'; - - exports.arrayControllerDeprecation = arrayControllerDeprecation; /** `Ember.ArrayController` provides a way for you to publish a collection of objects so that you can easily bind to the collection from a Handlebars `#each` helper, an `Ember.CollectionView`, or other controllers. @@ -32142,11 +28209,11 @@ capability comes from `Ember.ArrayProxy`, which this class inherits from. Sometimes you want to display computed properties within the body of an `#each` helper that depend on the underlying items in `model`, but are not present on those items. To do this, set `itemController` to the name of a - controller (probably an `ObjectController`) that will wrap each individual item. + controller that will wrap each individual item. For example: ```handlebars {{#each controller as |post|}} @@ -32157,11 +28224,11 @@ ```javascript App.PostsController = Ember.ArrayController.extend({ itemController: 'post' }); - App.PostController = Ember.ObjectController.extend({ + App.PostController = Ember.Controller.extend({ // the `title` property will be proxied to the underlying post. titleLength: function() { return this.get('title').length; }.property('title') }); @@ -32195,11 +28262,11 @@ @uses Ember.ControllerMixin @deprecated @public */ - exports["default"] = _emberRuntimeSystemArray_proxy["default"].extend(_emberRuntimeMixinsController["default"], _emberRuntimeMixinsSortable["default"], { + exports.default = _emberRuntimeSystemArray_proxy.default.extend(_emberRuntimeMixinsController.default, _emberRuntimeMixinsSortable.default, { /** A string containing the controller name used to wrap items. For example: ```javascript @@ -32272,17 +28339,17 @@ var subControllers = this._subControllers; if (subControllers.length) { var subControllersToRemove = subControllers.slice(idx, idx + removedCnt); - _emberMetalEnumerable_utils.forEach(subControllersToRemove, function (subController) { + subControllersToRemove.forEach(function (subController) { if (subController) { subController.destroy(); } }); - _emberMetalEnumerable_utils.replace(subControllers, idx, removedCnt, new Array(addedCnt)); + _emberMetalReplace.default(subControllers, idx, removedCnt, new Array(addedCnt)); } // The shadow array of subcontrollers must be updated before we trigger // observers, otherwise observers will get the wrong subcontainer when // calling `objectAt` @@ -32295,11 +28362,11 @@ this._subControllers = []; }, model: _emberMetalComputed.computed({ get: function (key) { - return _emberMetalCore["default"].A(); + return _emberMetalCore.default.A(); }, set: function (key, value) { return value; } @@ -32334,11 +28401,11 @@ } fullName = 'controller:' + controllerClass; if (!container._registry.has(fullName)) { - throw new _emberMetalError["default"]('Could not resolve itemController: "' + controllerClass + '"'); + throw new _emberMetalError.default('Could not resolve itemController: "' + controllerClass + '"'); } subController = container.lookupFactory(fullName).create({ target: parentController, parentController: parentController, @@ -32373,12 +28440,15 @@ this._resetSubControllers(); this._super.apply(this, arguments); } }); }); +/** +@module ember +@submodule ember-runtime +*/ enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal/core', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject'], function (exports, _emberMetalCore, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject) { - 'use strict'; /** @module ember @submodule ember-runtime */ @@ -32388,11 +28458,11 @@ @namespace Ember @extends Ember.Object @uses Ember.ControllerMixin @public */ - var Controller = _emberRuntimeSystemObject["default"].extend(_emberRuntimeMixinsController["default"]); + var Controller = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsController.default); function controllerInjectionHelper(factory) { } /** @@ -32422,81 +28492,47 @@ @since 1.10.0 @for Ember.inject @param {String} name (optional) name of the controller to inject, defaults to the property's name @return {Ember.InjectedProperty} injection descriptor instance - @public + @private */ _emberRuntimeInject.createInjectionHelper('controller', controllerInjectionHelper); - exports["default"] = Controller; + exports.default = Controller; }); // Ember.assert -enifed('ember-runtime/controllers/object_controller', ['exports', 'ember-metal/core', 'ember-runtime/mixins/controller', 'ember-runtime/system/object_proxy'], function (exports, _emberMetalCore, _emberRuntimeMixinsController, _emberRuntimeSystemObject_proxy) { - 'use strict'; +enifed('ember-runtime/copy', ['exports', 'ember-metal/core', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetalCore, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { + exports.default = copy; - var objectControllerDeprecation = 'Ember.ObjectController is deprecated, ' + 'please use Ember.Controller and use `model.propertyName`.'; - - exports.objectControllerDeprecation = objectControllerDeprecation; - /** - @module ember - @submodule ember-runtime - */ - - /** - `Ember.ObjectController` is part of Ember's Controller layer. It is intended - to wrap a single object, proxying unhandled attempts to `get` and `set` to the underlying - model object, and to forward unhandled action attempts to its `target`. - - `Ember.ObjectController` derives this functionality from its superclass - `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin. - - @class ObjectController - @namespace Ember - @extends Ember.ObjectProxy - @uses Ember.ControllerMixin - @deprecated - @public - **/ - exports["default"] = _emberRuntimeSystemObject_proxy["default"].extend(_emberRuntimeMixinsController["default"], { - init: function () { - this._super(); - } - }); -}); -enifed('ember-runtime/copy', ['exports', 'ember-metal/enumerable_utils', 'ember-metal/utils', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetalEnumerable_utils, _emberMetalUtils, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { - 'use strict'; - - exports["default"] = copy; - function _copy(obj, deep, seen, copies) { var ret, loc, key; // primitive data types are immutable, just return them. if (typeof obj !== 'object' || obj === null) { return obj; } // avoid cyclical loops - if (deep && (loc = _emberMetalEnumerable_utils.indexOf(seen, obj)) >= 0) { + if (deep && (loc = seen.indexOf(obj)) >= 0) { return copies[loc]; } // IMPORTANT: this specific test will detect a native array only. Any other // object will need to implement Copyable. - if (_emberMetalUtils.isArray(obj)) { + if (Array.isArray(obj)) { ret = obj.slice(); if (deep) { loc = ret.length; while (--loc >= 0) { ret[loc] = _copy(ret[loc], deep, seen, copies); } } - } else if (_emberRuntimeMixinsCopyable["default"] && _emberRuntimeMixinsCopyable["default"].detect(obj)) { + } else if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { ret = obj.copy(deep, seen, copies); } else if (obj instanceof Date) { ret = new Date(obj.getTime()); } else { ret = {}; @@ -32546,18 +28582,19 @@ // fast paths if ('object' !== typeof obj || obj === null) { return obj; // can't copy primitives } - if (_emberRuntimeMixinsCopyable["default"] && _emberRuntimeMixinsCopyable["default"].detect(obj)) { + if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { return obj.copy(deep); } return _copy(obj, deep, deep ? [] : null, deep ? [] : null); } }); enifed('ember-runtime/core', ['exports'], function (exports) { + exports.isEqual = isEqual; /** @module ember @submodule ember-runtime */ @@ -32578,14 +28615,11 @@ @param {Object} a first object to compare @param {Object} b second object to compare @return {Boolean} @public */ - 'use strict'; - exports.isEqual = isEqual; - function isEqual(a, b) { if (a && typeof a.isEqual === 'function') { return a.isEqual(b); } @@ -32595,21 +28629,15 @@ return a === b; } }); enifed('ember-runtime/ext/function', ['exports', 'ember-metal/core', 'ember-metal/expand_properties', 'ember-metal/computed', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalExpand_properties, _emberMetalComputed, _emberMetalMixin) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; - var a_slice = Array.prototype.slice; var FunctionPrototype = Function.prototype; - if (_emberMetalCore["default"].EXTEND_PROTOTYPES === true || _emberMetalCore["default"].EXTEND_PROTOTYPES.Function) { + if (_emberMetalCore.default.EXTEND_PROTOTYPES === true || _emberMetalCore.default.EXTEND_PROTOTYPES.Function) { /** The `property` extension of Javascript's Function prototype is available when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is `true`, which is the default. @@ -32716,26 +28744,12 @@ @method observesImmediately @for Function @deprecated @private */ - FunctionPrototype.observesImmediately = _emberMetalCore["default"].deprecateFunc('Function#observesImmediately is deprecated. Use Function#observes instead', FunctionPrototype._observesImmediately); + FunctionPrototype.observesImmediately = _emberMetalCore.default.deprecateFunc('Function#observesImmediately is deprecated. Use Function#observes instead', FunctionPrototype._observesImmediately); - FunctionPrototype._observesBefore = function () { - var watched = []; - var addWatchedProperty = function (obs) { - watched.push(obs); - }; - - for (var i = 0, l = arguments.length; i < l; ++i) { - _emberMetalExpand_properties["default"](arguments[i], addWatchedProperty); - } - - this.__ember_observesBefore__ = watched; - - return this; - }; /** The `observesBefore` extension of Javascript's Function prototype is available when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default. You can get notified when a property change is about to happen by @@ -32751,12 +28765,25 @@ See `Ember.beforeObserver`. @method observesBefore @for Function @private */ - FunctionPrototype.observesBefore = _emberMetalCore["default"].deprecateFunc('Function#observesBefore is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, FunctionPrototype._observesBefore); + FunctionPrototype.observesBefore = function () { + var watched = []; + var addWatchedProperty = function (obs) { + watched.push(obs); + }; + for (var i = 0, l = arguments.length; i < l; ++i) { + _emberMetalExpand_properties.default(arguments[i], addWatchedProperty); + } + + this.__ember_observesBefore__ = watched; + + return this; + }; + /** The `on` extension of Javascript's Function prototype is available when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default. You can listen for events simply by adding the `on` call to the end of @@ -32779,52 +28806,49 @@ return this; }; } }); +/** +@module ember +@submodule ember-runtime +*/ + // Ember.EXTEND_PROTOTYPES, Ember.assert enifed('ember-runtime/ext/rsvp', ['exports', 'ember-metal/core', 'ember-metal/logger', 'ember-metal/run_loop', 'rsvp'], function (exports, _emberMetalCore, _emberMetalLogger, _emberMetalRun_loop, _rsvp) { - /* globals RSVP:true */ - - 'use strict'; - exports.onerrorDefault = onerrorDefault; var testModuleName = 'ember-testing/test'; var Test; var asyncStart = function () { - if (_emberMetalCore["default"].Test && _emberMetalCore["default"].Test.adapter) { - _emberMetalCore["default"].Test.adapter.asyncStart(); + if (_emberMetalCore.default.Test && _emberMetalCore.default.Test.adapter) { + _emberMetalCore.default.Test.adapter.asyncStart(); } }; var asyncEnd = function () { - if (_emberMetalCore["default"].Test && _emberMetalCore["default"].Test.adapter) { - _emberMetalCore["default"].Test.adapter.asyncEnd(); + if (_emberMetalCore.default.Test && _emberMetalCore.default.Test.adapter) { + _emberMetalCore.default.Test.adapter.asyncEnd(); } }; _rsvp.configure('async', function (callback, promise) { - var async = !_emberMetalRun_loop["default"].currentRunLoop; + var async = !_emberMetalRun_loop.default.currentRunLoop; - if (_emberMetalCore["default"].testing && async) { + if (_emberMetalCore.default.testing && async) { asyncStart(); } - _emberMetalRun_loop["default"].backburner.schedule('actions', function () { - if (_emberMetalCore["default"].testing && async) { + _emberMetalRun_loop.default.backburner.schedule('actions', function () { + if (_emberMetalCore.default.testing && async) { asyncEnd(); } callback(promise); }); }); - _rsvp.Promise.prototype.fail = function (callback, label) { - return this['catch'](callback, label); - }; - function onerrorDefault(e) { var error; if (e && e.errorThrown) { // jqXHR provides this @@ -32836,54 +28860,53 @@ } else { error = e; } if (error && error.name !== 'TransitionAborted') { - if (_emberMetalCore["default"].testing) { + if (_emberMetalCore.default.testing) { // ES6TODO: remove when possible - if (!Test && _emberMetalCore["default"].__loader.registry[testModuleName]) { + if (!Test && _emberMetalCore.default.__loader.registry[testModuleName]) { Test = requireModule(testModuleName)['default']; } if (Test && Test.adapter) { Test.adapter.exception(error); - _emberMetalLogger["default"].error(error.stack); + _emberMetalLogger.default.error(error.stack); } else { throw error; } - } else if (_emberMetalCore["default"].onerror) { - _emberMetalCore["default"].onerror(error); + } else if (_emberMetalCore.default.onerror) { + _emberMetalCore.default.onerror(error); } else { - _emberMetalLogger["default"].error(error.stack); + _emberMetalLogger.default.error(error.stack); } } } _rsvp.on('error', onerrorDefault); - exports["default"] = _rsvp; + exports.default = _rsvp; }); +/* globals RSVP:true */ enifed('ember-runtime/ext/string', ['exports', 'ember-metal/core', 'ember-runtime/system/string'], function (exports, _emberMetalCore, _emberRuntimeSystemString) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; - var StringPrototype = String.prototype; - if (_emberMetalCore["default"].EXTEND_PROTOTYPES === true || _emberMetalCore["default"].EXTEND_PROTOTYPES.String) { + if (_emberMetalCore.default.EXTEND_PROTOTYPES === true || _emberMetalCore.default.EXTEND_PROTOTYPES.String) { /** See [Ember.String.fmt](/api/classes/Ember.String.html#method_fmt). @method fmt @for String @private */ StringPrototype.fmt = function () { - return _emberRuntimeSystemString.fmt(this, arguments); + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _emberRuntimeSystemString.fmt(this, args); }; /** See [Ember.String.w](/api/classes/Ember.String.html#method_w). @method w @@ -32899,11 +28922,15 @@ @method loc @for String @private */ StringPrototype.loc = function () { - return _emberRuntimeSystemString.loc(this, arguments); + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return _emberRuntimeSystemString.loc(this, args); }; /** See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize). @method camelize @@ -32963,14 +28990,18 @@ StringPrototype.capitalize = function () { return _emberRuntimeSystemString.capitalize(this); }; } }); -// Ember.EXTEND_PROTOTYPES, Ember.assert, Ember.FEATURES -enifed("ember-runtime/inject", ["exports", "ember-metal/core", "ember-metal/enumerable_utils", "ember-metal/injected_property", "ember-metal/keys"], function (exports, _emberMetalCore, _emberMetalEnumerable_utils, _emberMetalInjected_property, _emberMetalKeys) { - "use strict"; +/** +@module ember +@submodule ember-runtime +*/ +// Ember.EXTEND_PROTOTYPES, Ember.assert +enifed('ember-runtime/inject', ['exports', 'ember-metal/core', 'ember-metal/injected_property'], function (exports, _emberMetalCore, _emberMetalInjected_property) { + exports.default = inject; exports.createInjectionHelper = createInjectionHelper; exports.validatePropertyInjections = validatePropertyInjections; /** Namespace for injection helper methods. @@ -32978,10 +29009,11 @@ @class inject @namespace Ember @static @public */ + function inject() { } // Dictionary of injection validations by type, added to by `createInjectionHelper` var typeValidators = {}; @@ -33001,11 +29033,11 @@ function createInjectionHelper(type, validator) { typeValidators[type] = validator; inject[type] = function (name) { - return new _emberMetalInjected_property["default"](type, name); + return new _emberMetalInjected_property.default(type, name); }; } /** Validation function that runs per-type validation functions once for each @@ -33023,11 +29055,11 @@ var types = []; var key, desc, validator, i, l; for (key in proto) { desc = proto[key]; - if (desc instanceof _emberMetalInjected_property["default"] && _emberMetalEnumerable_utils.indexOf(types, desc.type) === -1) { + if (desc instanceof _emberMetalInjected_property.default && types.indexOf(desc.type) === -1) { types.push(desc.type); } } if (types.length) { @@ -33040,22 +29072,14 @@ } } return true; } - - exports["default"] = inject; }); // Ember.assert -enifed("ember-runtime/mixins/-proxy", ["exports", "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"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalObserver, _emberMetalProperty_events, _emberMetalComputed, _emberMetalProperties, _emberMetalMixin, _emberRuntimeSystemString) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-runtime/mixins/-proxy', ['exports', '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'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalObserver, _emberMetalProperty_events, _emberMetalComputed, _emberMetalProperties, _emberMetalMixin, _emberRuntimeSystemString) { - "use strict"; - function contentPropertyWillChange(content, contentKey) { var key = contentKey.slice(8); // remove "content." if (key in this) { return; } // if shadowed in proxy @@ -33076,11 +29100,11 @@ @class ProxyMixin @namespace Ember @private */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** The object whose properties will be forwarded. @property content @type Ember.Object @default null @@ -33127,26 +29151,25 @@ return _emberMetalProperty_set.set(content, key, value); } }); }); +/** +@module ember +@submodule ember-runtime +*/ + // Ember.assert -enifed("ember-runtime/mixins/action_handler", ["exports", "ember-metal/merge", "ember-metal/mixin", "ember-metal/property_get"], function (exports, _emberMetalMerge, _emberMetalMixin, _emberMetalProperty_get) { - /** - @module ember - @submodule ember-runtime - */ - "use strict"; +enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalMixin, _emberMetalProperty_get) { /** The `Ember.ActionHandler` mixin implements support for moving an `actions` property to an `_actions` property at extend time, and adding `_actions` to the object's mergedProperties list. `Ember.ActionHandler` is available on some familiar classes including - `Ember.Route`, `Ember.View`, `Ember.Component`, and controllers such as - `Ember.Controller` and `Ember.ObjectController`. + `Ember.Route`, `Ember.View`, `Ember.Component`, and `Ember.Controller`. (Internally the mixin is used by `Ember.CoreView`, `Ember.ControllerMixin`, and `Ember.Route` and available to the above classes through inheritance.) @class ActionHandler @@ -33228,11 +29251,11 @@ By default, an action will stop bubbling once a handler defined on the `actions` hash handles it. To continue bubbling the action, you must return `true` from the handler: ```js App.Router.map(function() { - this.resource("album", function() { + this.route("album", function() { this.route("song"); }); }); App.AlbumRoute = Ember.Route.extend({ actions: { @@ -33274,11 +29297,11 @@ } else if (!!props.events && typeof props.events === 'object') { hashName = 'events'; } if (hashName) { - props._actions = _emberMetalMerge["default"](props._actions || {}, props[hashName]); + props._actions = _emberMetalMerge.default(props._actions || {}, props[hashName]); } delete props[hashName]; } }, @@ -33322,30 +29345,23 @@ return; } } if (target = _emberMetalProperty_get.get(this, 'target')) { - var _target; - - (_target = target).send.apply(_target, arguments); + target.send.apply(target, arguments); } } }); - exports["default"] = ActionHandler; + exports.default = ActionHandler; }); -enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-metal/property_get', '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'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalComputed, _emberMetalIs_none, _emberRuntimeMixinsEnumerable, _emberMetalEnumerable_utils, _emberMetalMixin, _emberMetalProperty_events, _emberMetalEvents, _emberMetalWatching) { - /** - @module ember - @submodule ember-runtime - */ +/** +@module ember +@submodule ember-runtime +*/ +enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/is_none', 'ember-runtime/mixins/enumerable', 'ember-metal/mixin', 'ember-metal/property_events', 'ember-metal/events', 'ember-metal/watching'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalComputed, _emberMetalIs_none, _emberRuntimeMixinsEnumerable, _emberMetalMixin, _emberMetalProperty_events, _emberMetalEvents, _emberMetalWatching) { - // .......................................................... - // HELPERS - // - 'use strict'; - function arrayObserversHelper(obj, target, opts, operation, notify) { var willChange = opts && opts.willChange || 'arrayWillChange'; var didChange = opts && opts.didChange || 'arrayDidChange'; var hasObservers = _emberMetalProperty_get.get(obj, 'hasArrayObservers'); @@ -33401,11 +29417,11 @@ @namespace Ember @uses Ember.Enumerable @since Ember 0.9.0 @public */ - exports["default"] = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsEnumerable["default"], { + exports.default = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsEnumerable.default, { /** __Required.__ You must implement this method to apply this mixin. Your array must support the `length` property. Your replace methods should set this property whenever it changes. @@ -33455,11 +29471,11 @@ @public */ objectsAt: function (indexes) { var self = this; - return _emberMetalEnumerable_utils.map(indexes, function (idx) { + return indexes.map(function (idx) { return self.objectAt(idx); }); }, // overrides Ember.Enumerable version @@ -33515,18 +29531,18 @@ @param {Number} endIndex (Optional) index to end the slice at (but not included). @return {Array} New array with specified slice @public */ slice: function (beginIndex, endIndex) { - var ret = _emberMetalCore["default"].A(); + var ret = _emberMetalCore.default.A(); var length = _emberMetalProperty_get.get(this, 'length'); - if (_emberMetalIs_none["default"](beginIndex)) { + if (_emberMetalIs_none.default(beginIndex)) { beginIndex = 0; } - if (_emberMetalIs_none["default"](endIndex) || endIndex > length) { + if (_emberMetalIs_none.default(endIndex) || endIndex > length) { endIndex = length; } if (beginIndex < 0) { beginIndex = length + beginIndex; @@ -33820,13 +29836,20 @@ return this.__each; }) }); }); +/** +@module ember +@submodule ember-runtime +*/ + +// .......................................................... +// HELPERS +// // ES6TODO: Ember.A -enifed("ember-runtime/mixins/comparable", ["exports", "ember-metal/mixin"], function (exports, _emberMetalMixin) { - "use strict"; +enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { /** @module ember @submodule ember-runtime */ @@ -33840,11 +29863,11 @@ @class Comparable @namespace Ember @since Ember 0.9 @private */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** __Required.__ You must implement this method to apply this mixin. Override to return the result of the comparison of the two parameters. The compare method should return: @@ -33859,24 +29882,22 @@ @private */ compare: null }); }); -enifed("ember-runtime/mixins/controller", ["exports", "ember-metal/mixin", "ember-metal/alias", "ember-runtime/mixins/action_handler", "ember-runtime/mixins/controller_content_model_alias_deprecation"], function (exports, _emberMetalMixin, _emberMetalAlias, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { - "use strict"; +enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal/mixin', 'ember-metal/alias', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetalMixin, _emberMetalAlias, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { /** `Ember.ControllerMixin` provides a standard interface for all classes that - compose Ember's controller layer: `Ember.Controller`, - `Ember.ArrayController`, and `Ember.ObjectController`. + compose Ember's controller layer: `Ember.Controller` and `Ember.ArrayController`. @class ControllerMixin @namespace Ember @uses Ember.ActionHandler @private */ - exports["default"] = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsAction_handler["default"], _emberRuntimeMixinsController_content_model_alias_deprecation["default"], { + exports.default = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsAction_handler.default, _emberRuntimeMixinsController_content_model_alias_deprecation.default, { /* ducktype as a controller */ isController: true, /** The object to which actions from the view should be sent. @@ -33911,16 +29932,15 @@ model: null, /** @private */ - content: _emberMetalAlias["default"]('model') + content: _emberMetalAlias.default('model') }); }); enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['exports', 'ember-metal/core', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalMixin) { - 'use strict'; /* The ControllerContentModelAliasDeprecation mixin is used to provide a useful deprecation warning when specifying `content` directly on a `Ember.Controller` (without also specifying `model`). @@ -33932,11 +29952,11 @@ simple ground rule: Never set a controllers content, rather always set its model and ember will do the right thing. Used internally by Ember in `Ember.Controller`. */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** @private Moves `content` to `model` at extend time if a `model` is not also specified. Note that this currently modifies the mixin themselves, which is technically dubious but is practically of little consequence. This may change in the @@ -33958,18 +29978,12 @@ } } }); }); // Ember.deprecate -enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-runtime/mixins/freezable', 'ember-runtime/system/string', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin, _emberRuntimeMixinsFreezable, _emberRuntimeSystemString, _emberMetalError) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-runtime/mixins/freezable', 'ember-runtime/system/string', 'ember-metal/error'], function (exports, _emberMetalProperty_get, _emberMetalMixin, _emberRuntimeMixinsFreezable, _emberRuntimeSystemString, _emberMetalError) { - 'use strict'; - /** Implements some standard methods for copying an object. Add this mixin to any object you create that can create a copy of itself. This mixin is added automatically to the built-in array. @@ -33982,11 +29996,11 @@ @class Copyable @namespace Ember @since Ember 0.9 @private */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** __Required.__ You must implement this method to apply this mixin. Override to return a copy of the receiver. Default implementation raises an exception. @method copy @@ -34004,107 +30018,27 @@ You should use this method whenever you want a copy of a freezable object since a freezable object can simply return itself without actually consuming more memory. @method frozenCopy @return {Object} copy of receiver or receiver - @deprecated Use `Object.freeze` instead. @private */ frozenCopy: function () { - if (_emberRuntimeMixinsFreezable.Freezable && _emberRuntimeMixinsFreezable.Freezable.detect(this)) { + if (_emberRuntimeMixinsFreezable.Freezable && _emberRuntimeMixinsFreezable.Freezable.detect(this)) { return _emberMetalProperty_get.get(this, 'isFrozen') ? this : this.copy().freeze(); } else { - throw new _emberMetalError["default"](_emberRuntimeSystemString.fmt("%@ does not support freezing", [this])); + throw new _emberMetalError.default(_emberRuntimeSystemString.fmt('%@ does not support freezing', [this])); } } }); }); -enifed("ember-runtime/mixins/deferred", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/mixin", "ember-metal/computed", "ember-runtime/ext/rsvp"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin, _emberMetalComputed, _emberRuntimeExtRsvp) { - "use strict"; +/** +@module ember +@submodule ember-runtime +*/ +enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_events', 'ember-metal/events', 'ember-runtime/compare'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalComputed, _emberMetalProperty_events, _emberMetalEvents, _emberRuntimeCompare) { - /** - @module ember - @submodule ember-runtime - */ - - /** - @class Deferred - @namespace Ember - @private - */ - exports["default"] = _emberMetalMixin.Mixin.create({ - /** - Add handlers to be called when the Deferred object is resolved or rejected. - @method then - @param {Function} resolve a callback function to be called when done - @param {Function} reject a callback function to be called when failed - @private - */ - then: function (resolve, reject, label) { - var deferred, promise, entity; - - entity = this; - deferred = _emberMetalProperty_get.get(this, '_deferred'); - promise = deferred.promise; - - function fulfillmentHandler(fulfillment) { - if (fulfillment === promise) { - return resolve(entity); - } else { - return resolve(fulfillment); - } - } - - return promise.then(resolve && fulfillmentHandler, reject, label); - }, - - /** - Resolve a Deferred object and call any `doneCallbacks` with the given args. - @method resolve - @private - */ - resolve: function (value) { - var deferred, promise; - - deferred = _emberMetalProperty_get.get(this, '_deferred'); - promise = deferred.promise; - - if (value === this) { - deferred.resolve(promise); - } else { - deferred.resolve(value); - } - }, - - /** - Reject a Deferred object and call any `failCallbacks` with the given args. - @method reject - @private - */ - reject: function (value) { - _emberMetalProperty_get.get(this, '_deferred').reject(value); - }, - - _deferred: _emberMetalComputed.computed(function () { - - return _emberRuntimeExtRsvp["default"].defer('Ember: DeferredMixin - ' + this); - }) - }); -}); -// Ember.FEATURES, Ember.Test -enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/enumerable_utils', 'ember-metal/computed', 'ember-metal/property_events', 'ember-metal/events', 'ember-runtime/compare'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalEnumerable_utils, _emberMetalComputed, _emberMetalProperty_events, _emberMetalEvents, _emberRuntimeCompare) { - /** - @module ember - @submodule ember-runtime - */ - - // .......................................................... - // HELPERS - // - - 'use strict'; - var contexts = []; function popCtx() { return contexts.length === 0 ? {} : contexts.pop(); } @@ -34123,16 +30057,10 @@ } return i; } - function deprecatingAliasMethod(oldName, newName) { - return function () { - return this[newName].apply(this, arguments); - }; - } - /** This mixin defines the common interface implemented by enumerable objects in Ember. Most of these methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific features that cannot be emulated in older versions of JavaScript). @@ -34167,11 +30095,11 @@ @class Enumerable @namespace Ember @since Ember 0.9 @private */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** __Required.__ You must implement this method to apply this mixin. Implement this method to make your class enumerable. This method will be called repeatedly during enumeration. The index value @@ -34309,11 +30237,11 @@ to give your iterator function access to the current object. @method forEach @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Object} receiver - @public + @private */ forEach: function (callback, target) { if (typeof callback !== 'function') { throw new TypeError(); } @@ -34384,11 +30312,11 @@ @param {Object} [target] The target object to use @return {Array} The mapped array. @public */ map: function (callback, target) { - var ret = _emberMetalCore["default"].A(); + var ret = _emberMetalCore.default.A(); this.forEach(function (x, idx, i) { ret[idx] = callback.call(target, x, idx, i); }); @@ -34408,21 +30336,10 @@ return _emberMetalProperty_get.get(next, key); }); }, /** - Similar to map, this specialized function returns the value of the named - property on all items in the enumeration. - @method mapProperty - @param {String} key name of the property - @return {Array} The mapped array. - @deprecated Use `mapBy` instead - @private - */ - mapProperty: deprecatingAliasMethod('mapProperty', 'mapBy'), - - /** Returns an array with all of the items in the enumeration that the passed function returns true for. This method corresponds to `filter()` defined in JavaScript 1.6. The callback method you provide should have the following signature (all parameters are optional): @@ -34442,11 +30359,11 @@ @param {Object} [target] The target object to use @return {Array} A filtered array. @public */ filter: function (callback, target) { - var ret = _emberMetalCore["default"].A(); + var ret = _emberMetalCore.default.A(); this.forEach(function (x, idx, i) { if (callback.call(target, x, idx, i)) { ret.push(x); } @@ -34495,23 +30412,10 @@ filterBy: function (key, value) { return this.filter(iter.apply(this, arguments)); }, /** - Returns an array with just the items with the matched property. You - can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to `true`. - @method filterProperty - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Array} filtered array - @deprecated Use `filterBy` instead - @private - */ - filterProperty: deprecatingAliasMethod('filterProperty', 'filterBy'), - - /** Returns an array with the items that do not have truthy values for key. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to false. @method rejectBy @param {String} key the property to test @@ -34532,23 +30436,10 @@ return this.reject(use); }, /** - Returns an array with the items that do not have truthy values for - key. You can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to false. - @method rejectProperty - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Array} rejected array - @deprecated Use `rejectBy` instead - @private - */ - rejectProperty: deprecatingAliasMethod('rejectProperty', 'rejectBy'), - - /** Returns the first item in the array for which the callback returns true. This method works similar to the `filter()` method defined in JavaScript 1.6 except that it will stop working on the array once a match is found. The callback method you provide should have the following signature (all parameters are optional): @@ -34611,24 +30502,10 @@ findBy: function (key, value) { return this.find(iter.apply(this, arguments)); }, /** - Returns the first item with a property matching the passed value. You - can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to `true`. - This method works much like the more generic `find()` method. - @method findProperty - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Object} found item or `undefined` - @deprecated Use `findBy` instead - @private - */ - findProperty: deprecatingAliasMethod('findProperty', 'findBy'), - - /** Returns `true` if the passed function returns true for every item in the enumeration. This corresponds with the `every()` method in JavaScript 1.6. The callback method you provide should have the following signature (all parameters are optional): ```javascript @@ -34649,37 +30526,27 @@ ``` @method every @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Boolean} - @public + @private */ every: function (callback, target) { return !this.find(function (x, idx, i) { return !callback.call(target, x, idx, i); }); }, /** - @method everyBy - @param {String} key the property to test - @param {String} [value] optional value to test against. - @deprecated Use `isEvery` instead - @return {Boolean} - @public - */ - everyBy: deprecatingAliasMethod('everyBy', 'isEvery'), - - /** @method everyProperty @param {String} key the property to test @param {String} [value] optional value to test against. @deprecated Use `isEvery` instead @return {Boolean} @private */ - everyProperty: deprecatingAliasMethod('everyProperty', 'isEvery'), + everyProperty: _emberMetalMixin.aliasMethod('isEvery'), /** Returns `true` if the passed property resolves to the value of the second argument for all items in the enumerable. This method is often simpler/faster than using a callback. @@ -34771,11 +30638,11 @@ @param {Object} [target] The target object to use @return {Boolean} `true` if the passed function returns `true` for any item @deprecated Use `any` instead @private */ - some: deprecatingAliasMethod('some', 'any'), + some: _emberMetalMixin.aliasMethod('any'), /** Returns `true` if the passed property resolves to the value of the second argument for any item in the enumerable. This method is often simpler/faster than using a callback. @@ -34796,23 +30663,13 @@ @param {String} [value] optional value to test against. @return {Boolean} @deprecated Use `isAny` instead @private */ - anyBy: deprecatingAliasMethod('anyBy', 'isAny'), + anyBy: _emberMetalMixin.aliasMethod('isAny'), /** - @method someProperty - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Boolean} - @deprecated Use `isAny` instead - @private - */ - someProperty: deprecatingAliasMethod('someProperty', 'isAny'), - - /** This will combine the values of the enumerator into a single value. It is a useful way to collect a summary value from an enumeration. This corresponds to the `reduce()` method defined in JavaScript 1.8. The callback method you provide should have the following signature (all parameters are optional): @@ -34864,11 +30721,11 @@ invoke: function (methodName) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } - var ret = _emberMetalCore["default"].A(); + var ret = _emberMetalCore.default.A(); this.forEach(function (x, idx) { var method = x && x[methodName]; if ('function' === typeof method) { @@ -34885,11 +30742,11 @@ @method toArray @return {Array} the enumerable as an array. @private */ toArray: function () { - var ret = _emberMetalCore["default"].A(); + var ret = _emberMetalCore.default.A(); this.forEach(function (o, idx) { ret[idx] = o; }); @@ -34902,11 +30759,11 @@ var arr = ['a', null, 'c', undefined]; arr.compact(); // ['a', 'c'] ``` @method compact @return {Array} the array without null and undefined elements. - @public + @private */ compact: function () { return this.filter(function (value) { return value != null; }); @@ -34921,18 +30778,18 @@ arr.without('a'); // ['b', 'c'] ``` @method without @param {Object} value @return {Ember.Enumerable} - @public + @private */ without: function (value) { if (!this.contains(value)) { return this; // nothing to do } - var ret = _emberMetalCore["default"].A(); + var ret = _emberMetalCore.default.A(); this.forEach(function (k) { if (k !== value) { ret[ret.length] = k; } @@ -34952,14 +30809,14 @@ @method uniq @return {Ember.Enumerable} @private */ uniq: function () { - var ret = _emberMetalCore["default"].A(); + var ret = _emberMetalCore.default.A(); this.forEach(function (k) { - if (_emberMetalEnumerable_utils.indexOf(ret, k) < 0) { + if (ret.indexOf(k) < 0) { ret.push(k); } }); return ret; @@ -35164,35 +31021,42 @@ You may provide multiple arguments to sort by multiple properties. @method sortBy @param {String} property name(s) to sort on @return {Array} The sorted array. @since 1.2.0 - @public + @private */ sortBy: function () { var sortKeys = arguments; return this.toArray().sort(function (a, b) { for (var i = 0; i < sortKeys.length; i++) { var key = sortKeys[i]; var propA = _emberMetalProperty_get.get(a, key); var propB = _emberMetalProperty_get.get(b, key); // return 1 or -1 else continue to the next sortKey - var compareValue = _emberRuntimeCompare["default"](propA, propB); + var compareValue = _emberRuntimeCompare.default(propA, propB); if (compareValue) { return compareValue; } } return 0; }); } }); }); -enifed("ember-runtime/mixins/evented", ["exports", "ember-metal/mixin", "ember-metal/events"], function (exports, _emberMetalMixin, _emberMetalEvents) { - "use strict"; +/** +@module ember +@submodule ember-runtime +*/ +// .......................................................... +// HELPERS +// +enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal/mixin', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalEvents) { + /** @module ember @submodule ember-runtime */ @@ -35230,11 +31094,11 @@ @class Evented @namespace Ember @public */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** Subscribes to a named event with given function. ```javascript person.on('didLoad', function() { @@ -35329,18 +31193,12 @@ has: function (name) { return _emberMetalEvents.hasListeners(this, name); } }); }); -enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalProperty_get, _emberMetalProperty_set) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalMixin, _emberMetalProperty_get, _emberMetalProperty_set) { - 'use strict'; - /** The `Ember.Freezable` mixin implements some basic methods for marking an object as frozen. Once an object is frozen it should be read only. No changes may be made the internal state of the object. @@ -35392,19 +31250,14 @@ return a frozen object, if the object implements this method as well. @class Freezable @namespace Ember @since Ember 0.9 - @deprecated Use `Object.freeze` instead. @private */ var Freezable = _emberMetalMixin.Mixin.create({ - init: function () { - this._super.apply(this, arguments); - }, - /** Set to `true` when the object is frozen. Use this property to detect whether your object is frozen or not. @property isFrozen @type Boolean @@ -35429,14 +31282,18 @@ } }); exports.Freezable = Freezable; - var FROZEN_ERROR = "Frozen object cannot be modified."; + var FROZEN_ERROR = 'Frozen object cannot be modified.'; exports.FROZEN_ERROR = FROZEN_ERROR; }); -enifed("ember-runtime/mixins/mutable_array", ["exports", "ember-metal/property_get", "ember-metal/utils", "ember-metal/error", "ember-metal/mixin", "ember-runtime/mixins/array", "ember-runtime/mixins/mutable_enumerable", "ember-runtime/mixins/enumerable"], function (exports, _emberMetalProperty_get, _emberMetalUtils, _emberMetalError, _emberMetalMixin, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { +/** +@module ember +@submodule ember-runtime +*/ +enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/mixin', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, _emberMetalProperty_get, _emberMetalError, _emberMetalMixin, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { /** @module ember @submodule ember-runtime */ @@ -35445,19 +31302,13 @@ // .......................................................... // CONSTANTS // - "use strict"; - - var OUT_OF_RANGE_EXCEPTION = "Index out of range"; + var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; var EMPTY = []; - // .......................................................... - // HELPERS - // - /** This mixin defines the API for modifying array-like objects. These methods can be applied only to a collection that keeps its items in an ordered set. It builds upon the Array mixin and adds methods to modify the array. Concrete implementations of this class include ArrayProxy and ArrayController. @@ -35475,11 +31326,11 @@ @namespace Ember @uses Ember.Array @uses Ember.MutableEnumerable @public */ - exports["default"] = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsArray["default"], _emberRuntimeMixinsMutable_enumerable["default"], { + exports.default = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsArray.default, _emberRuntimeMixinsMutable_enumerable.default, { /** __Required.__ You must implement this method to apply this mixin. This is one of the primitives you must implement to support `Ember.Array`. You should replace amt objects started at idx with the objects in the @@ -35532,11 +31383,11 @@ @return {Ember.Array} receiver @public */ insertAt: function (idx, object) { if (idx > _emberMetalProperty_get.get(this, 'length')) { - throw new _emberMetalError["default"](OUT_OF_RANGE_EXCEPTION); + throw new _emberMetalError.default(OUT_OF_RANGE_EXCEPTION); } this.replace(idx, 0, [object]); return this; }, @@ -35560,11 +31411,11 @@ */ removeAt: function (start, len) { if ('number' === typeof start) { if (start < 0 || start >= _emberMetalProperty_get.get(this, 'length')) { - throw new _emberMetalError["default"](OUT_OF_RANGE_EXCEPTION); + throw new _emberMetalError.default(OUT_OF_RANGE_EXCEPTION); } // fast case if (len === undefined) { len = 1; @@ -35605,12 +31456,12 @@ @param {Ember.Enumerable} objects the objects to add @return {Ember.Array} receiver @public */ pushObjects: function (objects) { - if (!(_emberRuntimeMixinsEnumerable["default"].detect(objects) || _emberMetalUtils.isArray(objects))) { - throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects"); + if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || Array.isArray(objects))) { + throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); } this.replace(_emberMetalProperty_get.get(this, 'length'), 0, objects); return this; }, @@ -35786,12 +31637,14 @@ return this; } }); }); -enifed("ember-runtime/mixins/mutable_enumerable", ["exports", "ember-metal/enumerable_utils", "ember-runtime/mixins/enumerable", "ember-metal/mixin", "ember-metal/property_events"], function (exports, _emberMetalEnumerable_utils, _emberRuntimeMixinsEnumerable, _emberMetalMixin, _emberMetalProperty_events) { - "use strict"; +// .......................................................... +// HELPERS +// +enifed('ember-runtime/mixins/mutable_enumerable', ['exports', 'ember-runtime/mixins/enumerable', 'ember-metal/mixin', 'ember-metal/property_events'], function (exports, _emberRuntimeMixinsEnumerable, _emberMetalMixin, _emberMetalProperty_events) { /** @module ember @submodule ember-runtime */ @@ -35834,11 +31687,11 @@ @class MutableEnumerable @namespace Ember @uses Ember.Enumerable @public */ - exports["default"] = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsEnumerable["default"], { + exports.default = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsEnumerable.default, { /** __Required.__ You must implement this method to apply this mixin. Attempts to add the passed object to the receiver if the object is not already present in the collection. If the object is present, this method @@ -35858,14 +31711,16 @@ @param {Ember.Enumerable} objects the objects to add. @return {Object} receiver @public */ addObjects: function (objects) { + var _this = this; + _emberMetalProperty_events.beginPropertyChanges(this); - _emberMetalEnumerable_utils.forEach(objects, function (obj) { - this.addObject(obj); - }, this); + objects.forEach(function (obj) { + return _this.addObject(obj); + }); _emberMetalProperty_events.endPropertyChanges(this); return this; }, /** @@ -35897,16 +31752,11 @@ _emberMetalProperty_events.endPropertyChanges(this); return this; } }); }); -enifed("ember-runtime/mixins/observable", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_set", "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"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalMixin, _emberMetalEvents, _emberMetalProperty_events, _emberMetalObserver, _emberMetalComputed, _emberMetalIs_none) { - /** - @module ember - @submodule ember-runtime - */ - "use strict"; +enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', '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'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalMixin, _emberMetalEvents, _emberMetalProperty_events, _emberMetalObserver, _emberMetalComputed, _emberMetalIs_none) { /** ## Overview This mixin provides properties and property observing functionality, core @@ -35970,11 +31820,11 @@ @class Observable @namespace Ember @public */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** Retrieves the value of a property from the object. This method is usually similar to using `object[keyName]` or `object.keyName`, however it supports both computed properties and the unknownProperty @@ -36028,11 +31878,11 @@ getProperties: function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - return _emberMetalGet_properties["default"].apply(null, [this].concat(args)); + return _emberMetalGet_properties.default.apply(null, [this].concat(args)); }, /** Sets the provided key or path to the value. This method is generally very similar to calling `object[key] = value` or @@ -36057,25 +31907,18 @@ `beginPropertyChanges()` and `endPropertyChanges(),` any "local" observers (i.e. observer methods declared on the same object), will be called immediately. Any "remote" observers (i.e. observer methods declared on another object) will be placed in a queue and called at a later time in a coalesced manner. - ### Chaining - In addition to property changes, `set()` returns the value of the object - itself so you can do chaining like this: - ```javascript - record.set('firstName', 'Charles').set('lastName', 'Jolley'); - ``` @method set @param {String} keyName The property to set @param {Object} value The value to set or `null`. - @return {Ember.Observable} + @return {Object} The passed value @public */ set: function (keyName, value) { - _emberMetalProperty_set.set(this, keyName, value); - return this; + return _emberMetalProperty_set.set(this, keyName, value); }, /** Sets a list of properties at once. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so @@ -36083,15 +31926,15 @@ ```javascript record.setProperties({ firstName: 'Charles', lastName: 'Jolley' }); ``` @method setProperties @param {Object} hash the hash of keys and values to set - @return {Ember.Observable} + @return {Object} The passed in hash @public */ setProperties: function (hash) { - return _emberMetalSet_properties["default"](this, hash); + return _emberMetalSet_properties.default(this, hash); }, /** Begins a grouping of property changes. You can use this method to group property changes so that notifications @@ -36173,11 +32016,11 @@ Convenience method to call `propertyWillChange` and `propertyDidChange` in succession. @method notifyPropertyChange @param {String} keyName The property key to be notified about. @return {Ember.Observable} - @public + @private */ notifyPropertyChange: function (keyName) { this.propertyWillChange(keyName); this.propertyDidChange(keyName); return this; @@ -36283,15 +32126,14 @@ @param {Number} increment The amount to increment by. Defaults to 1 @return {Number} The new property value @public */ incrementProperty: function (keyName, increment) { - if (_emberMetalIs_none["default"](increment)) { + if (_emberMetalIs_none.default(increment)) { increment = 1; } - _emberMetalProperty_set.set(this, keyName, (parseFloat(_emberMetalProperty_get.get(this, keyName)) || 0) + increment); - return _emberMetalProperty_get.get(this, keyName); + return _emberMetalProperty_set.set(this, keyName, (parseFloat(_emberMetalProperty_get.get(this, keyName)) || 0) + increment); }, /** Set the value of a property to the current value minus some amount. ```javascript @@ -36303,15 +32145,14 @@ @param {Number} decrement The amount to decrement by. Defaults to 1 @return {Number} The new property value @public */ decrementProperty: function (keyName, decrement) { - if (_emberMetalIs_none["default"](decrement)) { + if (_emberMetalIs_none.default(decrement)) { decrement = 1; } - _emberMetalProperty_set.set(this, keyName, (_emberMetalProperty_get.get(this, keyName) || 0) - decrement); - return _emberMetalProperty_get.get(this, keyName); + return _emberMetalProperty_set.set(this, keyName, (_emberMetalProperty_get.get(this, keyName) || 0) - decrement); }, /** Set the value of a boolean property to the opposite of its current value. @@ -36322,12 +32163,11 @@ @param {String} keyName The name of the property to toggle @return {Boolean} The new property value @public */ toggleProperty: function (keyName) { - _emberMetalProperty_set.set(this, keyName, !_emberMetalProperty_get.get(this, keyName)); - return _emberMetalProperty_get.get(this, keyName); + return _emberMetalProperty_set.set(this, keyName, !_emberMetalProperty_get.get(this, keyName)); }, /** Returns the cached value of a computed property, if it exists. This allows you to inspect the value of a computed property @@ -36346,110 +32186,102 @@ observersForKey: function (keyName) { return _emberMetalObserver.observersFor(this, keyName); } }); }); +/** +@module ember +@submodule ember-runtime +*/ // Ember.assert -enifed("ember-runtime/mixins/promise_proxy", ["exports", "ember-metal/property_get", "ember-metal/set_properties", "ember-metal/computed", "ember-metal/mixin", "ember-metal/error"], function (exports, _emberMetalProperty_get, _emberMetalSet_properties, _emberMetalComputed, _emberMetalMixin, _emberMetalError) { - "use strict"; +enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal/property_get', 'ember-metal/set_properties', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/error'], function (exports, _emberMetalProperty_get, _emberMetalSet_properties, _emberMetalComputed, _emberMetalMixin, _emberMetalError) { var not = _emberMetalComputed.computed.not; var or = _emberMetalComputed.computed.or; /** @module ember @submodule ember-runtime */ function tap(proxy, promise) { - _emberMetalSet_properties["default"](proxy, { + _emberMetalSet_properties.default(proxy, { isFulfilled: false, isRejected: false }); return promise.then(function (value) { - _emberMetalSet_properties["default"](proxy, { + _emberMetalSet_properties.default(proxy, { content: value, isFulfilled: true }); return value; }, function (reason) { - _emberMetalSet_properties["default"](proxy, { + _emberMetalSet_properties.default(proxy, { reason: reason, isRejected: true }); throw reason; - }, "Ember: PromiseProxy"); + }, 'Ember: PromiseProxy'); } /** - A low level mixin making ObjectProxy, ObjectController or ArrayControllers promise-aware. + A low level mixin making ObjectProxy or ArrayControllers promise-aware. ```javascript - var ObjectPromiseController = Ember.ObjectController.extend(Ember.PromiseProxyMixin); + var ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); - var controller = ObjectPromiseController.create({ + var proxy = ObjectPromiseProxy.create({ promise: $.getJSON('/some/remote/data.json') }); - controller.then(function(json){ + proxy.then(function(json){ // the json }, function(reason) { // the reason why you have no json }); ``` - the controller has bindable attributes which + the proxy has bindable attributes which track the promises life cycle ```javascript - controller.get('isPending') //=> true - controller.get('isSettled') //=> false - controller.get('isRejected') //=> false - controller.get('isFulfilled') //=> false + proxy.get('isPending') //=> true + proxy.get('isSettled') //=> false + proxy.get('isRejected') //=> false + proxy.get('isFulfilled') //=> false ``` When the the $.getJSON completes, and the promise is fulfilled with json, the life cycle attributes will update accordingly. ```javascript - controller.get('isPending') //=> false - controller.get('isSettled') //=> true - controller.get('isRejected') //=> false - controller.get('isFulfilled') //=> true + proxy.get('isPending') //=> false + proxy.get('isSettled') //=> true + proxy.get('isRejected') //=> false + proxy.get('isFulfilled') //=> true ``` - As the controller is an ObjectController, and the json now its content, - all the json properties will be available directly from the controller. + As the proxy is an ObjectProxy, and the json now its content, + all the json properties will be available directly from the proxy. ```javascript // Assuming the following json: { firstName: 'Stefan', lastName: 'Penner' } - // both properties will accessible on the controller - controller.get('firstName') //=> 'Stefan' - controller.get('lastName') //=> 'Penner' + // both properties will accessible on the proxy + proxy.get('firstName') //=> 'Stefan' + proxy.get('lastName') //=> 'Penner' ``` - If the controller is backing a template, the attributes are - bindable from within that template - - ```handlebars - {{#if isPending}} - loading... - {{else}} - firstName: {{firstName}} - lastName: {{lastName}} - {{/if}} - ``` @class Ember.PromiseProxyMixin @public */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** If the proxied promise is rejected this will contain the reason provided. @property reason @default null @@ -36493,20 +32325,20 @@ The promise whose fulfillment value is being proxied by this object. This property must be specified upon creation, and should not be changed once created. Example: ```javascript - Ember.ObjectController.extend(Ember.PromiseProxyMixin).create({ + Ember.ObjectProxy.extend(Ember.PromiseProxyMixin).create({ promise: <thenable> }); ``` @property promise @public */ promise: _emberMetalComputed.computed({ get: function () { - throw new _emberMetalError["default"]("PromiseProxy's promise must be set"); + throw new _emberMetalError.default('PromiseProxy\'s promise must be set'); }, set: function (key, promise) { return tap(this, promise); } }), @@ -36550,18 +32382,11 @@ var promise = _emberMetalProperty_get.get(this, 'promise'); return promise[name].apply(promise, arguments); }; } }); -enifed("ember-runtime/mixins/sortable", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/enumerable_utils", "ember-runtime/mixins/mutable_enumerable", "ember-runtime/compare", "ember-metal/observer", "ember-metal/computed", "ember-metal/computed_macros", "ember-metal/mixin"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalEnumerable_utils, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeCompare, _emberMetalObserver, _emberMetalComputed, _emberMetalComputed_macros, _emberMetalMixin) { - /** - @module ember - @submodule ember-runtime - */ - - "use strict"; - +enifed('ember-runtime/mixins/sortable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/compare', 'ember-metal/observer', 'ember-metal/computed', 'ember-metal/computed_macros', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeCompare, _emberMetalObserver, _emberMetalComputed, _emberMetalComputed_macros, _emberMetalMixin) { //ES6TODO: should we access these directly from their package or from how their exposed in ember-metal? /** `Ember.SortableMixin` provides a standard interface for array proxies to specify a sort order and maintain this sorting when objects are added, @@ -36613,11 +32438,11 @@ @class SortableMixin @namespace Ember @uses Ember.MutableEnumerable @private */ - exports["default"] = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsMutable_enumerable["default"], { + exports.default = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsMutable_enumerable.default, { /** Specifies which properties dictate the `arrangedContent`'s sort order. When specifying multiple properties the sorting will use properties from the `sortProperties` array prioritized from first to last. @@ -36653,45 +32478,45 @@ @property sortFunction @type {Function} @default Ember.compare @private */ - sortFunction: _emberRuntimeCompare["default"], + sortFunction: _emberRuntimeCompare.default, - init: function () { - this._super.apply(this, arguments); - }, - orderBy: function (item1, item2) { + var _this = this; + var result = 0; var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties'); var sortAscending = _emberMetalProperty_get.get(this, 'sortAscending'); var sortFunction = _emberMetalProperty_get.get(this, 'sortFunction'); - _emberMetalEnumerable_utils.forEach(sortProperties, function (propertyName) { + sortProperties.forEach(function (propertyName) { if (result === 0) { - result = sortFunction.call(this, _emberMetalProperty_get.get(item1, propertyName), _emberMetalProperty_get.get(item2, propertyName)); + result = sortFunction.call(_this, _emberMetalProperty_get.get(item1, propertyName), _emberMetalProperty_get.get(item2, propertyName)); if (result !== 0 && !sortAscending) { result = -1 * result; } } - }, this); + }); return result; }, destroy: function () { + var _this2 = this; + var content = _emberMetalProperty_get.get(this, 'content'); var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties'); if (content && sortProperties) { - _emberMetalEnumerable_utils.forEach(content, function (item) { - _emberMetalEnumerable_utils.forEach(sortProperties, function (sortProperty) { - _emberMetalObserver.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange'); - }, this); - }, this); + content.forEach(function (item) { + sortProperties.forEach(function (sortProperty) { + _emberMetalObserver.removeObserver(item, sortProperty, _this2, 'contentItemSortPropertyDidChange'); + }); + }); } return this._super.apply(this, arguments); }, @@ -36701,44 +32526,49 @@ Overrides the default `arrangedContent` from `ArrayProxy` in order to sort by `sortFunction`. Also sets up observers for each `sortProperty` on each item in the content Array. @property arrangedContent @private */ - arrangedContent: _emberMetalComputed.computed('content', 'sortProperties.[]', { + arrangedContent: _emberMetalComputed.computed('content', 'sortProperties.@each', { get: function (key) { + var _this3 = this; + var content = _emberMetalProperty_get.get(this, 'content'); var isSorted = _emberMetalProperty_get.get(this, 'isSorted'); var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties'); - var self = this; if (content && isSorted) { content = content.slice(); content.sort(function (item1, item2) { - return self.orderBy(item1, item2); + return _this3.orderBy(item1, item2); }); - _emberMetalEnumerable_utils.forEach(content, function (item) { - _emberMetalEnumerable_utils.forEach(sortProperties, function (sortProperty) { - _emberMetalObserver.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange'); - }, this); - }, this); - return _emberMetalCore["default"].A(content); + + content.forEach(function (item) { + sortProperties.forEach(function (sortProperty) { + _emberMetalObserver.addObserver(item, sortProperty, _this3, 'contentItemSortPropertyDidChange'); + }); + }); + + return _emberMetalCore.default.A(content); } return content; } }), _contentWillChange: _emberMetalMixin._beforeObserver('content', function () { + var _this4 = this; + var content = _emberMetalProperty_get.get(this, 'content'); var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties'); if (content && sortProperties) { - _emberMetalEnumerable_utils.forEach(content, function (item) { - _emberMetalEnumerable_utils.forEach(sortProperties, function (sortProperty) { - _emberMetalObserver.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange'); - }, this); - }, this); + content.forEach(function (item) { + sortProperties.forEach(function (sortProperty) { + _emberMetalObserver.removeObserver(item, sortProperty, _this4, 'contentItemSortPropertyDidChange'); + }); + }); } this._super.apply(this, arguments); }), @@ -36760,43 +32590,47 @@ arrangedContent.reverseObjects(); } }), contentArrayWillChange: function (array, idx, removedCount, addedCount) { + var _this5 = this; + var isSorted = _emberMetalProperty_get.get(this, 'isSorted'); if (isSorted) { var arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent'); var removedObjects = array.slice(idx, idx + removedCount); var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties'); - _emberMetalEnumerable_utils.forEach(removedObjects, function (item) { + removedObjects.forEach(function (item) { arrangedContent.removeObject(item); - _emberMetalEnumerable_utils.forEach(sortProperties, function (sortProperty) { - _emberMetalObserver.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange'); - }, this); + sortProperties.forEach(function (sortProperty) { + _emberMetalObserver.removeObserver(item, sortProperty, _this5, 'contentItemSortPropertyDidChange'); + }, _this5); }, this); } return this._super(array, idx, removedCount, addedCount); }, contentArrayDidChange: function (array, idx, removedCount, addedCount) { + var _this6 = this; + var isSorted = _emberMetalProperty_get.get(this, 'isSorted'); var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties'); if (isSorted) { var addedObjects = array.slice(idx, idx + addedCount); - _emberMetalEnumerable_utils.forEach(addedObjects, function (item) { - this.insertItemSorted(item); + addedObjects.forEach(function (item) { + _this6.insertItemSorted(item); - _emberMetalEnumerable_utils.forEach(sortProperties, function (sortProperty) { - _emberMetalObserver.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange'); - }, this); - }, this); + sortProperties.forEach(function (sortProperty) { + _emberMetalObserver.addObserver(item, sortProperty, _this6, 'contentItemSortPropertyDidChange'); + }); + }); } return this._super(array, idx, removedCount, addedCount); }, @@ -36844,17 +32678,17 @@ return mid; } }); }); +/** +@module ember +@submodule ember-runtime +*/ + // Ember.assert, Ember.A -enifed("ember-runtime/mixins/target_action_support", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/mixin", "ember-metal/computed"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin, _emberMetalComputed) { - /** - @module ember - @submodule ember-runtime - */ - "use strict"; +enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/computed'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin, _emberMetalComputed) { /** `Ember.TargetActionSupport` is a mixin that can be included in a class to add a `triggerAction` method with semantics similar to the Handlebars `{{action}}` helper. In normal Ember usage, the `{{action}}` helper is @@ -36882,11 +32716,11 @@ var target = _emberMetalProperty_get.get(this, 'target'); if (typeof target === 'string') { var value = _emberMetalProperty_get.get(this, target); if (value === undefined) { - value = _emberMetalProperty_get.get(_emberMetalCore["default"].lookup, target); + value = _emberMetalProperty_get.get(_emberMetalCore.default.lookup, target); } return value; } else { return target; @@ -36894,14 +32728,14 @@ }), actionContextObject: _emberMetalComputed.computed(function () { var actionContext = _emberMetalProperty_get.get(this, 'actionContext'); - if (typeof actionContext === "string") { + if (typeof actionContext === 'string') { var value = _emberMetalProperty_get.get(this, actionContext); if (value === undefined) { - value = _emberMetalProperty_get.get(_emberMetalCore["default"].lookup, actionContext); + value = _emberMetalProperty_get.get(_emberMetalCore.default.lookup, actionContext); } return value; } else { return actionContext; } @@ -36991,27 +32825,28 @@ return false; } } }); - exports["default"] = TargetActionSupport; + exports.default = TargetActionSupport; }); +/** +@module ember +@submodule ember-runtime +*/ // Ember.lookup, Ember.assert -enifed("ember-runtime/system/application", ["exports", "ember-runtime/system/namespace"], function (exports, _emberRuntimeSystemNamespace) { - "use strict"; - - exports["default"] = _emberRuntimeSystemNamespace["default"].extend(); +enifed('ember-runtime/system/application', ['exports', 'ember-runtime/system/namespace'], function (exports, _emberRuntimeSystemNamespace) { + exports.default = _emberRuntimeSystemNamespace.default.extend(); }); -enifed("ember-runtime/system/array_proxy", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-runtime/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", "ember-metal/alias"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeUtils, _emberMetalComputed, _emberMetalMixin, _emberMetalProperty_events, _emberMetalError, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemString, _emberMetalAlias) { - "use strict"; +enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/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', 'ember-metal/alias'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeUtils, _emberMetalComputed, _emberMetalMixin, _emberMetalProperty_events, _emberMetalError, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemString, _emberMetalAlias) { /** @module ember @submodule ember-runtime */ - var OUT_OF_RANGE_EXCEPTION = "Index out of range"; + var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; var EMPTY = []; function K() { return this; } @@ -37051,13 +32886,13 @@ @class ArrayProxy @namespace Ember @extends Ember.Object @uses Ember.MutableArray - @public + @private */ - var ArrayProxy = _emberRuntimeSystemObject["default"].extend(_emberRuntimeMixinsMutable_array["default"], { + var ArrayProxy = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { /** The content array. Must be an object that implements `Ember.Array` and/or `Ember.MutableArray.` @property content @@ -37071,11 +32906,11 @@ implementation, this and `content` are the same. Subclasses of `ArrayProxy` can override this property to provide things like sorting and filtering. @property arrangedContent @private */ - arrangedContent: _emberMetalAlias["default"]('content'), + arrangedContent: _emberMetalAlias.default('content'), /** Should actually retrieve the object at the specified index from the content. You can override this method in subclasses to transform the content item to something new. @@ -37241,28 +33076,28 @@ replace: function () { if (_emberMetalProperty_get.get(this, 'arrangedContent') === _emberMetalProperty_get.get(this, 'content')) { this._replace.apply(this, arguments); } else { - throw new _emberMetalError["default"]("Using replace on an arranged ArrayProxy is not allowed."); + throw new _emberMetalError.default('Using replace on an arranged ArrayProxy is not allowed.'); } }, _insertAt: function (idx, object) { if (idx > _emberMetalProperty_get.get(this, 'content.length')) { - throw new _emberMetalError["default"](OUT_OF_RANGE_EXCEPTION); + throw new _emberMetalError.default(OUT_OF_RANGE_EXCEPTION); } this._replace(idx, 0, [object]); return this; }, insertAt: function (idx, object) { if (_emberMetalProperty_get.get(this, 'arrangedContent') === _emberMetalProperty_get.get(this, 'content')) { return this._insertAt(idx, object); } else { - throw new _emberMetalError["default"]("Using insertAt on an arranged ArrayProxy is not allowed."); + throw new _emberMetalError.default('Using insertAt on an arranged ArrayProxy is not allowed.'); } }, removeAt: function (start, len) { if ('number' === typeof start) { @@ -37270,11 +33105,11 @@ var arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent'); var indices = []; var i; if (start < 0 || start >= _emberMetalProperty_get.get(this, 'length')) { - throw new _emberMetalError["default"](OUT_OF_RANGE_EXCEPTION); + throw new _emberMetalError.default(OUT_OF_RANGE_EXCEPTION); } if (len === undefined) { len = 1; } @@ -37304,12 +33139,12 @@ this._insertAt(_emberMetalProperty_get.get(this, 'content.length'), obj); return obj; }, pushObjects: function (objects) { - if (!(_emberRuntimeMixinsEnumerable["default"].detect(objects) || _emberRuntimeUtils.isArray(objects))) { - throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects"); + if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || _emberRuntimeUtils.isArray(objects))) { + throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); } this._replace(_emberMetalProperty_get.get(this, 'length'), 0, objects); return this; }, @@ -37356,38 +33191,28 @@ this._teardownArrangedContent(); this._teardownContent(); } }); - exports["default"] = ArrayProxy; + exports.default = ArrayProxy; }); // Ember.assert -enifed("ember-runtime/system/container", ["exports", "ember-metal/property_set", "container/registry", "container/container"], function (exports, _emberMetalProperty_set, _containerRegistry, _containerContainer) { - "use strict"; +enifed('ember-runtime/system/container', ['exports', 'ember-metal/property_set', 'container/registry', 'container/container'], function (exports, _emberMetalProperty_set, _containerRegistry, _containerContainer) { - _containerRegistry["default"].set = _emberMetalProperty_set.set; - _containerContainer["default"].set = _emberMetalProperty_set.set; + _containerRegistry.default.set = _emberMetalProperty_set.set; + _containerContainer.default.set = _emberMetalProperty_set.set; - exports.Registry = _containerRegistry["default"]; - exports.Container = _containerContainer["default"]; + exports.Registry = _containerRegistry.default; + exports.Container = _containerContainer.default; }); -enifed("ember-runtime/system/core_object", ["exports", "ember-metal", "ember-metal/merge", "ember-metal/property_get", "ember-metal/utils", "ember-metal/platform/create", "ember-metal/chains", "ember-metal/events", "ember-metal/mixin", "ember-metal/enumerable_utils", "ember-metal/error", "ember-metal/platform/define_property", "ember-metal/keys", "ember-runtime/mixins/action_handler", "ember-metal/properties", "ember-metal/binding", "ember-metal/computed", "ember-metal/injected_property", "ember-metal/run_loop", "ember-metal/watching", "ember-metal/core", "ember-runtime/inject"], function (exports, _emberMetal, _emberMetalMerge, _emberMetalProperty_get, _emberMetalUtils, _emberMetalPlatformCreate, _emberMetalChains, _emberMetalEvents, _emberMetalMixin, _emberMetalEnumerable_utils, _emberMetalError, _emberMetalPlatformDefine_property, _emberMetalKeys, _emberRuntimeMixinsAction_handler, _emberMetalProperties, _emberMetalBinding, _emberMetalComputed, _emberMetalInjected_property, _emberMetalRun_loop, _emberMetalWatching, _emberMetalCore, _emberRuntimeInject) { +enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-metal/features', 'ember-metal/merge', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/chains', 'ember-metal/events', 'ember-metal/mixin', 'ember-metal/error', 'ember-runtime/mixins/action_handler', 'ember-metal/properties', 'ember-metal/binding', 'ember-metal/computed', 'ember-metal/injected_property', 'ember-metal/run_loop', 'ember-metal/watching', 'ember-metal/core', 'ember-runtime/inject'], function (exports, _emberMetal, _emberMetalFeatures, _emberMetalMerge, _emberMetalProperty_get, _emberMetalUtils, _emberMetalChains, _emberMetalEvents, _emberMetalMixin, _emberMetalError, _emberRuntimeMixinsAction_handler, _emberMetalProperties, _emberMetalBinding, _emberMetalComputed, _emberMetalInjected_property, _emberMetalRun_loop, _emberMetalWatching, _emberMetalCore, _emberRuntimeInject) { // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed // - - "REMOVE_USE_STRICT: true"; + 'REMOVE_USE_STRICT: true'; - /** - @module ember - @submodule ember-runtime - */ - - // using ember-metal/lib/main here to ensure that ember-debug is setup - // if present - - var schedule = _emberMetalRun_loop["default"].schedule; + var schedule = _emberMetalRun_loop.default.schedule; var applyMixin = _emberMetalMixin.Mixin._apply; var finishPartial = _emberMetalMixin.Mixin.finishPartial; var reopen = _emberMetalMixin.Mixin.prototype.reopen; var hasCachedComputedProperties = false; @@ -37426,38 +33251,38 @@ for (var i = 0, l = props.length; i < l; i++) { var properties = props[i]; if (typeof properties !== 'object' && properties !== undefined) { - throw new _emberMetalError["default"]("Ember.Object.create only accepts objects."); + throw new _emberMetalError.default('Ember.Object.create only accepts objects.'); } if (!properties) { continue; } - var keyNames = _emberMetalKeys["default"](properties); + var keyNames = Object.keys(properties); for (var j = 0, ll = keyNames.length; j < ll; j++) { var keyName = keyNames[j]; var value = properties[keyName]; if (_emberMetalMixin.IS_BINDING.test(keyName)) { var bindings = m.bindings; if (!bindings) { bindings = m.bindings = {}; } else if (!m.hasOwnProperty('bindings')) { - bindings = m.bindings = _emberMetalPlatformCreate["default"](m.bindings); + bindings = m.bindings = Object.create(m.bindings); } bindings[keyName] = value; } var possibleDesc = this[keyName]; var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - if (concatenatedProperties && concatenatedProperties.length > 0 && _emberMetalEnumerable_utils.indexOf(concatenatedProperties, keyName) >= 0) { + if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { var baseValue = this[keyName]; if (baseValue) { if ('function' === typeof baseValue.concat) { value = baseValue.concat(value); @@ -37467,25 +33292,23 @@ } else { value = _emberMetalUtils.makeArray(value); } } - if (mergedProperties && mergedProperties.length && _emberMetalEnumerable_utils.indexOf(mergedProperties, keyName) >= 0) { + if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { var originalValue = this[keyName]; - value = _emberMetalMerge["default"](originalValue, value); + value = _emberMetalMerge.default(originalValue, value); } if (desc) { desc.set(this, keyName, value); } else { if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { this.setUnknownProperty(keyName, value); } else { - - this[keyName] = value; - + this[keyName] = value; } } } } } @@ -37550,11 +33373,11 @@ @namespace Ember @public */ var CoreObject = makeCtor(); CoreObject.toString = function () { - return "Ember.CoreObject"; + return 'Ember.CoreObject'; }; CoreObject.PrototypeMixin = _emberMetalMixin.Mixin.create({ reopen: function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; @@ -37587,11 +33410,11 @@ @method init @public */ init: function () {}, __defineNonEnumerable: function (property) { - _emberMetalPlatformDefine_property.defineProperty(this, property.name, property.descriptor); + Object.defineProperty(this, property.name, property.descriptor); //this[property.name] = property.descriptor.value; }, /** Defines the properties that will be concatenated from the superclass @@ -37752,11 +33575,11 @@ @return {String} string representation @public */ toString: function () { var hasToStringExtension = typeof this.toStringExtension === 'function'; - var extension = hasToStringExtension ? ":" + this.toStringExtension() : ''; + var extension = hasToStringExtension ? ':' + this.toStringExtension() : ''; var ret = '<' + this.constructor.toString() + ':' + _emberMetalUtils.guidFor(this) + extension + '>'; this.toString = makeToString(ret); return ret; } @@ -37858,11 +33681,11 @@ reopen.apply(Class.PrototypeMixin, arguments); Class.superclass = this; Class.__super__ = this.prototype; - proto = Class.prototype = _emberMetalPlatformCreate["default"](this.prototype); + proto = Class.prototype = Object.create(this.prototype); proto.constructor = Class; _emberMetalUtils.generateGuid(proto); _emberMetalUtils.meta(proto).proto = proto; // this will disable observers on prototype Class.ClassMixin.apply(Class); @@ -37876,11 +33699,11 @@ @static @param [arguments]* @private @deprecated */ - createWithMixins: _emberMetal["default"].deprecateFunc('.createWithMixins is deprecated, please use .create or .extend accordingly', function () { + createWithMixins: _emberMetal.default.deprecateFunc('.createWithMixins is deprecated, please use .create or .extend accordingly', function () { var C = this; for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } @@ -38121,11 +33944,11 @@ var proto = this.proto(); var key, desc; for (key in proto) { desc = proto[key]; - if (desc instanceof _emberMetalInjected_property["default"]) { + if (desc instanceof _emberMetalInjected_property.default) { injections[key] = desc.type + ':' + (desc.name || key); } } return injections; @@ -38142,56 +33965,39 @@ CoreObject.reopen({ didDefineProperty: function (proto, key, value) { if (hasCachedComputedProperties === false) { return; } - if (value instanceof _emberMetal["default"].ComputedProperty) { - var cache = _emberMetal["default"].meta(this.constructor).cache; + if (value instanceof _emberMetal.default.ComputedProperty) { + var cache = _emberMetal.default.meta(this.constructor).cache; if (cache && cache._computedProperties !== undefined) { cache._computedProperties = undefined; } } } }); - exports["default"] = CoreObject; + exports.default = CoreObject; }); +/** + @module ember + @submodule ember-runtime +*/ +// using ember-metal/lib/main here to ensure that ember-debug is setup +// if present + // Ember.assert, Ember.config // NOTE: this object should never be included directly. Instead use `Ember.Object`. // We only define this separately so that `Ember.Set` can depend on it. -enifed("ember-runtime/system/deferred", ["exports", "ember-metal/core", "ember-runtime/mixins/deferred", "ember-runtime/system/object"], function (exports, _emberMetalCore, _emberRuntimeMixinsDeferred, _emberRuntimeSystemObject) { - "use strict"; +// setup mandatory setter +enifed('ember-runtime/system/each_proxy', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils', 'ember-runtime/utils', 'ember-runtime/mixins/array', 'ember-runtime/system/object', 'ember-metal/computed', 'ember-metal/observer', 'ember-metal/events', 'ember-metal/properties', 'ember-metal/property_events'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberRuntimeUtils, _emberRuntimeMixinsArray, _emberRuntimeSystemObject, _emberMetalComputed, _emberMetalObserver, _emberMetalEvents, _emberMetalProperties, _emberMetalProperty_events) { - var Deferred = _emberRuntimeSystemObject["default"].extend(_emberRuntimeMixinsDeferred["default"], { - init: function () { - this._super.apply(this, arguments); - } - }); + var EachArray = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsArray.default, { - Deferred.reopenClass({ - promise: function (callback, binding) { - var deferred = Deferred.create(); - callback.call(binding, deferred); - return deferred; - } - }); - - exports["default"] = Deferred; -}); -enifed("ember-runtime/system/each_proxy", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/utils", "ember-runtime/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"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberRuntimeUtils, _emberMetalEnumerable_utils, _emberMetalArray, _emberRuntimeMixinsArray, _emberRuntimeSystemObject, _emberMetalComputed, _emberMetalObserver, _emberMetalEvents, _emberMetalProperties, _emberMetalProperty_events) { - /** - @module ember - @submodule ember-runtime - */ - - "use strict"; - - var EachArray = _emberRuntimeSystemObject["default"].extend(_emberRuntimeMixinsArray["default"], { - init: function (content, keyName, owner) { this._super.apply(this, arguments); this._keyName = keyName; this._owner = owner; this._content = content; @@ -38250,11 +34056,11 @@ _emberMetalObserver._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); _emberMetalObserver.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); guid = _emberMetalUtils.guidFor(item); indices = objects[guid]; - indices[_emberMetalArray.indexOf.call(indices, loc)] = null; + indices[indices.indexOf(loc)] = null; } } } /** @@ -38262,22 +34068,24 @@ array. It uses the unknownProperty handler to automatically create EachArray instances for property names. @class EachProxy @private */ - var EachProxy = _emberRuntimeSystemObject["default"].extend({ + var EachProxy = _emberRuntimeSystemObject.default.extend({ init: function (content) { + var _this = this; + this._super.apply(this, arguments); this._content = content; content.addArrayObserver(this); // in case someone is already observing some keys make sure they are // added - _emberMetalEnumerable_utils.forEach(_emberMetalEvents.watchedEvents(this), function (eventName) { - this.didAddListener(eventName); - }, this); + _emberMetalEvents.watchedEvents(this).forEach(function (eventName) { + _this.didAddListener(eventName); + }); }, /** You can directly access mapped properties by simply requesting them. The `unknownProperty` handler will generate an EachArray of each item. @@ -38399,32 +34207,31 @@ }); exports.EachArray = EachArray; exports.EachProxy = EachProxy; }); +/** +@module ember +@submodule ember-runtime +*/ + // Ember.assert // ES6TODO: WAT? Circular dep? -enifed("ember-runtime/system/lazy_load", ["exports", "ember-metal/core", "ember-metal/array", "ember-runtime/system/native_array"], function (exports, _emberMetalCore, _emberMetalArray, _emberRuntimeSystemNative_array) { - /*globals CustomEvent */ - - "use strict"; - +enifed('ember-runtime/system/lazy_load', ['exports', 'ember-metal/core', 'ember-runtime/system/native_array'], function (exports, _emberMetalCore, _emberRuntimeSystemNative_array) { exports.onLoad = onLoad; exports.runLoadHooks = runLoadHooks; // make sure Ember.A is setup. /** @module ember @submodule ember-runtime */ - var loadHooks = _emberMetalCore["default"].ENV.EMBER_LOAD_HOOKS || {}; + var loadHooks = _emberMetalCore.default.ENV.EMBER_LOAD_HOOKS || {}; var loaded = {}; - var _loaded = loaded; - exports._loaded = _loaded; /** Detects when a specific package of Ember (e.g. 'Ember.Application') has fully loaded and is available for extension. The provided `callback` will be called with the `name` passed @@ -38442,16 +34249,16 @@ @param callback {Function} callback to be called @private */ function onLoad(name, callback) { - var object = loaded[name]; + var object; - loadHooks[name] = loadHooks[name] || _emberMetalCore["default"].A(); + loadHooks[name] = loadHooks[name] || _emberMetalCore.default.A(); loadHooks[name].pushObject(callback); - if (object) { + if (object = loaded[name]) { callback(object); } } /** @@ -38466,32 +34273,27 @@ */ function runLoadHooks(name, object) { loaded[name] = object; - if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === "function") { + if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === 'function') { var event = new CustomEvent(name, { detail: object, name: name }); window.dispatchEvent(event); } if (loadHooks[name]) { - _emberMetalArray.forEach.call(loadHooks[name], function (callback) { - callback(object); + loadHooks[name].forEach(function (callback) { + return callback(object); }); } } }); +/*globals CustomEvent */ + // Ember.ENV.EMBER_LOAD_HOOKS -enifed("ember-runtime/system/namespace", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/array", "ember-metal/utils", "ember-metal/mixin", "ember-runtime/system/object"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalArray, _emberMetalUtils, _emberMetalMixin, _emberRuntimeSystemObject) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-runtime/system/namespace', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/mixin', 'ember-runtime/system/object'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberMetalMixin, _emberRuntimeSystemObject) { - // Ember.lookup, Ember.BOOTED, Ember.deprecate, Ember.NAME_KEY, Ember.anyUnprocessedMixins - "use strict"; - /** A Namespace is an object usually used to contain other objects or methods such as an application or framework. Create a namespace anytime you want to define one of these new containers. @@ -38506,11 +34308,11 @@ @class Namespace @namespace Ember @extends Ember.Object @public */ - var Namespace = _emberRuntimeSystemObject["default"].extend({ + var Namespace = _emberRuntimeSystemObject.default.extend({ isNamespace: true, init: function () { Namespace.NAMESPACES.push(this); Namespace.PROCESSED = false; @@ -38533,25 +34335,25 @@ destroy: function () { var namespaces = Namespace.NAMESPACES; var toString = this.toString(); if (toString) { - _emberMetalCore["default"].lookup[toString] = undefined; + _emberMetalCore.default.lookup[toString] = undefined; delete Namespace.NAMESPACES_BY_ID[toString]; } - namespaces.splice(_emberMetalArray.indexOf.call(namespaces, this), 1); + namespaces.splice(namespaces.indexOf(this), 1); this._super.apply(this, arguments); } }); Namespace.reopenClass({ - NAMESPACES: [_emberMetalCore["default"]], + NAMESPACES: [_emberMetalCore.default], NAMESPACES_BY_ID: {}, PROCESSED: false, processAll: processAllNamespaces, byName: function (name) { - if (!_emberMetalCore["default"].BOOTED) { + if (!_emberMetalCore.default.BOOTED) { processAllNamespaces(); } return NAMESPACES_BY_ID[name]; } @@ -38587,19 +34389,19 @@ obj.toString = makeToString(paths.join('.')); obj[NAME_KEY] = paths.join('.'); // Support nested namespaces } else if (obj && obj.isNamespace) { - // Skip aliased namespaces - if (seen[_emberMetalUtils.guidFor(obj)]) { - continue; - } - seen[_emberMetalUtils.guidFor(obj)] = true; - - // Process the child namespace - processNamespace(paths, obj, seen); + // Skip aliased namespaces + if (seen[_emberMetalUtils.guidFor(obj)]) { + continue; } + seen[_emberMetalUtils.guidFor(obj)] = true; + + // Process the child namespace + processNamespace(paths, obj, seen); + } } paths.length = idx; // cut out last item } @@ -38607,17 +34409,15 @@ function tryIsNamespace(lookup, prop) { try { var obj = lookup[prop]; return obj && obj.isNamespace && obj; - } catch (e) { - // continue - } + } catch (e) {} } function findNamespaces() { - var lookup = _emberMetalCore["default"].lookup; + var lookup = _emberMetalCore.default.lookup; var obj; if (Namespace.PROCESSED) { return; } @@ -38640,11 +34440,11 @@ obj[NAME_KEY] = prop; } } } - var NAME_KEY = _emberMetalCore["default"].NAME_KEY = _emberMetalUtils.GUID_KEY + '_name'; + var NAME_KEY = _emberMetalCore.default.NAME_KEY = _emberMetalUtils.GUID_KEY + '_name'; function superClassString(mixin) { var superclass = mixin.superclass; if (superclass) { if (superclass[NAME_KEY]) { @@ -38656,11 +34456,11 @@ return; } } function classToString() { - if (!_emberMetalCore["default"].BOOTED && !this[NAME_KEY]) { + if (!_emberMetalCore.default.BOOTED && !this[NAME_KEY]) { processAllNamespaces(); } var ret; @@ -38669,23 +34469,23 @@ } else if (this._toString) { ret = this._toString; } else { var str = superClassString(this); if (str) { - ret = "(subclass of " + str + ")"; + ret = '(subclass of ' + str + ')'; } else { - ret = "(unknown mixin)"; + ret = '(unknown mixin)'; } this.toString = makeToString(ret); } return ret; } function processAllNamespaces() { var unprocessedNamespaces = !Namespace.PROCESSED; - var unprocessedMixins = _emberMetalCore["default"].anyUnprocessedMixins; + var unprocessedMixins = _emberMetalCore.default.anyUnprocessedMixins; if (unprocessedNamespaces) { findNamespaces(); Namespace.PROCESSED = true; } @@ -38697,11 +34497,11 @@ for (var i = 0, l = namespaces.length; i < l; i++) { namespace = namespaces[i]; processNamespace([namespace.toString()], namespace, {}); } - _emberMetalCore["default"].anyUnprocessedMixins = false; + _emberMetalCore.default.anyUnprocessedMixins = false; } } function makeToString(ret) { return function () { @@ -38709,20 +34509,22 @@ }; } _emberMetalMixin.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. - exports["default"] = Namespace; + exports.default = Namespace; }); -enifed("ember-runtime/system/native_array", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/enumerable_utils", "ember-metal/mixin", "ember-metal/array", "ember-runtime/mixins/array", "ember-runtime/mixins/mutable_array", "ember-runtime/mixins/observable", "ember-runtime/mixins/copyable", "ember-runtime/mixins/freezable", "ember-runtime/copy"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalEnumerable_utils, _emberMetalMixin, _emberMetalArray, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsObservable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeCopy) { - /** - @module ember - @submodule ember-runtime - */ +/** +@module ember +@submodule ember-runtime +*/ - "use strict"; +// Ember.lookup, Ember.BOOTED, Ember.deprecate, Ember.NAME_KEY, Ember.anyUnprocessedMixins +// continue +enifed('ember-runtime/system/native_array', ['exports', 'ember-metal/core', 'ember-metal/replace', 'ember-metal/property_get', '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'], function (exports, _emberMetalCore, _emberMetalReplace, _emberMetalProperty_get, _emberMetalMixin, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsObservable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeCopy) { + // Add Ember.Array to Array.prototype. Remove methods with native // implementations and supply some more optimized versions of generic methods // because they are so common. /** @@ -38737,11 +34539,11 @@ @uses Ember.MutableArray @uses Ember.Observable @uses Ember.Copyable @public */ - var NativeArray = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsMutable_array["default"], _emberRuntimeMixinsObservable["default"], _emberRuntimeMixinsCopyable["default"], { + var NativeArray = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsMutable_array.default, _emberRuntimeMixinsObservable.default, _emberRuntimeMixinsCopyable.default, { // because length is a built-in property we need to know to just get the // original property. get: function (key) { if (key === 'length') { @@ -38771,11 +34573,11 @@ this.arrayContentWillChange(idx, amt, len); if (len === 0) { this.splice(idx, amt); } else { - _emberMetalEnumerable_utils._replace(this, idx, amt, objects); + _emberMetalReplace._replace(this, idx, amt, objects); } this.arrayContentDidChange(idx, amt, len); return this; }, @@ -38788,28 +34590,27 @@ ret = this[key] = value; } return ret; }, - indexOf: _emberMetalArray.indexOf, + indexOf: Array.prototype.indexOf, + lastIndexOf: Array.prototype.lastIndexOf, - lastIndexOf: _emberMetalArray.lastIndexOf, - copy: function (deep) { if (deep) { return this.map(function (item) { - return _emberRuntimeCopy["default"](item, true); + return _emberRuntimeCopy.default(item, true); }); } return this.slice(); } }); // Remove any methods implemented natively so we don't override them var ignore = ['length']; - _emberMetalEnumerable_utils.forEach(NativeArray.keys(), function (methodName) { + NativeArray.keys().forEach(function (methodName) { if (Array.prototype[methodName]) { ignore.push(methodName); } }); @@ -38847,11 +34648,11 @@ */ var A = function (arr) { if (arr === undefined) { arr = []; } - return _emberRuntimeMixinsArray["default"].detect(arr) ? arr : NativeArray.apply(arr); + return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr); }; /** Activates the mixin on the Array.prototype if not already applied. Calling this method more than once is safe. This will be called when ember is loaded @@ -38873,33 +34674,32 @@ @private */ NativeArray.activate = function () { NativeArray.apply(Array.prototype); - exports. // ES6TODO: Setting A onto the object returned by ember-metal/core to avoid circles - A = A = function (arr) { + exports.A = A = function (arr) { return arr || []; }; }; - if (_emberMetalCore["default"].EXTEND_PROTOTYPES === true || _emberMetalCore["default"].EXTEND_PROTOTYPES.Array) { + if (_emberMetalCore.default.EXTEND_PROTOTYPES === true || _emberMetalCore.default.EXTEND_PROTOTYPES.Array) { NativeArray.activate(); } - _emberMetalCore["default"].A = A;exports.A = A; + _emberMetalCore.default.A = A; // ES6TODO: Setting A onto the object returned by ember-metal/core to avoid circles + exports.A = A; exports.NativeArray = NativeArray; - exports["default"] = NativeArray; + exports.default = NativeArray; }); +/** +@module ember +@submodule ember-runtime +*/ + // Ember.EXTEND_PROTOTYPES -enifed("ember-runtime/system/object", ["exports", "ember-runtime/system/core_object", "ember-runtime/mixins/observable"], function (exports, _emberRuntimeSystemCore_object, _emberRuntimeMixinsObservable) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-runtime/system/object', ['exports', 'ember-runtime/system/core_object', 'ember-runtime/mixins/observable'], function (exports, _emberRuntimeSystemCore_object, _emberRuntimeMixinsObservable) { - "use strict"; - /** `Ember.Object` is the main base class for all Ember objects. It is a subclass of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details, see the documentation for each of these. @@ -38907,19 +34707,22 @@ @namespace Ember @extends Ember.CoreObject @uses Ember.Observable @public */ - var EmberObject = _emberRuntimeSystemCore_object["default"].extend(_emberRuntimeMixinsObservable["default"]); + var EmberObject = _emberRuntimeSystemCore_object.default.extend(_emberRuntimeMixinsObservable.default); EmberObject.toString = function () { - return "Ember.Object"; + return 'Ember.Object'; }; - exports["default"] = EmberObject; + exports.default = EmberObject; }); -enifed("ember-runtime/system/object_proxy", ["exports", "ember-runtime/system/object", "ember-runtime/mixins/-proxy"], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsProxy) { - "use strict"; +/** +@module ember +@submodule ember-runtime +*/ +enifed('ember-runtime/system/object_proxy', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/-proxy'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsProxy) { /** `Ember.ObjectProxy` forwards all properties not defined by the proxy itself to a proxied `content` object. @@ -38987,14 +34790,13 @@ @extends Ember.Object @extends Ember._ProxyMixin @private */ - exports["default"] = _emberRuntimeSystemObject["default"].extend(_emberRuntimeMixinsProxy["default"]); + exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsProxy.default); }); enifed('ember-runtime/system/service', ['exports', 'ember-runtime/system/object', 'ember-runtime/inject'], function (exports, _emberRuntimeSystemObject, _emberRuntimeInject) { - 'use strict'; /** Creates a property that lazily looks up a service in the container. There are no restrictions as to what objects a service can be injected into. @@ -39029,548 +34831,66 @@ @namespace Ember @extends Ember.Object @since 1.10.0 @public */ - var Service = _emberRuntimeSystemObject["default"].extend(); + var Service = _emberRuntimeSystemObject.default.extend(); Service.reopenClass({ isServiceFactory: true }); - exports["default"] = Service; + exports.default = Service; }); -enifed("ember-runtime/system/set", ["exports", "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"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalIs_none, _emberRuntimeSystemString, _emberRuntimeSystemCore_object, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberMetalError, _emberMetalProperty_events, _emberMetalMixin, _emberMetalComputed) { - /** - @module ember - @submodule ember-runtime - */ - "use strict"; +enifed('ember-runtime/system/string', ['exports', 'ember-metal/core', 'ember-metal/utils', 'ember-runtime/utils', 'ember-metal/cache'], function (exports, _emberMetalCore, _emberMetalUtils, _emberRuntimeUtils, _emberMetalCache) { - /** - An unordered collection of objects. - - A Set works a bit like an array except that its items are not ordered. You - can create a set to efficiently test for membership for an object. You can - also iterate through a set just like an array, even accessing objects by - index, however there is no guarantee as to their order. - - All Sets are observable via the Enumerable Observer API - which works - on any enumerable object including both Sets and Arrays. - - ## Creating a Set - - You can create a set like you would most objects using - `new Ember.Set()`. Most new sets you create will be empty, but you can - also initialize the set with some content by passing an array or other - enumerable of objects to the constructor. - - Finally, you can pass in an existing set and the set will be copied. You - can also create a copy of a set by calling `Ember.Set#copy()`. - - ```javascript - // creates a new empty set - var foundNames = new Ember.Set(); - - // creates a set with four names in it. - var names = new Ember.Set(["Charles", "Tom", "Juan", "Alex"]); // :P - - // creates a copy of the names set. - var namesCopy = new Ember.Set(names); - - // same as above. - var anotherNamesCopy = names.copy(); - ``` - - ## Adding/Removing Objects - - You generally add or remove objects from a set using `add()` or - `remove()`. You can add any type of object including primitives such as - numbers, strings, and booleans. - - Unlike arrays, objects can only exist one time in a set. If you call `add()` - on a set with the same object multiple times, the object will only be added - once. Likewise, calling `remove()` with the same object multiple times will - remove the object the first time and have no effect on future calls until - you add the object to the set again. - - NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do - so will be ignored. - - In addition to add/remove you can also call `push()`/`pop()`. Push behaves - just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary - object, remove it and return it. This is a good way to use a set as a job - queue when you don't care which order the jobs are executed in. - - ## Testing for an Object - - To test for an object's presence in a set you simply call - `Ember.Set#contains()`. - - ## Observing changes - - When using `Ember.Set`, you can observe the `"[]"` property to be - alerted whenever the content changes. You can also add an enumerable - observer to the set to be notified of specific objects that are added and - removed from the set. See [Ember.Enumerable](/api/classes/Ember.Enumerable.html) - for more information on enumerables. - - This is often unhelpful. If you are filtering sets of objects, for instance, - it is very inefficient to re-filter all of the items each time the set - changes. It would be better if you could just adjust the filtered set based - on what was changed on the original set. The same issue applies to merging - sets, as well. - - ## Other Methods - - `Ember.Set` primary implements other mixin APIs. For a complete reference - on the methods you will use with `Ember.Set`, please consult these mixins. - The most useful ones will be `Ember.Enumerable` and - `Ember.MutableEnumerable` which implement most of the common iterator - methods you are used to on Array. - - Note that you can also use the `Ember.Copyable` and `Ember.Freezable` - APIs on `Ember.Set` as well. Once a set is frozen it can no longer be - modified. The benefit of this is that when you call `frozenCopy()` on it, - Ember will avoid making copies of the set. This allows you to write - code that can know with certainty when the underlying set data will or - will not be modified. - - @class Set - @namespace Ember - @extends Ember.CoreObject - @uses Ember.MutableEnumerable - @uses Ember.Copyable - @uses Ember.Freezable - @since Ember 0.9 - @deprecated - @private - */ - exports["default"] = _emberRuntimeSystemCore_object["default"].extend(_emberRuntimeMixinsMutable_enumerable["default"], _emberRuntimeMixinsCopyable["default"], _emberRuntimeMixinsFreezable.Freezable, { - - // .......................................................... - // IMPLEMENT ENUMERABLE APIS - // - - /** - This property will change as the number of objects in the set changes. - @property length - @type number - @default 0 - @private - */ - length: 0, - - /** - Clears the set. This is useful if you want to reuse an existing set - without having to recreate it. - ```javascript - var colors = new Ember.Set(["red", "green", "blue"]); - colors.length; // 3 - colors.clear(); - colors.length; // 0 - ``` - @method clear - @return {Ember.Set} An empty Set - @private - */ - clear: function () { - if (this.isFrozen) { - throw new _emberMetalError["default"](_emberRuntimeMixinsFreezable.FROZEN_ERROR); - } - - var len = _emberMetalProperty_get.get(this, 'length'); - if (len === 0) { - return this; - } - - var guid; - - this.enumerableContentWillChange(len, 0); - _emberMetalProperty_events.propertyWillChange(this, 'firstObject'); - _emberMetalProperty_events.propertyWillChange(this, 'lastObject'); - - for (var i = 0; i < len; i++) { - guid = _emberMetalUtils.guidFor(this[i]); - delete this[guid]; - delete this[i]; - } - - _emberMetalProperty_set.set(this, 'length', 0); - - _emberMetalProperty_events.propertyDidChange(this, 'firstObject'); - _emberMetalProperty_events.propertyDidChange(this, 'lastObject'); - this.enumerableContentDidChange(len, 0); - - return this; - }, - - /** - Returns true if the passed object is also an enumerable that contains the - same objects as the receiver. - ```javascript - var colors = ["red", "green", "blue"], - same_colors = new Ember.Set(colors); - same_colors.isEqual(colors); // true - same_colors.isEqual(["purple", "brown"]); // false - ``` - @method isEqual - @param {Ember.Set} obj the other object. - @return {Boolean} - @private - */ - isEqual: function (obj) { - // fail fast - if (!_emberRuntimeMixinsEnumerable["default"].detect(obj)) { - return false; - } - - var loc = _emberMetalProperty_get.get(this, 'length'); - if (_emberMetalProperty_get.get(obj, 'length') !== loc) { - return false; - } - - while (--loc >= 0) { - if (!obj.contains(this[loc])) { - return false; - } - } - - return true; - }, - - /** - Adds an object to the set. Only non-`null` objects can be added to a set - and those can only be added once. If the object is already in the set or - the passed value is null this method will have no effect. - This is an alias for `Ember.MutableEnumerable.addObject()`. - ```javascript - var colors = new Ember.Set(); - colors.add("blue"); // ["blue"] - colors.add("blue"); // ["blue"] - colors.add("red"); // ["blue", "red"] - colors.add(null); // ["blue", "red"] - colors.add(undefined); // ["blue", "red"] - ``` - @method add - @param {Object} obj The object to add. - @return {Ember.Set} The set itself. - @private - */ - add: _emberMetalMixin.aliasMethod('addObject'), - - /** - Removes the object from the set if it is found. If you pass a `null` value - or an object that is already not in the set, this method will have no - effect. This is an alias for `Ember.MutableEnumerable.removeObject()`. - ```javascript - var colors = new Ember.Set(["red", "green", "blue"]); - colors.remove("red"); // ["blue", "green"] - colors.remove("purple"); // ["blue", "green"] - colors.remove(null); // ["blue", "green"] - ``` - @method remove - @param {Object} obj The object to remove - @return {Ember.Set} The set itself. - @private - */ - remove: _emberMetalMixin.aliasMethod('removeObject'), - - /** - Removes the last element from the set and returns it, or `null` if it's empty. - ```javascript - var colors = new Ember.Set(["green", "blue"]); - colors.pop(); // "blue" - colors.pop(); // "green" - colors.pop(); // null - ``` - @method pop - @return {Object} The removed object from the set or null. - @private - */ - pop: function () { - if (_emberMetalProperty_get.get(this, 'isFrozen')) { - throw new _emberMetalError["default"](_emberRuntimeMixinsFreezable.FROZEN_ERROR); - } - - var obj = this.length > 0 ? this[this.length - 1] : null; - this.remove(obj); - return obj; - }, - - /** - Inserts the given object on to the end of the set. It returns - the set itself. - This is an alias for `Ember.MutableEnumerable.addObject()`. - ```javascript - var colors = new Ember.Set(); - colors.push("red"); // ["red"] - colors.push("green"); // ["red", "green"] - colors.push("blue"); // ["red", "green", "blue"] - ``` - @method push - @return {Ember.Set} The set itself. - @private - */ - push: _emberMetalMixin.aliasMethod('addObject'), - - /** - Removes the last element from the set and returns it, or `null` if it's empty. - This is an alias for `Ember.Set.pop()`. - ```javascript - var colors = new Ember.Set(["green", "blue"]); - colors.shift(); // "blue" - colors.shift(); // "green" - colors.shift(); // null - ``` - @method shift - @return {Object} The removed object from the set or null. - @private - */ - shift: _emberMetalMixin.aliasMethod('pop'), - - /** - Inserts the given object on to the end of the set. It returns - the set itself. - This is an alias of `Ember.Set.push()` - ```javascript - var colors = new Ember.Set(); - colors.unshift("red"); // ["red"] - colors.unshift("green"); // ["red", "green"] - colors.unshift("blue"); // ["red", "green", "blue"] - ``` - @method unshift - @return {Ember.Set} The set itself. - @private - */ - unshift: _emberMetalMixin.aliasMethod('push'), - - /** - Adds each object in the passed enumerable to the set. - This is an alias of `Ember.MutableEnumerable.addObjects()` - ```javascript - var colors = new Ember.Set(); - colors.addEach(["red", "green", "blue"]); // ["red", "green", "blue"] - ``` - @method addEach - @param {Ember.Enumerable} objects the objects to add. - @return {Ember.Set} The set itself. - @private - */ - addEach: _emberMetalMixin.aliasMethod('addObjects'), - - /** - Removes each object in the passed enumerable to the set. - This is an alias of `Ember.MutableEnumerable.removeObjects()` - ```javascript - var colors = new Ember.Set(["red", "green", "blue"]); - colors.removeEach(["red", "blue"]); // ["green"] - ``` - @method removeEach - @param {Ember.Enumerable} objects the objects to remove. - @return {Ember.Set} The set itself. - @private - */ - removeEach: _emberMetalMixin.aliasMethod('removeObjects'), - - // .......................................................... - // PRIVATE ENUMERABLE SUPPORT - // - - init: function (items) { - this._super.apply(this, arguments); - - if (items) { - this.addObjects(items); - } - }, - - // implement Ember.Enumerable - nextObject: function (idx) { - return this[idx]; - }, - - // more optimized version - firstObject: _emberMetalComputed.computed(function () { - return this.length > 0 ? this[0] : undefined; - }), - - // more optimized version - lastObject: _emberMetalComputed.computed(function () { - return this.length > 0 ? this[this.length - 1] : undefined; - }), - - // implements Ember.MutableEnumerable - addObject: function (obj) { - if (_emberMetalProperty_get.get(this, 'isFrozen')) { - throw new _emberMetalError["default"](_emberRuntimeMixinsFreezable.FROZEN_ERROR); - } - - if (_emberMetalIs_none["default"](obj)) { - return this; // nothing to do - } - - var guid = _emberMetalUtils.guidFor(obj); - var idx = this[guid]; - var len = _emberMetalProperty_get.get(this, 'length'); - var added; - - if (idx >= 0 && idx < len && this[idx] === obj) { - return this; // added - } - - added = [obj]; - - this.enumerableContentWillChange(null, added); - _emberMetalProperty_events.propertyWillChange(this, 'lastObject'); - - len = _emberMetalProperty_get.get(this, 'length'); - this[guid] = len; - this[len] = obj; - _emberMetalProperty_set.set(this, 'length', len + 1); - - _emberMetalProperty_events.propertyDidChange(this, 'lastObject'); - this.enumerableContentDidChange(null, added); - - return this; - }, - - // implements Ember.MutableEnumerable - removeObject: function (obj) { - if (_emberMetalProperty_get.get(this, 'isFrozen')) { - throw new _emberMetalError["default"](_emberRuntimeMixinsFreezable.FROZEN_ERROR); - } - - if (_emberMetalIs_none["default"](obj)) { - return this; // nothing to do - } - - var guid = _emberMetalUtils.guidFor(obj); - var idx = this[guid]; - var len = _emberMetalProperty_get.get(this, 'length'); - var isFirst = idx === 0; - var isLast = idx === len - 1; - var last, removed; - - if (idx >= 0 && idx < len && this[idx] === obj) { - removed = [obj]; - - this.enumerableContentWillChange(removed, null); - if (isFirst) { - _emberMetalProperty_events.propertyWillChange(this, 'firstObject'); - } - if (isLast) { - _emberMetalProperty_events.propertyWillChange(this, 'lastObject'); - } - - // swap items - basically move the item to the end so it can be removed - if (idx < len - 1) { - last = this[len - 1]; - this[idx] = last; - this[_emberMetalUtils.guidFor(last)] = idx; - } - - delete this[guid]; - delete this[len - 1]; - _emberMetalProperty_set.set(this, 'length', len - 1); - - if (isFirst) { - _emberMetalProperty_events.propertyDidChange(this, 'firstObject'); - } - if (isLast) { - _emberMetalProperty_events.propertyDidChange(this, 'lastObject'); - } - this.enumerableContentDidChange(removed, null); - } - - return this; - }, - - // optimized version - contains: function (obj) { - return this[_emberMetalUtils.guidFor(obj)] >= 0; - }, - - copy: function () { - var C = this.constructor; - var ret = new C(); - var loc = _emberMetalProperty_get.get(this, 'length'); - - _emberMetalProperty_set.set(ret, 'length', loc); - while (--loc >= 0) { - ret[loc] = this[loc]; - ret[_emberMetalUtils.guidFor(this[loc])] = loc; - } - return ret; - }, - - toString: function () { - var len = this.length; - var array = []; - var idx; - - for (idx = 0; idx < len; idx++) { - array[idx] = this[idx]; - } - return _emberRuntimeSystemString.fmt("Ember.Set<%@>", [array.join(',')]); - } - }); -}); -// Ember.isNone, Ember.A -enifed("ember-runtime/system/string", ["exports", "ember-metal/core", "ember-metal/utils", "ember-runtime/utils", "ember-metal/cache"], function (exports, _emberMetalCore, _emberMetalUtils, _emberRuntimeUtils, _emberMetalCache) { - /** - @module ember - @submodule ember-runtime - */ - "use strict"; - var STRING_DASHERIZE_REGEXP = /[ _]/g; - var STRING_DASHERIZE_CACHE = new _emberMetalCache["default"](1000, function (key) { + var STRING_DASHERIZE_CACHE = new _emberMetalCache.default(1000, function (key) { return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); }); var STRING_CAMELIZE_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g; var STRING_CAMELIZE_REGEXP_2 = /(^|\/)([A-Z])/g; - var CAMELIZE_CACHE = new _emberMetalCache["default"](1000, function (key) { + var CAMELIZE_CACHE = new _emberMetalCache.default(1000, function (key) { return key.replace(STRING_CAMELIZE_REGEXP_1, function (match, separator, chr) { return chr ? chr.toUpperCase() : ''; }).replace(STRING_CAMELIZE_REGEXP_2, function (match, separator, chr) { return match.toLowerCase(); }); }); var STRING_CLASSIFY_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g; var STRING_CLASSIFY_REGEXP_2 = /(^|\/|\.)([a-z])/g; - var CLASSIFY_CACHE = new _emberMetalCache["default"](1000, function (str) { + var CLASSIFY_CACHE = new _emberMetalCache.default(1000, function (str) { return str.replace(STRING_CLASSIFY_REGEXP_1, function (match, separator, chr) { return chr ? chr.toUpperCase() : ''; }).replace(STRING_CLASSIFY_REGEXP_2, function (match, separator, chr) { return match.toUpperCase(); }); }); var STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g; var STRING_UNDERSCORE_REGEXP_2 = /\-|\s+/g; - var UNDERSCORE_CACHE = new _emberMetalCache["default"](1000, function (str) { + var UNDERSCORE_CACHE = new _emberMetalCache.default(1000, function (str) { return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); }); var STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z])/g; - var CAPITALIZE_CACHE = new _emberMetalCache["default"](1000, function (str) { + var CAPITALIZE_CACHE = new _emberMetalCache.default(1000, function (str) { return str.replace(STRING_CAPITALIZE_REGEXP, function (match, separator, chr) { return match.toUpperCase(); }); }); var STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; - var DECAMELIZE_CACHE = new _emberMetalCache["default"](1000, function (str) { + var DECAMELIZE_CACHE = new _emberMetalCache.default(1000, function (str) { return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); }); function fmt(str, formats) { var cachedFormats = formats; @@ -39595,11 +34915,11 @@ function loc(str, formats) { if (!_emberRuntimeUtils.isArray(formats) || arguments.length > 2) { formats = Array.prototype.slice.call(arguments, 1); } - str = _emberMetalCore["default"].STRINGS[str] || str; + str = _emberMetalCore.default.STRINGS[str] || str; return fmt(str, formats); } function w(str) { return str.split(/\s+/); @@ -39637,11 +34957,11 @@ @property STRINGS @for Ember @type Object @private */ - _emberMetalCore["default"].STRINGS = {}; + _emberMetalCore.default.STRINGS = {}; /** Defines string helper methods including string formatting and localization. Unless `Ember.EXTEND_PROTOTYPES.String` is `false` these methods will also be added to the `String.prototype` as well. @@ -39649,11 +34969,11 @@ @class String @namespace Ember @static @public */ - exports["default"] = { + exports.default = { /** Apply formatting options to the string. This will look for occurrences of "%@" in your string and substitute them with the arguments you pass into this method. If you want to control the specific order of replacement, you can add a number after the key as well to indicate which argument @@ -39819,36 +35139,38 @@ exports.camelize = camelize; exports.classify = classify; exports.underscore = underscore; exports.capitalize = capitalize; }); -// Ember.STRINGS, Ember.FEATURES -enifed("ember-runtime/system/subarray", ["exports", "ember-metal/core", "ember-metal/error", "ember-metal/enumerable_utils"], function (exports, _emberMetalCore, _emberMetalError, _emberMetalEnumerable_utils) { - "use strict"; +/** +@module ember +@submodule ember-runtime +*/ +// Ember.STRINGS +enifed('ember-runtime/system/subarray', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) { var RETAIN = 'r'; var FILTER = 'f'; function Operation(type, count) { this.type = type; this.count = count; } - exports["default"] = SubArray; + exports.default = SubArray; /** An `Ember.SubArray` tracks an array in a way similar to, but more specialized than, `Ember.TrackedArray`. It is useful for keeping track of the indexes of items within a filtered array. @class SubArray @namespace Ember @private */ - function SubArray(length, _suppressDeprecation) { - - if (length === undefined) { + function SubArray(length) { + if (arguments.length < 1) { length = 0; } if (length > 0) { this._operations = [new Operation(RETAIN, length)]; @@ -39931,11 +35253,11 @@ } else { self._operations.splice(operationIndex, 1); self._composeAt(operationIndex); } }, function () { - throw new _emberMetalError["default"]("Can't remove an item that has never been added."); + throw new _emberMetalError.default('Can\'t remove an item that has never been added.'); }); return returnValue; }, @@ -39987,26 +35309,25 @@ } } }, toString: function () { - var str = ""; - _emberMetalEnumerable_utils.forEach(this._operations, function (operation) { - str += " " + operation.type + ":" + operation.count; + var str = ''; + this._operations.forEach(function (operation) { + str += ' ' + operation.type + ':' + operation.count; }); return str.substring(1); } }; }); -enifed("ember-runtime/system/tracked_array", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/enumerable_utils"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalEnumerable_utils) { - "use strict"; +enifed('ember-runtime/system/tracked_array', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { var RETAIN = 'r'; var INSERT = 'i'; var DELETE = 'd'; - exports["default"] = TrackedArray; + exports.default = TrackedArray; /** An `Ember.TrackedArray` tracks array operations. It's useful when you want to lazily compute the indexes of items in an array after they've been shifted by subsequent operations. @@ -40015,12 +35336,11 @@ @namespace Ember @param {Array} [items=[]] The array to be tracked. This is used just to get the initial items for the starting state of retain:n. @private */ - function TrackedArray(items, _suppressDeprecation) { - + function TrackedArray(items) { if (arguments.length < 1) { items = []; } var length = _emberMetalProperty_get.get(items, 'length'); @@ -40122,11 +35442,11 @@ */ apply: function (callback) { var items = []; var offset = 0; - _emberMetalEnumerable_utils.forEach(this._operations, function (arrayOperation, operationIndex) { + this._operations.forEach(function (arrayOperation, operationIndex) { callback(arrayOperation.items, offset, arrayOperation.type, operationIndex); if (arrayOperation.type !== DELETE) { offset += arrayOperation.count; items = items.concat(arrayOperation.items); @@ -40280,13 +35600,13 @@ return removedItems; }, toString: function () { - var str = ""; - _emberMetalEnumerable_utils.forEach(this._operations, function (operation) { - str += " " + operation.type + ":" + operation.count; + var str = ''; + this._operations.forEach(function (operation) { + str += ' ' + operation.type + ':' + operation.count; }); return str.substring(1); } }; @@ -40328,13 +35648,11 @@ this.index = index; this.split = split; this.rangeStart = rangeStart; } }); -enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/object', 'ember-metal/utils'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemObject, _emberMetalUtils) { - 'use strict'; - +enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/object'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemObject) { exports.isArray = isArray; exports.typeOf = typeOf; // ........................................ // TYPING & ARRAY MESSAGING @@ -40379,14 +35697,14 @@ function isArray(obj) { if (!obj || obj.setInterval) { return false; } - if (_emberMetalUtils.isArray(obj)) { + if (Array.isArray(obj)) { return true; } - if (_emberRuntimeMixinsArray["default"].detect(obj)) { + if (_emberRuntimeMixinsArray.default.detect(obj)) { return true; } var type = typeOf(obj); if ('array' === type) { @@ -40460,74 +35778,64 @@ return 'undefined'; } var ret = TYPE_MAP[toString.call(item)] || 'object'; if (ret === 'function') { - if (_emberRuntimeSystemObject["default"].detect(item)) { + if (_emberRuntimeSystemObject.default.detect(item)) { ret = 'class'; } } else if (ret === 'object') { if (item instanceof Error) { ret = 'error'; - } else if (item instanceof _emberRuntimeSystemObject["default"]) { + } else if (item instanceof _emberRuntimeSystemObject.default) { ret = 'instance'; } else if (item instanceof Date) { ret = 'date'; } } return ret; } }); -enifed("ember-template-compiler", ["exports", "ember-metal/core", "ember-template-compiler/system/precompile", "ember-template-compiler/system/compile", "ember-template-compiler/system/template", "ember-template-compiler/plugins", "ember-template-compiler/plugins/transform-each-in-to-block-params", "ember-template-compiler/plugins/transform-with-as-to-hash", "ember-template-compiler/plugins/transform-bind-attr-to-attributes", "ember-template-compiler/plugins/transform-each-into-collection", "ember-template-compiler/plugins/transform-single-arg-each", "ember-template-compiler/plugins/transform-old-binding-syntax", "ember-template-compiler/plugins/transform-old-class-binding-syntax", "ember-template-compiler/plugins/transform-item-class", "ember-template-compiler/plugins/transform-component-attrs-into-mut", "ember-template-compiler/plugins/transform-component-curly-to-readonly", "ember-template-compiler/plugins/transform-angle-bracket-components", "ember-template-compiler/plugins/transform-input-on-to-onEvent", "ember-template-compiler/plugins/deprecate-view-and-controller-paths", "ember-template-compiler/plugins/deprecate-view-helper", "ember-template-compiler/plugins/deprecate-with-controller", "ember-template-compiler/plugins/deprecate-unbound-block-and-multi-param", "ember-template-compiler/compat"], function (exports, _emberMetalCore, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformEachInToBlockParams, _emberTemplateCompilerPluginsTransformWithAsToHash, _emberTemplateCompilerPluginsTransformBindAttrToAttributes, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsTransformSingleArgEach, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths, _emberTemplateCompilerPluginsDeprecateViewHelper, _emberTemplateCompilerPluginsDeprecateWithController, _emberTemplateCompilerPluginsDeprecateUnboundBlockAndMultiParam, _emberTemplateCompilerCompat) { - "use strict"; +enifed('ember-template-compiler', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-each-in-to-block-params', 'ember-template-compiler/plugins/transform-with-as-to-hash', 'ember-template-compiler/plugins/transform-each-into-collection', 'ember-template-compiler/plugins/transform-single-arg-each', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-component-attrs-into-mut', 'ember-template-compiler/plugins/transform-component-curly-to-readonly', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/deprecate-view-and-controller-paths', 'ember-template-compiler/plugins/deprecate-view-helper', 'ember-template-compiler/compat'], function (exports, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformEachInToBlockParams, _emberTemplateCompilerPluginsTransformWithAsToHash, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsTransformSingleArgEach, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths, _emberTemplateCompilerPluginsDeprecateViewHelper, _emberTemplateCompilerCompat) { - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformWithAsToHash["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachInToBlockParams["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformBindAttrToAttributes["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformSingleArgEach["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachIntoCollection["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldBindingSyntax["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldClassBindingSyntax["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformItemClass["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformAngleBracketComponents["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformInputOnToOnEvent["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateViewHelper["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateWithController["default"]); - _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateUnboundBlockAndMultiParam["default"]); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformWithAsToHash.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachInToBlockParams.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformSingleArgEach.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachIntoCollection.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldBindingSyntax.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldClassBindingSyntax.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformItemClass.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformAngleBracketComponents.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformInputOnToOnEvent.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths.default); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateViewHelper.default); - exports._Ember = _emberMetalCore["default"]; - exports.precompile = _emberTemplateCompilerSystemPrecompile["default"]; - exports.compile = _emberTemplateCompilerSystemCompile["default"]; - exports.template = _emberTemplateCompilerSystemTemplate["default"]; + exports._Ember = _emberMetal.default; + exports.precompile = _emberTemplateCompilerSystemPrecompile.default; + exports.compile = _emberTemplateCompilerSystemCompile.default; + exports.template = _emberTemplateCompilerSystemTemplate.default; exports.registerPlugin = _emberTemplateCompilerPlugins.registerPlugin; }); // used for adding Ember.Handlebars.compile for backwards compat -enifed("ember-template-compiler/compat", ["exports", "ember-metal/core", "ember-template-compiler/compat/precompile", "ember-template-compiler/system/compile", "ember-template-compiler/system/template"], function (exports, _emberMetalCore, _emberTemplateCompilerCompatPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate) { - "use strict"; +enifed('ember-template-compiler/compat', ['exports', 'ember-metal/core', 'ember-template-compiler/compat/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template'], function (exports, _emberMetalCore, _emberTemplateCompilerCompatPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate) { - var EmberHandlebars = _emberMetalCore["default"].Handlebars = _emberMetalCore["default"].Handlebars || {}; + var EmberHandlebars = _emberMetalCore.default.Handlebars = _emberMetalCore.default.Handlebars || {}; - EmberHandlebars.precompile = _emberTemplateCompilerCompatPrecompile["default"]; - EmberHandlebars.compile = _emberTemplateCompilerSystemCompile["default"]; - EmberHandlebars.template = _emberTemplateCompilerSystemTemplate["default"]; + EmberHandlebars.precompile = _emberTemplateCompilerCompatPrecompile.default; + EmberHandlebars.compile = _emberTemplateCompilerSystemCompile.default; + EmberHandlebars.template = _emberTemplateCompilerSystemTemplate.default; }); -enifed('ember-template-compiler/compat/precompile', ['exports', 'ember-template-compiler/system/compile_options'], function (exports, _emberTemplateCompilerSystemCompile_options) { - /** - @module ember - @submodule ember-template-compiler - */ - 'use strict'; +enifed('ember-template-compiler/compat/precompile', ['exports', 'ember-metal/core', 'ember-template-compiler/system/compile_options'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCompile_options) { var compile, compileSpec; - exports["default"] = function (string) { - if ((!compile || !compileSpec) && Ember.__loader.registry['htmlbars-compiler/compiler']) { + exports.default = function (string) { + if ((!compile || !compileSpec) && _emberMetalCore.default.__loader.registry['htmlbars-compiler/compiler']) { var Compiler = requireModule('htmlbars-compiler/compiler'); compile = Compiler.compile; compileSpec = Compiler.compileSpec; } @@ -40537,26 +35845,28 @@ } var asObject = arguments[1] === undefined ? true : arguments[1]; var compileFunc = asObject ? compile : compileSpec; - return compileFunc(string, _emberTemplateCompilerSystemCompile_options["default"]()); + return compileFunc(string, _emberTemplateCompilerSystemCompile_options.default()); }; }); +/** +@module ember +@submodule ember-template-compiler +*/ enifed('ember-template-compiler/plugins', ['exports'], function (exports) { + exports.registerPlugin = registerPlugin; /** @module ember @submodule ember-template-compiler */ /** @private @property helpers */ - 'use strict'; - - exports.registerPlugin = registerPlugin; var plugins = { ast: [] }; /** @@ -40572,53 +35882,14 @@ } plugins[type].push(Plugin); } - exports["default"] = plugins; + exports.default = plugins; }); -enifed('ember-template-compiler/plugins/deprecate-unbound-block-and-multi-param', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - 'use strict'; +enifed('ember-template-compiler/plugins/deprecate-view-and-controller-paths', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - function DeprecateUnboundBlockAndMultiParam(options) { - // set later within HTMLBars to the syntax package - this.syntax = null; - this.options = options || {}; - } - - DeprecateUnboundBlockAndMultiParam.prototype.transform = function (ast) { - var pluginContext = this; - var walker = new pluginContext.syntax.Walker(); - var moduleName = pluginContext.options.moduleName; - - walker.visit(ast, function (node) { - - if (pluginContext.isBlockUsage(node)) { - var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.loc); - - } else if (pluginContext.hasMultipleParams(node)) { - var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.loc); - - } - }); - - return ast; - }; - - DeprecateUnboundBlockAndMultiParam.prototype.isBlockUsage = function (node) { - return node.type === 'BlockStatement' && node.path.original === 'unbound'; - }; - - DeprecateUnboundBlockAndMultiParam.prototype.hasMultipleParams = function (node) { - return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'unbound' && node.params.length > 1; - }; - - exports["default"] = DeprecateUnboundBlockAndMultiParam; -}); -enifed("ember-template-compiler/plugins/deprecate-view-and-controller-paths", ["exports", "ember-metal/core", "ember-template-compiler/system/calculate-location-display"], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - "use strict"; - function DeprecateViewAndControllerPaths(options) { // set later within HTMLBars to the syntax package this.syntax = null; this.options = options || {}; } @@ -40673,14 +35944,13 @@ function validate(node) { return node.type === 'MustacheStatement' || node.type === 'BlockStatement'; } - exports["default"] = DeprecateViewAndControllerPaths; + exports.default = DeprecateViewAndControllerPaths; }); -enifed("ember-template-compiler/plugins/deprecate-view-helper", ["exports", "ember-metal/core", "ember-template-compiler/system/calculate-location-display"], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - "use strict"; +enifed('ember-template-compiler/plugins/deprecate-view-helper', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { function DeprecateViewHelper(options) { // set later within HTMLBars to the syntax package this.syntax = null; this.options = options || {}; @@ -40690,11 +35960,11 @@ @private @method transform @param {AST} ast The AST to be transformed. */ DeprecateViewHelper.prototype.transform = function DeprecateViewHelper_transform(ast) { - if (!!_emberMetalCore["default"].ENV._ENABLE_LEGACY_VIEW_SUPPORT) { + if (!!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) { return ast; } var walker = new this.syntax.Walker(); var moduleName = this.options && this.options.moduleName; @@ -40725,84 +35995,24 @@ function validate(node) { return (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && node.path.parts[0] === 'view'; } - exports["default"] = DeprecateViewHelper; + exports.default = DeprecateViewHelper; }); -enifed('ember-template-compiler/plugins/deprecate-with-controller', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - 'use strict'; - - /** - @module ember - @submodule ember-template-compiler - */ - - /** - An HTMLBars AST transformation that deprecates usage of `controller` with the `{{with}}` - helper. - - @private - @class DeprecateWithController - */ - function DeprecateWithController(options) { - // set later within HTMLBars to the syntax package - this.syntax = null; - this.options = options || {}; - } - - /** - @private - @method transform - @param {AST} ast The AST to be transformed. - */ - DeprecateWithController.prototype.transform = function DeprecateWithController_transform(ast) { - var pluginContext = this; - var walker = new pluginContext.syntax.Walker(); - var moduleName = pluginContext.options.moduleName; - - walker.visit(ast, function (node) { - if (pluginContext.validate(node)) { - var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.loc); - - } - }); - - return ast; - }; - - DeprecateWithController.prototype.validate = function TransformWithAsToHash_validate(node) { - return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'with' && hashPairForKey(node.hash, 'controller'); - }; - - function hashPairForKey(hash, key) { - for (var i = 0, l = hash.pairs.length; i < l; i++) { - var pair = hash.pairs[i]; - if (pair.key === key) { - return pair; - } - } - - return false; - } - - exports["default"] = DeprecateWithController; -}); enifed('ember-template-compiler/plugins/transform-angle-bracket-components', ['exports'], function (exports) { - 'use strict'; - function TransformAngleBracketComponents() { // set later within HTMLBars to the syntax package this.syntax = null; } /** @private @method transform @param {AST} ast The AST to be transformed. */ - TransformAngleBracketComponents.prototype.transform = function TransformBindAttrToAttributes_transform(ast) { + TransformAngleBracketComponents.prototype.transform = function TransformAngleBracketComponents_transform(ast) { var walker = new this.syntax.Walker(); walker.visit(ast, function (node) { if (!validate(node)) { return; @@ -40816,206 +36026,24 @@ function validate(node) { return node.type === 'ComponentNode'; } - exports["default"] = TransformAngleBracketComponents; + exports.default = TransformAngleBracketComponents; }); -enifed("ember-template-compiler/plugins/transform-bind-attr-to-attributes", ["exports", "ember-metal/core", "ember-template-compiler/system/string", "ember-template-compiler/system/calculate-location-display"], function (exports, _emberMetalCore, _emberTemplateCompilerSystemString, _emberTemplateCompilerSystemCalculateLocationDisplay) { - /** - @module ember - @submodule ember-htmlbars - */ - - "use strict"; - - /** - An HTMLBars AST transformation that replaces all instances of - {{bind-attr}} helpers with the equivalent HTMLBars-style bound - attributes. For example - - ```handlebars - <div {{bind-attr class=":foo some.path:bar"}}></div> - ``` - - becomes - - ```handlebars - <div class="foo {{if some.path "bar" ""}}></div> - ``` - - @class TransformBindAttrToAttributes - @private - */ - function TransformBindAttrToAttributes(options) { - // set later within HTMLBars to the syntax package - this.syntax = null; - this.options = options || {}; - } - - /** - @private - @method transform - @param {AST} ast The AST to be transformed. - */ - TransformBindAttrToAttributes.prototype.transform = function TransformBindAttrToAttributes_transform(ast) { - var plugin = this; - var moduleName = this.options.moduleName; - var walker = new this.syntax.Walker(); - - walker.visit(ast, function (node) { - if (node.type === 'ElementNode') { - for (var i = 0; i < node.modifiers.length; i++) { - var modifier = node.modifiers[i]; - - if (isBindAttrModifier(modifier, moduleName)) { - node.modifiers.splice(i--, 1); - plugin.assignAttrs(node, modifier.hash); - } - } - } - }); - - return ast; - }; - - TransformBindAttrToAttributes.prototype.assignAttrs = function assignAttrs(element, hash) { - var pairs = hash.pairs; - - for (var i = 0; i < pairs.length; i++) { - var name = pairs[i].key; - var value = pairs[i].value; - - assertAttrNameIsUnused(element, name); - - var attr = this.syntax.builders.attr(name, this.transformValue(name, value)); - element.attributes.push(attr); - } - }; - - TransformBindAttrToAttributes.prototype.transformValue = function transformValue(name, value) { - var b = this.syntax.builders; - - if (name === 'class') { - switch (value.type) { - case 'StringLiteral': - return this.parseClasses(value.value); - case 'PathExpression': - return this.parseClasses(value.original); - case 'SubExpression': - return b.mustache(value.path, value.params, value.hash); - default: - _emberMetalCore["default"].assert("Unsupported attribute value type: " + value.type); - } - } else { - switch (value.type) { - case 'StringLiteral': - return b.mustache(b.path(value.value)); - case 'PathExpression': - return b.mustache(value); - case 'SubExpression': - return b.mustache(value.path, value.params, value.hash); - default: - _emberMetalCore["default"].assert("Unsupported attribute value type: " + value.type); - } - } - }; - - TransformBindAttrToAttributes.prototype.parseClasses = function parseClasses(value) { - var b = this.syntax.builders; - - var concat = b.concat(); - var classes = value.split(' '); - - for (var i = 0; i < classes.length; i++) { - if (i > 0) { - concat.parts.push(b.string(' ')); - } - - var concatPart = this.parseClass(classes[i]); - concat.parts.push(concatPart); - } - - return concat; - }; - - TransformBindAttrToAttributes.prototype.parseClass = function parseClass(value) { - var b = this.syntax.builders; - - var parts = value.split(':'); - - switch (parts.length) { - case 1: - // Before: {{bind-attr class="view.fooBar ..."}} - // After: class="{{-bind-attr-class view.fooBar "foo-bar"}} ..." - return b.sexpr(b.path('-bind-attr-class'), [b.path(parts[0]), b.string(dasherizeLastKey(parts[0]))]); - case 2: - if (parts[0] === '') { - // Before: {{bind-attr class=":foo ..."}} - // After: class="foo ..." - return b.string(parts[1]); - } else { - // Before: {{bind-attr class="some.path:foo ..."}} - // After: class="{{if some.path "foo" ""}} ..." - return b.sexpr(b.path('if'), [b.path(parts[0]), b.string(parts[1]), b.string('')]); - } - break; - case 3: - // Before: {{bind-attr class="some.path:foo:bar ..."}} - // After: class="{{if some.path "foo" "bar"}} ..." - return b.sexpr(b.path('if'), [b.path(parts[0]), b.string(parts[1]), b.string(parts[2])]); - default: - _emberMetalCore["default"].assert("Unsupported bind-attr class syntax: `" + value + "`"); - } - }; - - function isBindAttrModifier(modifier, moduleName) { - var name = modifier.path.original; - - var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, modifier.path.loc); - - if (name === 'bind-attr' || name === 'bindAttr') { - return true; - } else { - return false; - } - } - - function assertAttrNameIsUnused(element, name) { - for (var i = 0; i < element.attributes.length; i++) { - var attr = element.attributes[i]; - - if (attr.name === name) { - if (name === 'class') { - } else { - } - } - } - } - - function dasherizeLastKey(path) { - var parts = path.split('.'); - return _emberTemplateCompilerSystemString.dasherize(parts[parts.length - 1]); - } - - exports["default"] = TransformBindAttrToAttributes; -}); -// Ember.assert enifed('ember-template-compiler/plugins/transform-component-attrs-into-mut', ['exports'], function (exports) { - 'use strict'; - function TransformComponentAttrsIntoMut() { // set later within HTMLBars to the syntax package this.syntax = null; } /** @private @method transform @param {AST} ast The AST to be transformed. */ - TransformComponentAttrsIntoMut.prototype.transform = function TransformBindAttrToAttributes_transform(ast) { + TransformComponentAttrsIntoMut.prototype.transform = function TransformComponentAttrsIntoMut_transform(ast) { var b = this.syntax.builders; var walker = new this.syntax.Walker(); walker.visit(ast, function (node) { if (!validate(node)) { @@ -41042,15 +36070,13 @@ for (var i = 0, l = list.length; i < l; i++) { callback(list[i]); } } - exports["default"] = TransformComponentAttrsIntoMut; + exports.default = TransformComponentAttrsIntoMut; }); enifed('ember-template-compiler/plugins/transform-component-curly-to-readonly', ['exports'], function (exports) { - 'use strict'; - function TransformComponentCurlyToReadonly() { // set later within HTMLBars to the syntax package this.syntax = null; } @@ -41091,15 +36117,13 @@ for (var i = 0, l = list.length; i < l; i++) { callback(list[i]); } } - exports["default"] = TransformComponentCurlyToReadonly; + exports.default = TransformComponentCurlyToReadonly; }); -enifed("ember-template-compiler/plugins/transform-each-in-to-block-params", ["exports", "ember-metal/core", "ember-template-compiler/system/calculate-location-display"], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - "use strict"; - +enifed('ember-template-compiler/plugins/transform-each-in-to-block-params', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { /** @module ember @submodule ember-htmlbars */ @@ -41143,19 +36167,19 @@ var removedParams = node.params.splice(0, 2); var keyword = removedParams[0].original; var moduleInfo = undefined; if (node.type === 'BlockStatement') { - moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.program.loc); + moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.program.loc); if (node.program.blockParams.length) { throw new Error('You cannot use keyword (`{{#each foo in bar}}`) and block params (`{{#each bar as |foo|}}`) at the same time ' + moduleInfo + '.'); } node.program.blockParams = [keyword]; } else { - moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.loc); + moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc); node.hash.pairs.push(b.pair('keyword', b.string(keyword))); } } @@ -41166,11 +36190,11 @@ function validate(node) { return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'each' && node.params.length === 3 && node.params[1].type === 'PathExpression' && node.params[1].original === 'in'; } - exports["default"] = TransformEachInToBlockParams; + exports.default = TransformEachInToBlockParams; }); enifed('ember-template-compiler/plugins/transform-each-in-to-hash', ['exports'], function (exports) { /** @module ember @submodule ember-htmlbars @@ -41192,12 +36216,10 @@ ``` @class TransformEachInToHash @private */ - 'use strict'; - function TransformEachInToHash(options) { // set later within HTMLBars to the syntax package this.syntax = null; this.options = options || {}; } @@ -41236,17 +36258,15 @@ TransformEachInToHash.prototype.validate = function TransformEachInToHash_validate(node) { return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.sexpr.path.original === 'each' && node.sexpr.params.length === 3 && node.sexpr.params[1].type === 'PathExpression' && node.sexpr.params[1].original === 'in'; }; - exports["default"] = TransformEachInToHash; + exports.default = TransformEachInToHash; }); enifed('ember-template-compiler/plugins/transform-each-into-collection', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - 'use strict'; + exports.default = TransformEachIntoCollection; - exports["default"] = TransformEachIntoCollection; - function TransformEachIntoCollection(options) { this.options = options; this.syntax = null; } @@ -41259,11 +36279,11 @@ var legacyHashKey = validate(node); if (!legacyHashKey) { return; } - var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, legacyHashKey.loc); + var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, legacyHashKey.loc); var list = node.params.shift(); node.path = b.path('collection'); @@ -41301,12 +36321,11 @@ } return false; } }); -enifed("ember-template-compiler/plugins/transform-input-on-to-onEvent", ["exports", "ember-metal/core", "ember-template-compiler/system/calculate-location-display"], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - "use strict"; +enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { /** @module ember @submodule ember-htmlbars */ @@ -41350,11 +36369,11 @@ if (pluginContext.validate(node)) { var action = hashPairForKey(node.hash, 'action'); var on = hashPairForKey(node.hash, 'on'); var onEvent = hashPairForKey(node.hash, 'onEvent'); var normalizedOn = on || onEvent; - var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.loc); + var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc); if (normalizedOn && normalizedOn.value.type !== 'StringLiteral') { normalizedOn.key = 'onEvent'; return; // exit early, as we cannot transform further @@ -41366,18 +36385,18 @@ if (!action) { return; // exit early, if no action was available there is nothing to do } - var specifiedOn = normalizedOn ? normalizedOn.key + "=\"" + normalizedOn.value.value + "\" " : ''; + var specifiedOn = normalizedOn ? normalizedOn.key + '="' + normalizedOn.value.value + '" ' : ''; if (normalizedOn && normalizedOn.value.value === 'keyPress') { // using `keyPress` in the root of the component will // clobber the keyPress event handler normalizedOn.value.value = 'key-press'; } - var expected = (normalizedOn ? normalizedOn.value.value : 'enter') + "=\"" + action.value.original + "\""; + var expected = (normalizedOn ? normalizedOn.value.value : 'enter') + '="' + action.value.original + '"'; if (!normalizedOn) { normalizedOn = b.pair('onEvent', b.string('enter')); } @@ -41414,17 +36433,15 @@ } hash.pairs = newPairs; } - exports["default"] = TransformInputOnToOnEvent; + exports.default = TransformInputOnToOnEvent; }); enifed('ember-template-compiler/plugins/transform-item-class', ['exports'], function (exports) { - 'use strict'; + exports.default = TransformItemClass; - exports["default"] = TransformItemClass; - function TransformItemClass() { this.syntax = null; } TransformItemClass.prototype.transform = function TransformItemClass_transform(ast) { @@ -41470,14 +36487,12 @@ callback(list[i]); } } }); enifed('ember-template-compiler/plugins/transform-old-binding-syntax', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - 'use strict'; + exports.default = TransformOldBindingSyntax; - exports["default"] = TransformOldBindingSyntax; - function TransformOldBindingSyntax(options) { this.syntax = null; this.options = options; } @@ -41493,11 +36508,11 @@ each(node.hash.pairs, function (pair) { var key = pair.key; var value = pair.value; - var sourceInformation = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, pair.loc); + var sourceInformation = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, pair.loc); if (key === 'classBinding') { return; } @@ -41535,14 +36550,12 @@ return expr.original; } } }); enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax', ['exports'], function (exports) { - 'use strict'; + exports.default = TransformOldClassBindingSyntax; - exports["default"] = TransformOldClassBindingSyntax; - function TransformOldClassBindingSyntax(options) { this.syntax = null; this.options = options; } @@ -41675,14 +36688,12 @@ return segments; } }); enifed('ember-template-compiler/plugins/transform-single-arg-each', ['exports'], function (exports) { - 'use strict'; + exports.default = TransformSingleArgEach; - exports["default"] = TransformSingleArgEach; - function TransformSingleArgEach() { this.syntax = null; } TransformSingleArgEach.prototype.transform = function TransformSingleArgEach_transform(ast) { @@ -41702,18 +36713,12 @@ function validate(node) { return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'each' && node.params.length === 0; } }); -enifed("ember-template-compiler/plugins/transform-with-as-to-hash", ["exports", "ember-template-compiler/system/calculate-location-display"], function (exports, _emberTemplateCompilerSystemCalculateLocationDisplay) { - /** - @module ember - @submodule ember-htmlbars - */ +enifed('ember-template-compiler/plugins/transform-with-as-to-hash', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { - "use strict"; - /** An HTMLBars AST transformation that replaces all instances of ```handlebars {{#with foo.bar as bar}} @@ -41751,11 +36756,11 @@ if (node.program && node.program.blockParams.length) { throw new Error('You cannot use keyword (`{{with foo as bar}}`) and block params (`{{with foo as |bar|}}`) at the same time.'); } - var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.program.loc); + var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.program.loc); var removedParams = node.params.splice(1, 2); var keyword = removedParams[1].original; node.program.blockParams = [keyword]; @@ -41767,17 +36772,19 @@ TransformWithAsToHash.prototype.validate = function TransformWithAsToHash_validate(node) { return node.type === 'BlockStatement' && node.path.original === 'with' && node.params.length === 3 && node.params[1].type === 'PathExpression' && node.params[1].original === 'as'; }; - exports["default"] = TransformWithAsToHash; + exports.default = TransformWithAsToHash; }); +/** +@module ember +@submodule ember-htmlbars +*/ enifed('ember-template-compiler/system/calculate-location-display', ['exports'], function (exports) { - 'use strict'; + exports.default = calculateLocationDisplay; - exports["default"] = calculateLocationDisplay; - function calculateLocationDisplay(moduleName, _loc) { var loc = _loc || {}; var _ref = loc.start || {}; @@ -41802,18 +36809,12 @@ } return moduleInfo; } }); -enifed("ember-template-compiler/system/compile", ["exports", "ember-template-compiler/system/compile_options", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemCompile_options, _emberTemplateCompilerSystemTemplate) { - /** - @module ember - @submodule ember-template-compiler - */ +enifed('ember-template-compiler/system/compile', ['exports', 'ember-metal/core', 'ember-template-compiler/system/compile_options', 'ember-template-compiler/system/template'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCompile_options, _emberTemplateCompilerSystemTemplate) { - "use strict"; - var compile; /** Uses HTMLBars `compile` function to process a string into a compiled template. @@ -41823,40 +36824,38 @@ @method compile @param {String} templateString This is the string to be compiled by HTMLBars. @param {Object} options This is an options hash to augment the compiler options. */ - exports["default"] = function (templateString, options) { - if (!compile && Ember.__loader.registry['htmlbars-compiler/compiler']) { + exports.default = function (templateString, options) { + if (!compile && _emberMetalCore.default.__loader.registry['htmlbars-compiler/compiler']) { compile = requireModule('htmlbars-compiler/compiler').compile; } if (!compile) { throw new Error('Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`.'); } - var templateSpec = compile(templateString, _emberTemplateCompilerSystemCompile_options["default"](options)); + var templateSpec = compile(templateString, _emberTemplateCompilerSystemCompile_options.default(options)); - return _emberTemplateCompilerSystemTemplate["default"](templateSpec); + return _emberTemplateCompilerSystemTemplate.default(templateSpec); }; }); -enifed("ember-template-compiler/system/compile_options", ["exports", "ember-metal/core", "ember-metal/merge", "ember-template-compiler/plugins"], function (exports, _emberMetalCore, _emberMetalMerge, _emberTemplateCompilerPlugins) { - /** - @module ember - @submodule ember-template-compiler - */ +/** +@module ember +@submodule ember-template-compiler +*/ +enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-metal/features', 'ember-metal/merge', 'ember-template-compiler/plugins'], function (exports, _emberMetalFeatures, _emberMetalMerge, _emberTemplateCompilerPlugins) { - "use strict"; - /** @private @property compileOptions */ - exports["default"] = function (_options) { + exports.default = function (_options) { var disableComponentGeneration = true; - + var options = undefined; // When calling `Ember.Handlebars.compile()` a second argument of `true` // had a special meaning (long since lost), this just gaurds against // `options` being true, and causing an error during compilation. if (_options === true) { @@ -41866,37 +36865,35 @@ } options.disableComponentGeneration = disableComponentGeneration; var plugins = { - ast: _emberTemplateCompilerPlugins["default"].ast.slice() + ast: _emberTemplateCompilerPlugins.default.ast.slice() }; if (options.plugins && options.plugins.ast) { plugins.ast = plugins.ast.concat(options.plugins.ast); } options.plugins = plugins; options.buildMeta = function buildMeta(program) { return { - revision: 'Ember@1.13.13', + revision: 'Ember@2.0.0-beta.2', loc: program.loc, moduleName: options.moduleName }; }; return options; }; }); -enifed('ember-template-compiler/system/precompile', ['exports', 'ember-template-compiler/system/compile_options'], function (exports, _emberTemplateCompilerSystemCompile_options) { - /** - @module ember - @submodule ember-template-compiler - */ +/** +@module ember +@submodule ember-template-compiler +*/ +enifed('ember-template-compiler/system/precompile', ['exports', 'ember-metal/core', 'ember-template-compiler/system/compile_options'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCompile_options) { - 'use strict'; - var compileSpec; /** Uses HTMLBars `compile` function to process a string into a compiled template string. The returned string must be passed through `Ember.HTMLBars.template`. @@ -41906,48 +36903,28 @@ @private @method precompile @param {String} templateString This is the string to be compiled by HTMLBars. */ - exports["default"] = function (templateString, options) { - if (!compileSpec && Ember.__loader.registry['htmlbars-compiler/compiler']) { + exports.default = function (templateString, options) { + if (!compileSpec && _emberMetalCore.default.__loader.registry['htmlbars-compiler/compiler']) { compileSpec = requireModule('htmlbars-compiler/compiler').compileSpec; } if (!compileSpec) { throw new Error('Cannot call `compileSpec` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compileSpec`.'); } - return compileSpec(templateString, _emberTemplateCompilerSystemCompile_options["default"](options)); + return compileSpec(templateString, _emberTemplateCompilerSystemCompile_options.default(options)); }; }); -enifed('ember-template-compiler/system/string', ['exports'], function (exports) { - /** - @module ember - @submodule ember-template-compiler - */ +/** +@module ember +@submodule ember-template-compiler +*/ +enifed('ember-template-compiler/system/template', ['exports', 'htmlbars-runtime/hooks'], function (exports, _htmlbarsRuntimeHooks) { - // This module is duplicated from ember-runtime to support bind-attr. - - 'use strict'; - - exports.decamelize = decamelize; - exports.dasherize = dasherize; - var STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; - var STRING_DASHERIZE_REGEXP = /[ _]/g; - - function decamelize(str) { - return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); - } - - function dasherize(str) { - return decamelize(str).replace(STRING_DASHERIZE_REGEXP, '-'); - } -}); -enifed("ember-template-compiler/system/template", ["exports", "htmlbars-runtime/hooks"], function (exports, _htmlbarsRuntimeHooks) { - "use strict"; - /** @module ember @submodule ember-template-compiler */ @@ -41958,30 +36935,23 @@ @private @method template @param {Function} templateSpec This is the compiled HTMLBars template spec. */ - exports["default"] = function (templateSpec) { + exports.default = function (templateSpec) { if (!templateSpec.render) { templateSpec = _htmlbarsRuntimeHooks.wrap(templateSpec); } templateSpec.isTop = true; templateSpec.isMethod = false; return templateSpec; }; }); -enifed("ember-views", ["exports", "ember-runtime", "ember-views/system/jquery", "ember-views/system/utils", "ember-views/compat/render_buffer", "ember-views/system/ext", "ember-views/views/states", "ember-metal-views/renderer", "ember-views/views/core_view", "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", "ember-views/component_lookup", "ember-views/views/checkbox", "ember-views/mixins/text_support", "ember-views/views/text_field", "ember-views/views/text_area", "ember-views/views/select", "ember-views/compat/metamorph_view", "ember-views/views/legacy_each_view"], function (exports, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsCompatRender_buffer, _emberViewsSystemExt, _emberViewsViewsStates, _emberMetalViewsRenderer, _emberViewsViewsCore_view, _emberViewsViewsView, _emberViewsViewsContainer_view, _emberViewsViewsCollection_view, _emberViewsViewsComponent, _emberViewsSystemEvent_dispatcher, _emberViewsMixinsView_target_action_support, _emberViewsComponent_lookup, _emberViewsViewsCheckbox, _emberViewsMixinsText_support, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsSelect, _emberViewsCompatMetamorph_view, _emberViewsViewsLegacy_each_view) { - /** - @module ember - @submodule ember-views - */ +enifed('ember-views', ['exports', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/compat/render_buffer', 'ember-views/system/ext', 'ember-views/views/states', 'ember-metal-views/renderer', 'ember-views/views/core_view', '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', 'ember-views/component_lookup', 'ember-views/views/checkbox', 'ember-views/mixins/text_support', 'ember-views/views/text_field', 'ember-views/views/text_area', 'ember-views/views/select', 'ember-views/compat/metamorph_view', 'ember-views/views/legacy_each_view'], function (exports, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsCompatRender_buffer, _emberViewsSystemExt, _emberViewsViewsStates, _emberMetalViewsRenderer, _emberViewsViewsCore_view, _emberViewsViewsView, _emberViewsViewsContainer_view, _emberViewsViewsCollection_view, _emberViewsViewsComponent, _emberViewsSystemEvent_dispatcher, _emberViewsMixinsView_target_action_support, _emberViewsComponent_lookup, _emberViewsViewsCheckbox, _emberViewsMixinsText_support, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsSelect, _emberViewsCompatMetamorph_view, _emberViewsViewsLegacy_each_view) { - // BEGIN IMPORTS - "use strict"; - // END IMPORTS /** Alias for jQuery @@ -41989,98 +36959,83 @@ @for Ember @public */ // BEGIN EXPORTS - _emberRuntime["default"].$ = _emberViewsSystemJquery["default"]; + _emberRuntime.default.$ = _emberViewsSystemJquery.default; - _emberRuntime["default"].ViewTargetActionSupport = _emberViewsMixinsView_target_action_support["default"]; - _emberRuntime["default"].RenderBuffer = _emberViewsCompatRender_buffer["default"]; + _emberRuntime.default.ViewTargetActionSupport = _emberViewsMixinsView_target_action_support.default; + _emberRuntime.default.RenderBuffer = _emberViewsCompatRender_buffer.default; - var ViewUtils = _emberRuntime["default"].ViewUtils = {}; + var ViewUtils = _emberRuntime.default.ViewUtils = {}; ViewUtils.isSimpleClick = _emberViewsSystemUtils.isSimpleClick; ViewUtils.getViewClientRects = _emberViewsSystemUtils.getViewClientRects; ViewUtils.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect; - _emberRuntime["default"].View = _emberViewsViewsView.DeprecatedView; - _emberRuntime["default"].View.states = _emberViewsViewsStates.states; - _emberRuntime["default"].View.cloneStates = _emberViewsViewsStates.cloneStates; - _emberRuntime["default"].View._Renderer = _emberMetalViewsRenderer["default"]; - _emberRuntime["default"].Checkbox = _emberViewsViewsCheckbox["default"]; - _emberRuntime["default"].TextField = _emberViewsViewsText_field["default"]; - _emberRuntime["default"].TextArea = _emberViewsViewsText_area["default"]; + _emberRuntime.default.CoreView = _emberViewsViewsCore_view.DeprecatedCoreView; + _emberRuntime.default.View = _emberViewsViewsView.DeprecatedView; + _emberRuntime.default.View.states = _emberViewsViewsStates.states; + _emberRuntime.default.View.cloneStates = _emberViewsViewsStates.cloneStates; + _emberRuntime.default.View._Renderer = _emberMetalViewsRenderer.default; + _emberRuntime.default.Checkbox = _emberViewsViewsCheckbox.default; + _emberRuntime.default.TextField = _emberViewsViewsText_field.default; + _emberRuntime.default.TextArea = _emberViewsViewsText_area.default; - _emberRuntime["default"].SelectOption = _emberViewsViewsSelect.SelectOption; - _emberRuntime["default"].SelectOptgroup = _emberViewsViewsSelect.SelectOptgroup; + _emberRuntime.default.Select = _emberViewsViewsSelect.DeprecatedSelect; + _emberRuntime.default.SelectOption = _emberViewsViewsSelect.SelectOption; + _emberRuntime.default.SelectOptgroup = _emberViewsViewsSelect.SelectOptgroup; - _emberRuntime["default"].TextSupport = _emberViewsMixinsText_support["default"]; - _emberRuntime["default"].ComponentLookup = _emberViewsComponent_lookup["default"]; - _emberRuntime["default"].Component = _emberViewsViewsComponent["default"]; - _emberRuntime["default"].EventDispatcher = _emberViewsSystemEvent_dispatcher["default"]; + _emberRuntime.default.TextSupport = _emberViewsMixinsText_support.default; + _emberRuntime.default.ComponentLookup = _emberViewsComponent_lookup.default; + _emberRuntime.default.ContainerView = _emberViewsViewsContainer_view.default; + _emberRuntime.default.CollectionView = _emberViewsViewsCollection_view.default; + _emberRuntime.default.Component = _emberViewsViewsComponent.default; + _emberRuntime.default.EventDispatcher = _emberViewsSystemEvent_dispatcher.default; // Deprecated: - _emberRuntime["default"].Select = _emberViewsViewsSelect.DeprecatedSelect; - _emberRuntime["default"].CoreView = _emberViewsViewsCore_view.DeprecatedCoreView; - _emberRuntime["default"].ContainerView = _emberViewsViewsContainer_view.DeprecatedContainerView; - _emberRuntime["default"].CollectionView = _emberViewsViewsCollection_view.DeprecatedCollectionView; - _emberRuntime["default"]._Metamorph = _emberViewsCompatMetamorph_view._Metamorph; - _emberRuntime["default"]._MetamorphView = _emberViewsCompatMetamorph_view["default"]; - _emberRuntime["default"]._LegacyEachView = _emberViewsViewsLegacy_each_view["default"]; + _emberRuntime.default._Metamorph = _emberViewsCompatMetamorph_view._Metamorph; + _emberRuntime.default._MetamorphView = _emberViewsCompatMetamorph_view.default; + _emberRuntime.default._LegacyEachView = _emberViewsViewsLegacy_each_view.default; // END EXPORTS - exports["default"] = _emberRuntime["default"]; + exports.default = _emberRuntime.default; }); -// for the side effect of extending Ember.run.queues -enifed('ember-views/compat/attrs-proxy', ['exports', 'ember-metal/mixin', 'ember-metal/utils', 'ember-metal/property_events', 'ember-metal/events', 'ember-metal/empty_object'], function (exports, _emberMetalMixin, _emberMetalUtils, _emberMetalProperty_events, _emberMetalEvents, _emberMetalEmpty_object) { - 'use strict'; +/** +@module ember +@submodule ember-views +*/ +// BEGIN IMPORTS +// for the side effect of extending Ember.run.queues +enifed('ember-views/compat/attrs-proxy', ['exports', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/events', 'ember-metal/utils', 'ember-metal/property_events', 'ember-metal/observer'], function (exports, _emberMetalProperty_get, _emberMetalMixin, _emberMetalEvents, _emberMetalUtils, _emberMetalProperty_events, _emberMetalObserver) { exports.deprecation = deprecation; function deprecation(key) { return 'You tried to look up an attribute directly on the component. This is deprecated. Use attrs.' + key + ' instead.'; } - var MUTABLE_CELL = _emberMetalUtils.symbol("MUTABLE_CELL"); + var MUTABLE_CELL = _emberMetalUtils.symbol('MUTABLE_CELL'); exports.MUTABLE_CELL = MUTABLE_CELL; function isCell(val) { return val && val[MUTABLE_CELL]; } - function setupAvoidPropagating(instance) { - // This caches the list of properties to avoid setting onto the component instance - // inside `_propagateAttrsToThis`. We cache them so that every instantiated component - // does not have to pay the calculation penalty. - var constructor = instance.constructor; - if (!constructor.__avoidPropagating) { - constructor.__avoidPropagating = new _emberMetalEmpty_object["default"](); - var i = undefined, - l = undefined; - for (i = 0, l = instance.concatenatedProperties.length; i < l; i++) { - var prop = instance.concatenatedProperties[i]; + function attrsWillChange(view, attrsKey) { + var key = attrsKey.slice(6); + view.currentState.legacyAttrWillChange(view, key); + } - constructor.__avoidPropagating[prop] = true; - } - - for (i = 0, l = instance.mergedProperties.length; i < l; i++) { - var prop = instance.mergedProperties[i]; - - constructor.__avoidPropagating[prop] = true; - } - } + function attrsDidChange(view, attrsKey) { + var key = attrsKey.slice(6); + view.currentState.legacyAttrDidChange(view, key); } var AttrsProxyMixin = { attrs: null, - init: function () { - this._super.apply(this, arguments); - - setupAvoidPropagating(this); - }, - getAttr: function (key) { var attrs = this.attrs; if (!attrs) { return; } @@ -42101,43 +37056,58 @@ } val.update(value); }, - _propagateAttrsToThis: function () { - var attrs = this.attrs; - - for (var prop in attrs) { - if (prop !== 'attrs' && !this.constructor.__avoidPropagating[prop]) { - this.set(prop, this.getAttr(prop)); - } + willWatchProperty: function (key) { + if (this._isAngleBracket || key === 'attrs') { + return; } + + var attrsKey = 'attrs.' + key; + _emberMetalObserver._addBeforeObserver(this, attrsKey, null, attrsWillChange); + _emberMetalObserver.addObserver(this, attrsKey, null, attrsDidChange); }, - initializeShape: _emberMetalEvents.on('init', function () { - this._isDispatchingAttrs = false; - }), + didUnwatchProperty: function (key) { + if (this._isAngleBracket || key === 'attrs') { + return; + } - _internalDidReceiveAttrs: function () { - this._super(); - this._isDispatchingAttrs = true; - this._propagateAttrsToThis(); - this._isDispatchingAttrs = false; + var attrsKey = 'attrs.' + key; + _emberMetalObserver._removeBeforeObserver(this, attrsKey, null, attrsWillChange); + _emberMetalObserver.removeObserver(this, attrsKey, null, attrsDidChange); }, + legacyDidReceiveAttrs: _emberMetalEvents.on('didReceiveAttrs', function () { + if (this._isAngleBracket) { + return; + } + + var keys = Object.keys(this.attrs); + + for (var i = 0, l = keys.length; i < l; i++) { + // Only issue the deprecation if it wasn't already issued when + // setting attributes initially. + if (!(keys[i] in this)) { + this.notifyPropertyChange(keys[i]); + } + } + }), + unknownProperty: function (key) { if (this._isAngleBracket) { return; } - var attrs = this.attrs; + var attrs = _emberMetalProperty_get.get(this, 'attrs'); if (attrs && key in attrs) { // do not deprecate accessing `this[key]` at this time. // add this back when we have a proper migration path - // Ember.deprecate(deprecation(key), { id: 'ember-views.', until: '3.0.0' }); - var possibleCell = attrs[key]; + // Ember.deprecate(deprecation(key)); + var possibleCell = _emberMetalProperty_get.get(attrs, key); if (possibleCell && possibleCell[MUTABLE_CELL]) { return possibleCell.value; } @@ -42152,24 +37122,19 @@ AttrsProxyMixin[_emberMetalProperty_events.PROPERTY_DID_CHANGE] = function (key) { if (this._isAngleBracket) { return; } - if (this._isDispatchingAttrs) { - return; - } if (this.currentState) { this.currentState.legacyPropertyDidChange(this, key); } }; - exports["default"] = _emberMetalMixin.Mixin.create(AttrsProxyMixin); + exports.default = _emberMetalMixin.Mixin.create(AttrsProxyMixin); }); -enifed("ember-views/compat/metamorph_view", ["exports", "ember-metal/core", "ember-views/views/view", "ember-metal/mixin"], function (exports, _emberMetalCore, _emberViewsViewsView, _emberMetalMixin) { - /*jshint newcap:false*/ - "use strict"; +enifed('ember-views/compat/metamorph_view', ['exports', 'ember-metal/core', 'ember-views/views/view', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberViewsViewsView, _emberMetalMixin) { /** @module ember @submodule ember-views */ @@ -42200,25 +37165,19 @@ @namespace Ember @extends Ember.View @uses Ember._Metamorph @private */ - exports["default"] = _emberViewsViewsView["default"].extend(_Metamorph, { + exports.default = _emberViewsViewsView.default.extend(_Metamorph, { __metamorphType: 'Ember._MetamorphView' }); }); +/*jshint newcap:false*/ // Ember.deprecate -enifed("ember-views/compat/render_buffer", ["exports", "ember-views/system/jquery", "ember-metal/core", "ember-metal/platform/create", "dom-helper/prop", "ember-views/system/platform"], function (exports, _emberViewsSystemJquery, _emberMetalCore, _emberMetalPlatformCreate, _domHelperProp, _emberViewsSystemPlatform) { - /** - @module ember - @submodule ember-views - */ - - "use strict"; - +enifed('ember-views/compat/render_buffer', ['exports', 'ember-views/system/jquery', 'ember-metal/core', 'dom-helper/prop', 'ember-views/system/platform'], function (exports, _emberViewsSystemJquery, _emberMetalCore, _domHelperProp, _emberViewsSystemPlatform) { exports.renderComponentWithBuffer = renderComponentWithBuffer; - exports["default"] = RenderBuffer; + exports.default = RenderBuffer; // The HTML spec allows for "omitted start tags". These tags are optional // when their intended child is the first thing in the parent tag. For // example, this is a tbody start tag: // @@ -42264,11 +37223,11 @@ } } } function ClassSet() { - this.seen = _emberMetalPlatformCreate["default"](null); + this.seen = Object.create(null); this.list = []; } ClassSet.prototype = { add: function (string) { @@ -42301,19 +37260,19 @@ function escapeAttribute(value) { // Stolen shamelessly from Handlebars var escape = { - "<": "&lt;", - ">": "&gt;", - '"': "&quot;", - "'": "&#x27;", - "`": "&#x60;" + '<': '&lt;', + '>': '&gt;', + '"': '&quot;', + '\'': '&#x27;', + '`': '&#x60;' }; var escapeChar = function (chr) { - return escape[chr] || "&amp;"; + return escape[chr] || '&amp;'; }; var string = value.toString(); if (!POSSIBLE_CHARS_REGEXP.test(string)) { @@ -42477,11 +37436,11 @@ elementStyle: null, pushChildView: function (view) { var index = this.childViews.length; this.childViews[index] = view; - this.push("<script id='morph-" + index + "' type='text/x-placeholder'>\x3C/script>"); + this.push('<script id=\'morph-' + index + '\' type=\'text/x-placeholder\'></script>'); }, pushAttrNode: function (node) { var index = this.attrNodes.length; this.attrNodes[index] = node; @@ -42660,11 +37619,11 @@ var styleBuffer = ''; var attr, prop, tagString; if (!_emberViewsSystemPlatform.canSetNameOnInputs && attrs && attrs.name) { // IE allows passing a tag to createElement. See note on `canSetNameOnInputs` above as well. - tagString = "<" + stripTagName(tagName) + " name=\"" + escapeAttribute(attrs.name) + "\">"; + tagString = '<' + stripTagName(tagName) + ' name="' + escapeAttribute(attrs.name) + '">'; } else { tagString = tagName; } var element = this.dom.createElement(tagString, this.outerContextualElement()); @@ -42768,11 +37727,11 @@ if (this._element) { // Firefox versions < 11 do not have support for element.outerHTML. var thisElement = this.element(); var outerHTML = thisElement.outerHTML; if (typeof outerHTML === 'undefined') { - return _emberViewsSystemJquery["default"]('<div/>').append(thisElement).html(); + return _emberViewsSystemJquery.default('<div/>').append(thisElement).html(); } return outerHTML; } else { return this.innerString(); } @@ -42810,14 +37769,16 @@ innerContent: function () { return this.buffer; } }; }); -enifed("ember-views/component_lookup", ["exports", "ember-metal/core", "ember-runtime/system/object", "ember-htmlbars/system/lookup-helper"], function (exports, _emberMetalCore, _emberRuntimeSystemObject, _emberHtmlbarsSystemLookupHelper) { - "use strict"; - - exports["default"] = _emberRuntimeSystemObject["default"].extend({ +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/component_lookup', ['exports', 'ember-metal/core', 'ember-runtime/system/object', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberMetalCore, _emberRuntimeSystemObject, _emberHtmlbarsSystemLookupHelper) { + exports.default = _emberRuntimeSystemObject.default.extend({ invalidName: function (name) { if (!_emberHtmlbarsSystemLookupHelper.CONTAINS_DASH_CACHE.get(name)) { return true; } }, @@ -42838,11 +37799,11 @@ // Only treat as a component if either the component // or a template has been registered. if (templateRegistered || Component) { if (!Component) { - container._registry.register(fullName, _emberMetalCore["default"].Component); + container._registry.register(fullName, _emberMetalCore.default.Component); Component = container.lookupFactory(fullName); } return Component; } }, @@ -42864,24 +37825,18 @@ var templateFullName = 'template:components/' + name; return container.lookup(templateFullName); } }); }); -enifed("ember-views/mixins/aria_role_support", ["exports", "ember-metal/mixin"], function (exports, _emberMetalMixin) { - /** - @module ember - @submodule ember-views - */ +enifed('ember-views/mixins/aria_role_support', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { - "use strict"; - /** @class AriaRoleSupport @namespace Ember @private */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ attributeBindings: ['ariaRole:role'], /** The WAI-ARIA role of the control represented by this view. For example, a button may have a role of type 'button', or a pane may have a role of @@ -42895,25 +37850,24 @@ @public */ ariaRole: null }); }); -enifed("ember-views/mixins/class_names_support", ["exports", "ember-metal/core", "ember-metal/mixin", "ember-runtime/system/native_array", "ember-metal/utils"], function (exports, _emberMetalCore, _emberMetalMixin, _emberRuntimeSystemNative_array, _emberMetalUtils) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +/** + @module ember + @submodule ember-views +*/ +enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-runtime/system/native_array'], function (exports, _emberMetalCore, _emberMetalMixin, _emberRuntimeSystemNative_array) { var EMPTY_ARRAY = []; /** @class ClassNamesSupport @namespace Ember @private */ - var ClassNamesSupport = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ concatenatedProperties: ['classNames', 'classNameBindings'], init: function () { this._super.apply(this, arguments); @@ -42938,29 +37892,29 @@ is a string value, the value of that string will be applied as a class name. ```javascript // Applies the 'high' class to the view element Ember.View.extend({ - classNameBindings: ['priority'], + classNameBindings: ['priority'] priority: 'high' }); ``` If the value of the property is a Boolean, the name of that property is added as a dasherized class name. ```javascript // Applies the 'is-urgent' class to the view element Ember.View.extend({ - classNameBindings: ['isUrgent'], + classNameBindings: ['isUrgent'] isUrgent: true }); ``` If you would prefer to use a custom value instead of the dasherized property name, you can pass a binding like this: ```javascript // Applies the 'urgent' class to the view element Ember.View.extend({ - classNameBindings: ['isUrgent:urgent'], + classNameBindings: ['isUrgent:urgent'] isUrgent: true }); ``` This list of properties is inherited from the view's superclasses as well. @property classNameBindings @@ -42968,25 +37922,26 @@ @default [] @public */ classNameBindings: EMPTY_ARRAY }); - - exports["default"] = ClassNamesSupport; }); +/** +@module ember +@submodule ember-views +*/ enifed('ember-views/mixins/component_template_deprecation', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin) { - 'use strict'; /* The ComponentTemplateDeprecation mixin is used to provide a useful deprecation warning when using either `template` or `templateName` with a component. The `template` and `templateName` properties specified at extend time are moved to `layout` and `layoutName` respectively. This is used internally by Ember in `Ember.Component`. */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** @private Moves `templateName` to `layoutName` and `template` to `layout` at extend time if a layout is not also specified. Note that this currently modifies the mixin themselves, which is technically @@ -43024,32 +37979,26 @@ } }); }); // Ember.deprecate -enifed("ember-views/mixins/empty_view_support", ["exports", "ember-metal/mixin", "ember-views/views/view", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/computed"], function (exports, _emberMetalMixin, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed) { - /** - @module ember - @submodule ember-views - */ +enifed('ember-views/mixins/empty_view_support', ['exports', 'ember-metal/mixin', 'ember-views/views/view', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed'], function (exports, _emberMetalMixin, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed) { - "use strict"; - /** @class EmptyViewSupport @namespace Ember @private */ - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** This provides metadata about what kind of empty view class this collection would like if it is being instantiated from another system (like Handlebars) @private @property emptyViewClass */ - emptyViewClass: _emberViewsViewsView["default"], + emptyViewClass: _emberViewsViewsView.default, /** An optional view to display if content is set to an empty array. @property emptyView @type Ember.View @@ -43084,16 +38033,15 @@ return actualEmpty; }) }); }); -enifed("ember-views/mixins/instrumentation_support", ["exports", "ember-metal/mixin", "ember-metal/computed", "ember-metal/property_get"], function (exports, _emberMetalMixin, _emberMetalComputed, _emberMetalProperty_get) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +/** + @module ember + @submodule ember-views +*/ +enifed('ember-views/mixins/instrumentation_support', ['exports', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_get'], function (exports, _emberMetalMixin, _emberMetalComputed, _emberMetalProperty_get) { /** @class InstrumentationSupport @namespace Ember @public @@ -43117,18 +38065,17 @@ hash.template = _emberMetalProperty_get.get(this, 'templateName'); this._super(hash); } }); - exports["default"] = InstrumentationSupport; + exports.default = InstrumentationSupport; }); -enifed("ember-views/mixins/legacy_view_support", ["exports", "ember-metal/core", "ember-metal/mixin", "ember-metal/property_get"], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalProperty_get) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/mixins/legacy_view_support', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalProperty_get) { /** @class LegacyViewSupport @namespace Ember @private @@ -43136,10 +38083,20 @@ var LegacyViewSupport = _emberMetalMixin.Mixin.create({ beforeRender: function (buffer) {}, afterRender: function (buffer) {}, + walkChildViews: function (callback) { + var childViews = this.childViews.slice(); + + while (childViews.length) { + var view = childViews.pop(); + callback(view); + childViews.push.apply(childViews, view.childViews); + } + }, + mutateChildViews: function (callback) { var childViews = _emberMetalProperty_get.get(this, 'childViews'); var idx = childViews.length; var view; @@ -43209,37 +38166,35 @@ view = _emberMetalProperty_get.get(view, 'parentView'); } } }); - exports["default"] = LegacyViewSupport; + exports.default = LegacyViewSupport; }); -enifed("ember-views/mixins/normalized_rerender_if_needed", ["exports", "ember-metal/property_get", "ember-metal/mixin", "ember-metal/merge", "ember-views/views/states"], function (exports, _emberMetalProperty_get, _emberMetalMixin, _emberMetalMerge, _emberViewsViewsStates) { - /** - @module ember - @submodule ember-views - */ +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/mixins/normalized_rerender_if_needed', ['exports', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/merge', 'ember-views/views/states'], function (exports, _emberMetalProperty_get, _emberMetalMixin, _emberMetalMerge, _emberViewsViewsStates) { - "use strict"; - var states = _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states); - _emberMetalMerge["default"](states._default, { + _emberMetalMerge.default(states._default, { rerenderIfNeeded: function () { return this; } }); - _emberMetalMerge["default"](states.inDOM, { + _emberMetalMerge.default(states.inDOM, { rerenderIfNeeded: function (view) { if (view.normalizedValue() !== view._lastNormalizedValue) { view.rerender(); } } }); - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ _states: states, normalizedValue: function () { var value = this.lazyValue.value(); var valueNormalizer = _emberMetalProperty_get.get(this, 'valueNormalizerFunc'); @@ -43249,16 +38204,15 @@ rerenderIfNeeded: function () { this.currentState.rerenderIfNeeded(this); } }); }); -enifed("ember-views/mixins/template_rendering_support", ["exports", "ember-metal/mixin"], function (exports, _emberMetalMixin) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/mixins/template_rendering_support', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { // Circular dep var _renderView; /** @@ -43286,20 +38240,18 @@ return _renderView.renderHTMLBarsBlock(this, block, renderNode); } }); - exports["default"] = TemplateRenderingSupport; + exports.default = TemplateRenderingSupport; }); -enifed("ember-views/mixins/text_support", ["exports", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/mixin", "ember-runtime/mixins/target_action_support"], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberRuntimeMixinsTarget_action_support) { - /** - @module ember - @submodule ember-views - */ +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/mixins/text_support', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-runtime/mixins/target_action_support'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberRuntimeMixinsTarget_action_support) { - "use strict"; - /** `TextSupport` is a shared mixin used by both `Ember.TextField` and `Ember.TextArea`. `TextSupport` adds a number of methods that allow you to specify a controller action to invoke when a certain event is fired on your text field or textarea. The specifed controller action would get the current @@ -43394,23 +38346,23 @@ @namespace Ember @uses Ember.TargetActionSupport @extends Ember.Mixin @private */ - var TextSupport = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsTarget_action_support["default"], { - value: "", + var TextSupport = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsTarget_action_support.default, { + value: '', attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'], placeholder: null, disabled: false, maxlength: null, init: function () { this._super.apply(this, arguments); - this.on("paste", this, this._elementValueDidChange); - this.on("cut", this, this._elementValueDidChange); - this.on("input", this, this._elementValueDidChange); + this.on('paste', this, this._elementValueDidChange); + this.on('cut', this, this._elementValueDidChange); + this.on('input', this, this._elementValueDidChange); }, /** The action to be sent when the user presses the return key. This is similar to the `{{action}}` helper, but is fired when @@ -43608,22 +38560,21 @@ event.stopPropagation(); } } } - exports["default"] = TextSupport; + exports.default = TextSupport; }); -enifed("ember-views/mixins/view_child_views_support", ["exports", "ember-metal/core", "ember-metal/mixin", "ember-metal/enumerable_utils", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/set_properties"], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalEnumerable_utils, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/mixins/view_child_views_support', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/set_properties'], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties) { var EMPTY_ARRAY = []; - exports["default"] = _emberMetalMixin.Mixin.create({ + exports.default = _emberMetalMixin.Mixin.create({ /** Array of child views. You should never edit this array directly. Instead, use `appendChild` and `removeFromParent`. @property childViews @type Array @@ -43635,11 +38586,11 @@ init: function () { this._super.apply(this, arguments); // setup child views. be sure to clone the child views array first // 2.0TODO: Remove Ember.A() here - this.childViews = _emberMetalCore["default"].A(this.childViews.slice()); + this.childViews = _emberMetalCore.default.A(this.childViews.slice()); this.ownerView = this.ownerView || this; }, appendChild: function (view) { this.linkChild(view); @@ -43669,11 +38620,14 @@ this.unlinkChild(view); // remove view from childViews array. var childViews = _emberMetalProperty_get.get(this, 'childViews'); - _emberMetalEnumerable_utils.removeObject(childViews, view); + var index = childViews.indexOf(view); + if (index !== -1) { + childViews.splice(index, 1); + } return this; }, /** @@ -43688,11 +38642,11 @@ @return {Ember.View} new instance @private */ createChildView: function (maybeViewClass, _attrs) { if (!maybeViewClass) { - throw new TypeError("createChildViews first argument must exist"); + throw new TypeError('createChildViews first argument must exist'); } if (maybeViewClass.isView && maybeViewClass.parentView === this && maybeViewClass.container === this.container) { return maybeViewClass; } @@ -43720,11 +38674,11 @@ view = ViewKlass.create(attrs); } else { view = maybeViewClass; attrs.container = this.container; - _emberMetalSet_properties["default"](view, attrs); + _emberMetalSet_properties.default(view, attrs); } this.linkChild(view); return view; @@ -43744,18 +38698,17 @@ _emberMetalProperty_set.set(instance, 'parentView', null); instance.trigger('parentViewDidChange'); } }); }); -enifed("ember-views/mixins/view_context_support", ["exports", "ember-metal/mixin", "ember-metal/computed", "ember-metal/property_get", "ember-metal/property_set", "ember-views/mixins/legacy_view_support", "ember-metal/events"], function (exports, _emberMetalMixin, _emberMetalComputed, _emberMetalProperty_get, _emberMetalProperty_set, _emberViewsMixinsLegacy_view_support, _emberMetalEvents) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/mixins/view_context_support', ['exports', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-views/mixins/legacy_view_support', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalComputed, _emberMetalProperty_get, _emberMetalProperty_set, _emberViewsMixinsLegacy_view_support, _emberMetalEvents) { - var ViewContextSupport = _emberMetalMixin.Mixin.create(_emberViewsMixinsLegacy_view_support["default"], { + var ViewContextSupport = _emberMetalMixin.Mixin.create(_emberViewsMixinsLegacy_view_support.default, { /** The object from which templates should access properties. This object will be passed to the template function each time the render method is called, but it is up to the individual function to decide what to do with it. @@ -43770,11 +38723,11 @@ }, set: function (key, value) { _emberMetalProperty_set.set(this, '_context', value); return value; } - })["volatile"](), + }).volatile(), /** Private copy of the view's template context. This can be set directly by Handlebars without triggering the observer that causes the view to be re-rendered. @@ -43829,24 +38782,27 @@ return value; } }), _legacyControllerDidChange: _emberMetalMixin.observer('controller', function () { - this.childViews.forEach(function (view) { + this.walkChildViews(function (view) { return view.notifyPropertyChange('controller'); }); }), _notifyControllerChange: _emberMetalEvents.on('parentViewDidChange', function () { this.notifyPropertyChange('controller'); }) }); - exports["default"] = ViewContextSupport; + exports.default = ViewContextSupport; }); -enifed("ember-views/mixins/view_state_support", ["exports", "ember-metal/core", "ember-metal/mixin"], function (exports, _emberMetalCore, _emberMetalMixin) { - "use strict"; +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/mixins/view_state_support', ['exports', 'ember-metal/core', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalMixin) { var ViewStateSupport = _emberMetalMixin.Mixin.create({ transitionTo: function (state) { this._transitionTo(state); }, @@ -43863,14 +38819,13 @@ currentState.enter(this); } } }); - exports["default"] = ViewStateSupport; + exports.default = ViewStateSupport; }); -enifed("ember-views/mixins/view_target_action_support", ["exports", "ember-metal/mixin", "ember-runtime/mixins/target_action_support", "ember-metal/alias"], function (exports, _emberMetalMixin, _emberRuntimeMixinsTarget_action_support, _emberMetalAlias) { - "use strict"; +enifed('ember-views/mixins/view_target_action_support', ['exports', 'ember-metal/mixin', 'ember-runtime/mixins/target_action_support', 'ember-metal/alias'], function (exports, _emberMetalMixin, _emberRuntimeMixinsTarget_action_support, _emberMetalAlias) { /** `Ember.ViewTargetActionSupport` is a mixin that can be included in a view class to add a `triggerAction` method with semantics similar to the Handlebars `{{action}}` helper. It provides intelligent defaults @@ -43910,29 +38865,24 @@ @class ViewTargetActionSupport @namespace Ember @extends Ember.TargetActionSupport @private */ - exports["default"] = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsTarget_action_support["default"], { + exports.default = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsTarget_action_support.default, { /** @property target @private */ - target: _emberMetalAlias["default"]('controller'), + target: _emberMetalAlias.default('controller'), /** @property actionContext @private */ - actionContext: _emberMetalAlias["default"]('context') + actionContext: _emberMetalAlias.default('context') }); }); -enifed("ember-views/mixins/visibility_support", ["exports", "ember-metal/mixin", "ember-metal/property_get", "ember-metal/run_loop"], function (exports, _emberMetalMixin, _emberMetalProperty_get, _emberMetalRun_loop) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +enifed('ember-views/mixins/visibility_support', ['exports', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/run_loop'], function (exports, _emberMetalMixin, _emberMetalProperty_get, _emberMetalRun_loop) { function K() { return this; } @@ -43962,11 +38912,11 @@ */ _isVisibleDidChange: _emberMetalMixin.observer('isVisible', function () { if (this._isVisible === _emberMetalProperty_get.get(this, 'isVisible')) { return; } - _emberMetalRun_loop["default"].scheduleOnce('render', this, this._toggleVisibility); + _emberMetalRun_loop.default.scheduleOnce('render', this, this._toggleVisibility); }), _toggleVisibility: function () { var $el = this.$(); var isVisible = _emberMetalProperty_get.get(this, 'isVisible'); @@ -44032,15 +38982,17 @@ return false; } }); - exports["default"] = VisibilitySupport; + exports.default = VisibilitySupport; }); -enifed("ember-views/streams/class_name_binding", ["exports", "ember-metal/streams/utils", "ember-metal/property_get", "ember-runtime/system/string", "ember-metal/utils"], function (exports, _emberMetalStreamsUtils, _emberMetalProperty_get, _emberRuntimeSystemString, _emberMetalUtils) { - "use strict"; - +/** + @module ember + @submodule ember-views +*/ +enifed('ember-views/streams/class_name_binding', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/streams/utils', 'ember-runtime/system/string'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberMetalStreamsUtils, _emberRuntimeSystemString) { exports.parsePropertyPath = parsePropertyPath; exports.classStringForValue = classStringForValue; exports.streamifyClassNameBinding = streamifyClassNameBinding; /** @@ -44064,11 +39016,11 @@ */ function parsePropertyPath(path) { var split = path.split(':'); var propertyPath = split[0]; - var classNames = ""; + var classNames = ''; var className, falsyClassName; // check if the property is defined as prop:class or prop:trueClass:falseClass if (split.length > 1) { className = split[1]; @@ -44076,11 +39028,11 @@ falsyClassName = split[2]; } classNames = ':' + className; if (falsyClassName) { - classNames += ":" + falsyClassName; + classNames += ':' + falsyClassName; } } return { path: propertyPath, @@ -44132,26 +39084,26 @@ } // If value is a Boolean and true, return the dasherized property // name. } else if (val === true) { - // Normalize property path to be suitable for use - // as a class name. For exaple, content.foo.barBaz - // becomes bar-baz. - var parts = path.split('.'); - return _emberRuntimeSystemString.dasherize(parts[parts.length - 1]); + // Normalize property path to be suitable for use + // as a class name. For exaple, content.foo.barBaz + // becomes bar-baz. + var parts = path.split('.'); + return _emberRuntimeSystemString.dasherize(parts[parts.length - 1]); - // If the value is not false, undefined, or null, return the current - // value of the property. - } else if (val !== false && val != null) { - return val; + // If the value is not false, undefined, or null, return the current + // value of the property. + } else if (val !== false && val != null) { + return val; - // Nothing to display. Return null so that the old class is removed - // but no new class is added. - } else { - return null; - } + // Nothing to display. Return null so that the old class is removed + // but no new class is added. + } else { + return null; + } } function streamifyClassNameBinding(view, classNameBinding, prefix) { prefix = prefix || ''; var parsedPath = parsePropertyPath(classNameBinding); @@ -44163,25 +39115,31 @@ return classStringForValue(parsedPath.path, _emberMetalStreamsUtils.read(pathValue), parsedPath.className, parsedPath.falsyClassName); }); } } }); -enifed("ember-views/streams/should_display", ["exports", "ember-metal/platform/create", "ember-metal/merge", "ember-metal/property_get", "ember-runtime/utils", "ember-metal/streams/stream", "ember-metal/streams/utils"], function (exports, _emberMetalPlatformCreate, _emberMetalMerge, _emberMetalProperty_get, _emberRuntimeUtils, _emberMetalStreamsStream, _emberMetalStreamsUtils) { - "use strict"; +enifed('ember-views/streams/should_display', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/property_get', 'ember-runtime/utils', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalProperty_get, _emberRuntimeUtils, _emberMetalStreamsStream, _emberMetalStreamsUtils) { + exports.default = shouldDisplay; - exports["default"] = shouldDisplay; - function shouldDisplay(predicate) { if (_emberMetalStreamsUtils.isStream(predicate)) { return new ShouldDisplayStream(predicate); } - var truthy = predicate && _emberMetalProperty_get.get(predicate, 'isTruthy'); - if (typeof truthy === 'boolean') { - return truthy; + var type = typeof predicate; + + if (type === 'boolean') { + return predicate; } + if (type && type === 'object') { + var isTruthy = _emberMetalProperty_get.get(predicate, 'isTruthy'); + if (typeof isTruthy === 'boolean') { + return isTruthy; + } + } + if (_emberRuntimeUtils.isArray(predicate)) { return _emberMetalProperty_get.get(predicate, 'length') !== 0; } else { return !!predicate; } @@ -44198,13 +39156,13 @@ this.addDependency(predicate); this.addDependency(isTruthy); } - ShouldDisplayStream.prototype = _emberMetalPlatformCreate["default"](_emberMetalStreamsStream["default"].prototype); + ShouldDisplayStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); - _emberMetalMerge["default"](ShouldDisplayStream.prototype, { + _emberMetalMerge.default(ShouldDisplayStream.prototype, { compute: function () { var truthy = _emberMetalStreamsUtils.read(this.isTruthy); if (typeof truthy === 'boolean') { return truthy; @@ -44229,13 +39187,11 @@ } } } }); }); -enifed("ember-views/streams/utils", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/path_cache", "ember-runtime/system/string", "ember-metal/streams/utils", "ember-runtime/mixins/controller"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalPath_cache, _emberRuntimeSystemString, _emberMetalStreamsUtils, _emberRuntimeMixinsController) { - "use strict"; - +enifed('ember-views/streams/utils', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/path_cache', 'ember-runtime/system/string', 'ember-metal/streams/utils', 'ember-runtime/mixins/controller'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalPath_cache, _emberRuntimeSystemString, _emberMetalStreamsUtils, _emberRuntimeMixinsController) { exports.readViewFactory = readViewFactory; exports.readComponentFactory = readComponentFactory; exports.readUnwrappedModel = readUnwrappedModel; function readViewFactory(object, container) { @@ -44267,11 +39223,11 @@ if (_emberMetalStreamsUtils.isStream(object)) { var result = object.value(); // If the path is exactly `controller` then we don't unwrap it. if (object.label !== 'controller') { - while (_emberRuntimeMixinsController["default"].detect(result)) { + while (_emberRuntimeMixinsController.default.detect(result)) { result = _emberMetalProperty_get.get(result, 'model'); } } return result; @@ -44284,12 +39240,10 @@ /** @module ember @submodule ember-views */ - "use strict"; - function ActionManager() {} /** Global action id hash. @@ -44297,19 +39251,15 @@ @property registeredActions @type Object */ ActionManager.registeredActions = {}; - exports["default"] = ActionManager; + exports.default = ActionManager; }); -enifed("ember-views/system/build-component-template", ["exports", "htmlbars-runtime", "ember-htmlbars/hooks/get-value", "ember-metal/property_get", "ember-metal/path_cache"], function (exports, _htmlbarsRuntime, _emberHtmlbarsHooksGetValue, _emberMetalProperty_get, _emberMetalPath_cache) { - "use strict"; +enifed('ember-views/system/build-component-template', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/path_cache', 'htmlbars-runtime', 'ember-htmlbars/hooks/get-value'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalPath_cache, _htmlbarsRuntime, _emberHtmlbarsHooksGetValue) { + exports.default = buildComponentTemplate; - exports["default"] = buildComponentTemplate; - exports.disableInputTypeChanging = disableInputTypeChanging; - exports.resetInputTypeChanging = resetInputTypeChanging; - function buildComponentTemplate(_ref, attrs, content) { var component = _ref.component; var layout = _ref.layout; var isAngleBracket = _ref.isAngleBracket; @@ -44321,23 +39271,23 @@ if (layout && layout.raw) { var yieldTo = createContentBlocks(content.templates, content.scope, content.self, component); blockToRender = createLayoutBlock(layout.raw, yieldTo, content.self, component, attrs); meta = layout.raw.meta; - } else if (content.templates && content.templates["default"]) { - blockToRender = createContentBlock(content.templates["default"], content.scope, content.self, component); - meta = content.templates["default"].meta; + } else if (content.templates && content.templates.default) { + blockToRender = createContentBlock(content.templates.default, content.scope, content.self, component); + meta = content.templates.default.meta; } if (component) { tagName = tagNameFor(component); // If this is not a tagless component, we need to create the wrapping // element. We use `manualElement` to create a template that represents // the wrapping element and yields to the previous block. if (tagName !== '') { - var attributes = normalizeComponentAttributes(component, isAngleBracket, attrs, tagName); + var attributes = normalizeComponentAttributes(component, isAngleBracket, attrs); var elementTemplate = _htmlbarsRuntime.internal.manualElement(tagName, attributes); elementTemplate.meta = meta; blockToRender = createElementBlock(elementTemplate, blockToRender, component); } else { @@ -44350,36 +39300,10 @@ // * the falsy value "" if set explicitly on the component // * an actual tagName set explicitly on the component return { createdElement: !!tagName, block: blockToRender }; } - // Static flag used to see if we can mutate the type attribute on input elements. IE8 - // does not support changing the type attribute after an element is inserted in - // a tree. - var isInputTypeAttributeMutable = (function () { - var docFragment = document.createDocumentFragment(); - var mutableInputTypeTextElement = document.createElement('input'); - mutableInputTypeTextElement.type = 'text'; - try { - docFragment.appendChild(mutableInputTypeTextElement); - mutableInputTypeTextElement.setAttribute('type', 'password'); - } catch (e) { - return false; - } - return true; - })(); - - var canChangeInputType = isInputTypeAttributeMutable; - - function disableInputTypeChanging() { - canChangeInputType = false; - } - - function resetInputTypeChanging() { - canChangeInputType = isInputTypeAttributeMutable; - } - function blockFor(template, options) { return _htmlbarsRuntime.internal.blockFor(_htmlbarsRuntime.render, template, options); } function createContentBlock(template, scope, self, component) { @@ -44443,59 +39367,35 @@ return tagName; } // Takes a component and builds a normalized set of attribute // bindings consumable by HTMLBars' `attribute` hook. - function normalizeComponentAttributes(component, isAngleBracket, attrs, tagName) { - var hardCodeType = tagName === 'input' && !canChangeInputType; + function normalizeComponentAttributes(component, isAngleBracket, attrs) { var normalized = {}; var attributeBindings = component.attributeBindings; var i, l; - if (attrs.id && _emberHtmlbarsHooksGetValue["default"](attrs.id)) { - // Do not allow binding to the `id` - normalized.id = _emberHtmlbarsHooksGetValue["default"](attrs.id); - component.elementId = normalized.id; - } else { - normalized.id = component.elementId; - } - if (attributeBindings) { for (i = 0, l = attributeBindings.length; i < l; i++) { var attr = attributeBindings[i]; var colonIndex = attr.indexOf(':'); var attrName, expression; if (colonIndex !== -1) { var attrProperty = attr.substring(0, colonIndex); attrName = attr.substring(colonIndex + 1); - - if (attrName === 'type' && hardCodeType) { - expression = component.get(attrProperty) + ''; - } else { - expression = ['get', 'view.' + attrProperty]; - } + expression = ['get', 'view.' + attrProperty]; } else if (attrs[attr]) { // TODO: For compatibility with 1.x, we probably need to `set` // the component's attribute here if it is a CP, but we also // probably want to suspend observers and allow the // willUpdateAttrs logic to trigger observers at the correct time. attrName = attr; - - if (attrName === 'type' && hardCodeType) { - expression = _emberHtmlbarsHooksGetValue["default"](attrs[attr]) + ''; - } else { - expression = ['value', attrs[attr]]; - } + expression = ['value', attrs[attr]]; } else { attrName = attr; - - if (attrName === 'type' && hardCodeType) { - expression = component.get(attr) + ''; - } else { - expression = ['get', 'view.' + attr]; - } + expression = ['get', 'view.' + attr]; } normalized[attrName] = expression; } @@ -44512,18 +39412,26 @@ normalized[prop] = ['value', val]; } } } + if (attrs.id && _emberHtmlbarsHooksGetValue.default(attrs.id)) { + // Do not allow binding to the `id` + normalized.id = _emberHtmlbarsHooksGetValue.default(attrs.id); + component.elementId = normalized.id; + } else { + normalized.id = component.elementId; + } + if (attrs.tagName) { component.tagName = attrs.tagName; } var normalizedClass = normalizeClass(component, attrs); if (normalizedClass) { - normalized["class"] = normalizedClass; + normalized.class = normalizedClass; } if (_emberMetalProperty_get.get(component, 'isVisible') === false) { var hiddenStyle = ['subexpr', '-html-safe', ['display: none;'], []]; var existingStyle = normalized.style; @@ -44542,22 +39450,26 @@ var i, l; var normalizedClass = []; var classNames = _emberMetalProperty_get.get(component, 'classNames'); var classNameBindings = _emberMetalProperty_get.get(component, 'classNameBindings'); - if (attrs["class"]) { - if (typeof attrs["class"] === 'string') { - normalizedClass.push(attrs["class"]); + if (attrs.class) { + if (typeof attrs.class === 'string') { + normalizedClass.push(attrs.class); } else { - normalizedClass.push(['subexpr', '-normalize-class', [['value', attrs["class"].path], ['value', attrs["class"]]], []]); + normalizedClass.push(['subexpr', '-normalize-class', [['value', attrs.class.path], ['value', attrs.class]], []]); } } if (attrs.classBinding) { normalizeClasses(attrs.classBinding.split(' '), normalizedClass); } + if (attrs.classNames) { + normalizedClass.push(['value', attrs.classNames]); + } + if (classNames) { for (i = 0, l = classNames.length; i < l; i++) { normalizedClass.push(classNames[i]); } } @@ -44601,16 +39513,11 @@ } function validateTaglessComponent(component) { } }); -enifed("ember-views/system/event_dispatcher", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/is_none", "ember-metal/run_loop", "ember-runtime/system/string", "ember-runtime/system/object", "ember-views/system/jquery", "ember-views/system/action_manager", "ember-views/views/view", "ember-metal/merge"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalIs_none, _emberMetalRun_loop, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberViewsViewsView, _emberMetalMerge) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +enifed('ember-views/system/event_dispatcher', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/is_none', 'ember-metal/run_loop', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'ember-views/views/view', 'ember-metal/merge'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalIs_none, _emberMetalRun_loop, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberViewsViewsView, _emberMetalMerge) { /** `Ember.EventDispatcher` handles delegating browser events to their corresponding `Ember.Views.` For example, when you click on a view, `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets @@ -44619,11 +39526,11 @@ @class EventDispatcher @namespace Ember @private @extends Ember.Object */ - exports["default"] = _emberRuntimeSystemObject["default"].extend({ + exports.default = _emberRuntimeSystemObject.default.extend({ /** The set of events names (and associated handler function names) to be setup and dispatched by the `EventDispatcher`. Custom events can added to this list at setup time, generally via the `Ember.Application.customEvents` hash. Only override this @@ -44715,17 +39622,17 @@ */ setup: function (addedEvents, rootElement) { var event; var events = _emberMetalProperty_get.get(this, 'events'); - _emberMetalMerge["default"](events, addedEvents || {}); + _emberMetalMerge.default(events, addedEvents || {}); - if (!_emberMetalIs_none["default"](rootElement)) { + if (!_emberMetalIs_none.default(rootElement)) { _emberMetalProperty_set.set(this, 'rootElement', rootElement); } - rootElement = _emberViewsSystemJquery["default"](_emberMetalProperty_get.get(this, 'rootElement')); + rootElement = _emberViewsSystemJquery.default(_emberMetalProperty_get.get(this, 'rootElement')); rootElement.addClass('ember-application'); @@ -44748,11 +39655,11 @@ @param {String} event the browser-originated event to listen to @param {String} eventName the name of the method to call on the view */ setupHandler: function (rootElement, event, eventName) { var self = this; - var viewRegistry = this.container && this.container.lookup('-view-registry:main') || _emberViewsViewsView["default"].views; + var viewRegistry = this.container && this.container.lookup('-view-registry:main') || _emberViewsViewsView.default.views; rootElement.on(event + '.ember', '.ember-view', function (evt, triggeringManager) { var view = viewRegistry[this.id]; var result = true; @@ -44766,12 +39673,12 @@ return result; }); rootElement.on(event + '.ember', '[data-ember-action]', function (evt) { - var actionId = _emberViewsSystemJquery["default"](evt.currentTarget).attr('data-ember-action'); - var actions = _emberViewsSystemAction_manager["default"].registeredActions[actionId]; + var actionId = _emberViewsSystemJquery.default(evt.currentTarget).attr('data-ember-action'); + var actions = _emberViewsSystemAction_manager.default.registeredActions[actionId]; // We have to check for actions here since in some cases, jQuery will trigger // an event on `removeChild` (i.e. focusout) after we've already torn down the // action handlers for the view. if (!actions) { @@ -44806,95 +39713,95 @@ _dispatchEvent: function (object, evt, eventName, view) { var result = true; var handler = object[eventName]; if (typeof handler === 'function') { - result = _emberMetalRun_loop["default"](object, handler, evt, view); + result = _emberMetalRun_loop.default(object, handler, evt, view); // Do not preventDefault in eventManagers. evt.stopPropagation(); } else { result = this._bubbleEvent(view, evt, eventName); } return result; }, _bubbleEvent: function (view, evt, eventName) { - return _emberMetalRun_loop["default"].join(view, view.handleEvent, eventName, evt); + return _emberMetalRun_loop.default.join(view, view.handleEvent, eventName, evt); }, destroy: function () { var rootElement = _emberMetalProperty_get.get(this, 'rootElement'); - _emberViewsSystemJquery["default"](rootElement).off('.ember', '**').removeClass('ember-application'); + _emberViewsSystemJquery.default(rootElement).off('.ember', '**').removeClass('ember-application'); return this._super.apply(this, arguments); }, toString: function () { return '(EventDispatcher)'; } }); }); +/** +@module ember +@submodule ember-views +*/ // Ember.assert enifed('ember-views/system/ext', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { - /** - @module ember - @submodule ember-views - */ - 'use strict'; - // Add a new named queue for rendering views that happens // after bindings have synced, and a queue for scheduling actions // that that should occur after view rendering. - _emberMetalRun_loop["default"]._addQueue('render', 'actions'); - _emberMetalRun_loop["default"]._addQueue('afterRender', 'render'); + _emberMetalRun_loop.default._addQueue('render', 'actions'); + _emberMetalRun_loop.default._addQueue('afterRender', 'render'); }); -enifed('ember-views/system/jquery', ['exports', 'ember-metal/core', 'ember-metal/enumerable_utils', 'ember-metal/environment'], function (exports, _emberMetalCore, _emberMetalEnumerable_utils, _emberMetalEnvironment) { - 'use strict'; +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/system/jquery', ['exports', 'ember-metal/core', 'ember-metal/environment'], function (exports, _emberMetalCore, _emberMetalEnvironment) { var jQuery; - if (_emberMetalEnvironment["default"].hasDOM) { + if (_emberMetalEnvironment.default.hasDOM) { // mainContext is set in `package/loader/lib/main.js` to the `this` context before entering strict mode - jQuery = _emberMetalCore["default"].imports && _emberMetalCore["default"].imports.jQuery || mainContext && mainContext.jQuery; //jshint ignore:line + jQuery = _emberMetalCore.default.imports && _emberMetalCore.default.imports.jQuery || mainContext && mainContext.jQuery; //jshint ignore:line if (!jQuery && typeof eriuqer === 'function') { jQuery = eriuqer('jquery'); } + if (jQuery) { // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents var dragEvents = ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend']; // Copies the `dataTransfer` property from a browser event object onto the // jQuery event object for the specified events - _emberMetalEnumerable_utils.forEach(dragEvents, function (eventName) { + dragEvents.forEach(function (eventName) { jQuery.event.fixHooks[eventName] = { props: ['dataTransfer'] }; }); } } - exports["default"] = jQuery; + exports.default = jQuery; }); // Ember.assert // ES6TODO: the functions on EnumerableUtils need their own exports -enifed("ember-views/system/lookup_partial", ["exports", "ember-metal/core", "ember-metal/error"], function (exports, _emberMetalCore, _emberMetalError) { - "use strict"; +enifed('ember-views/system/lookup_partial', ['exports', 'ember-metal/core', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalError) { + exports.default = lookupPartial; - exports["default"] = lookupPartial; - function lookupPartial(env, templateName) { if (templateName == null) { return; } - var nameParts = templateName.split("/"); + var nameParts = templateName.split('/'); var lastPart = nameParts[nameParts.length - 1]; - nameParts[nameParts.length - 1] = "_" + lastPart; + nameParts[nameParts.length - 1] = '_' + lastPart; var underscoredName = nameParts.join('/'); var template = templateFor(env, underscoredName, templateName); @@ -44905,24 +39812,23 @@ if (!name) { return; } if (!env.container) { - throw new _emberMetalError["default"]('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); + throw new _emberMetalError.default('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); } return env.container.lookup('template:' + underscored) || env.container.lookup('template:' + name); } }); // Ember.assert enifed('ember-views/system/platform', ['exports', 'ember-metal/environment'], function (exports, _emberMetalEnvironment) { - 'use strict'; // IE 6/7 have bugs around setting names on inputs during creation. // From http://msdn.microsoft.com/en-us/library/ie/ms536389(v=vs.85).aspx: // "To include the NAME attribute at run time on objects created with the createElement method, use the eTag." - var canSetNameOnInputs = _emberMetalEnvironment["default"].hasDOM && (function () { + var canSetNameOnInputs = _emberMetalEnvironment.default.hasDOM && (function () { var div = document.createElement('div'); var el = document.createElement('input'); el.setAttribute('name', 'foo'); div.appendChild(el); @@ -44930,21 +39836,18 @@ return !!div.innerHTML.match('foo'); })(); exports.canSetNameOnInputs = canSetNameOnInputs; }); enifed("ember-views/system/utils", ["exports"], function (exports) { + exports.isSimpleClick = isSimpleClick; + exports.getViewClientRects = getViewClientRects; + exports.getViewBoundingClientRect = getViewBoundingClientRect; /** @module ember @submodule ember-views */ - "use strict"; - - exports.isSimpleClick = isSimpleClick; - exports.getViewClientRects = getViewClientRects; - exports.getViewBoundingClientRect = getViewBoundingClientRect; - function isSimpleClick(event) { var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey; var secondaryClick = event.which > 1; // IE9 may return undefined return !modifier && !secondaryClick; @@ -44994,12 +39897,11 @@ function getViewBoundingClientRect(view) { var range = getViewRange(view); return range.getBoundingClientRect(); } }); -enifed("ember-views/views/checkbox", ["exports", "ember-metal/property_get", "ember-metal/property_set", "ember-views/views/view"], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberViewsViewsView) { - "use strict"; +enifed('ember-views/views/checkbox', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-views/views/component'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberViewsViewsComponent) { /** @module ember @submodule ember-views */ @@ -45024,15 +39926,14 @@ properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s layout section for more information. @class Checkbox @namespace Ember - @extends Ember.View + @extends Ember.Component @public */ - // 2.0TODO: Subclass Component rather than View - exports["default"] = _emberViewsViewsView["default"].extend({ + exports.default = _emberViewsViewsComponent.default.extend({ instrumentDisplay: '{{input type="checkbox"}}', classNames: ['ember-checkbox'], tagName: 'input', @@ -45057,18 +39958,12 @@ _updateElementValue: function () { _emberMetalProperty_set.set(this, 'checked', this.$().prop('checked')); } }); }); -enifed("ember-views/views/collection_view", ["exports", "ember-metal/core", "ember-views/views/container_view", "ember-views/views/view", "ember-runtime/mixins/array", "ember-metal/property_get", "ember-metal/property_set", "ember-runtime/system/string", "ember-metal/computed", "ember-metal/mixin", "ember-views/streams/utils", "ember-views/mixins/empty_view_support"], function (exports, _emberMetalCore, _emberViewsViewsContainer_view, _emberViewsViewsView, _emberRuntimeMixinsArray, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemString, _emberMetalComputed, _emberMetalMixin, _emberViewsStreamsUtils, _emberViewsMixinsEmpty_view_support) { - /** - @module ember - @submodule ember-views - */ +enifed('ember-views/views/collection_view', ['exports', 'ember-metal/core', 'ember-views/views/container_view', 'ember-views/views/view', 'ember-runtime/mixins/array', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/string', 'ember-metal/computed', 'ember-metal/mixin', 'ember-views/streams/utils', 'ember-views/mixins/empty_view_support'], function (exports, _emberMetalCore, _emberViewsViewsContainer_view, _emberViewsViewsView, _emberRuntimeMixinsArray, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemString, _emberMetalComputed, _emberMetalMixin, _emberViewsStreamsUtils, _emberViewsMixinsEmpty_view_support) { - "use strict"; - /** `Ember.CollectionView` is an `Ember.View` descendent responsible for managing a collection (an array or array-like object) by maintaining a child view object and associated DOM representation for each item in the array and ensuring that child views and their associated rendered HTML are updated when items in @@ -45230,11 +40125,11 @@ @extends Ember.ContainerView @uses Ember.EmptyViewSupport @since Ember 0.9 @private */ - var CollectionView = _emberViewsViewsContainer_view["default"].extend(_emberViewsMixinsEmpty_view_support["default"], { + var CollectionView = _emberViewsViewsContainer_view.default.extend(_emberViewsMixinsEmpty_view_support.default, { /** A list of items to be displayed by the `Ember.CollectionView`. @property content @type Ember.Array @@ -45247,11 +40142,11 @@ @property itemViewClass @type Ember.View @default Ember.View @private */ - itemViewClass: _emberViewsViewsView["default"], + itemViewClass: _emberViewsViewsView.default, /** Setup a CollectionView @method init @private @@ -45489,34 +40384,19 @@ } return props; } - function viewDeprecationMessage() { - } - - var DeprecatedCollectionView = CollectionView.extend({ - init: function () { - viewDeprecationMessage(); - this._super.apply(this, arguments); - } - }); - - DeprecatedCollectionView.reopen = function () { - viewDeprecationMessage(); - CollectionView.reopen.apply(CollectionView, arguments); - return this; - }; - - DeprecatedCollectionView.CONTAINER_MAP = CONTAINER_MAP; - - exports["default"] = CollectionView; - exports.DeprecatedCollectionView = DeprecatedCollectionView; + exports.default = CollectionView; }); +/** +@module ember +@submodule ember-views +*/ + // Ember.assert -enifed("ember-views/views/component", ["exports", "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", "ember-views/compat/attrs-proxy"], function (exports, _emberMetalCore, _emberViewsMixinsComponent_template_deprecation, _emberRuntimeMixinsTarget_action_support, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalIs_none, _emberMetalComputed, _emberViewsCompatAttrsProxy) { - "use strict"; +enifed('ember-views/views/component', ['exports', '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', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalCore, _emberViewsMixinsComponent_template_deprecation, _emberRuntimeMixinsTarget_action_support, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalIs_none, _emberMetalComputed, _emberViewsCompatAttrsProxy) { function validateAction(component, actionName) { if (actionName && actionName[_emberViewsCompatAttrsProxy.MUTABLE_CELL]) { actionName = actionName.value; } @@ -45612,11 +40492,11 @@ @class Component @namespace Ember @extends Ember.View @public */ - var Component = _emberViewsViewsView["default"].extend(_emberRuntimeMixinsTarget_action_support["default"], _emberViewsMixinsComponent_template_deprecation["default"], { + var Component = _emberViewsViewsView.default.extend(_emberRuntimeMixinsTarget_action_support.default, _emberViewsMixinsComponent_template_deprecation.default, { isComponent: true, /* This is set so that the proto inspection in appendTemplatedView does not think that it should set the components `context` to that of the parent view. */ @@ -45650,22 +40530,22 @@ also specifying the layout property. @deprecated @property template @public */ - template: _emberMetalComputed.computed({ + template: _emberMetalComputed.computed('_template', { get: function () { return _emberMetalProperty_get.get(this, '_template'); }, set: function (key, value) { return _emberMetalProperty_set.set(this, '_template', value); } }), - _template: _emberMetalComputed.computed({ + _template: _emberMetalComputed.computed('templateName', { get: function () { if (_emberMetalProperty_get.get(this, '_deprecatedFlagForBlockProvided')) { return true; } var templateName = _emberMetalProperty_get.get(this, 'templateName'); @@ -45705,83 +40585,78 @@ var parentView = _emberMetalProperty_get.get(this, 'parentView'); return parentView ? _emberMetalProperty_get.get(parentView, 'controller') : null; }), /** - Calls a action passed to a component. + Triggers a named action on the controller context where the component is used if + this controller has registered for notifications of the action. For example a component for playing or pausing music may translate click events into action notifications of "play" or "stop" depending on some internal state of the component: - ```javascript - // app/components/play-button.js - export default Ember.Component.extend({ - click() { + ```javascript + App.PlayButtonComponent = Ember.Component.extend({ + click: function() { if (this.get('isPlaying')) { this.sendAction('play'); } else { this.sendAction('stop'); } } }); ``` - The actions "play" and "stop" must be passed to this `play-button` component: + When used inside a template these component actions are configured to + trigger actions in the outer application context: ```handlebars - {{! app/templates/application.hbs }} - {{play-button play=(action "musicStarted") stop=(action "musicStopped")}} + {{! application.hbs }} + {{play-button play="musicStarted" stop="musicStopped"}} ``` When the component receives a browser `click` event it translate this interaction into application-specific semantics ("play" or "stop") and - calls the specified action. - ```javascript - // app/controller/application.js - export default Ember.Controller.extend({ + triggers the specified action name on the controller for the template + where the component is used: + ```javascript + App.ApplicationController = Ember.Controller.extend({ actions: { - musicStarted() { + musicStarted: function() { // called when the play button is clicked // and the music started playing }, - musicStopped() { + musicStopped: function() { // called when the play button is clicked // and the music stopped playing } } }); ``` - If no action is passed to `sendAction` a default name of "action" + If no action name is passed to `sendAction` a default name of "action" is assumed. ```javascript - // app/components/next-button.js - export default Ember.Component.extend({ - click() { + App.NextButtonComponent = Ember.Component.extend({ + click: function() { this.sendAction(); } }); ``` ```handlebars - {{! app/templates/application.hbs }} - {{next-button action=(action "playNextSongInAlbum")}} + {{! application.hbs }} + {{next-button action="playNextSongInAlbum"}} ``` ```javascript - // app/controllers/application.js App.ApplicationController = Ember.Controller.extend({ actions: { - playNextSongInAlbum() { + playNextSongInAlbum: function() { ... } } }); ``` @method sendAction - @param [action] {String} the action to call - @param [params] {*} arguments for the action + @param [action] {String} the action to trigger + @param [context] {*} a context to send with the action @public */ sendAction: function (action) { - for (var _len = arguments.length, contexts = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - contexts[_key - 1] = arguments[_key]; - } - var actionName; // Send the default action if (action === undefined) { action = 'action'; @@ -45792,10 +40667,14 @@ // If no action name for that action could be found, just abort. if (actionName === undefined) { return; } + for (var _len = arguments.length, contexts = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + contexts[_key - 1] = arguments[_key]; + } + if (typeof actionName === 'function') { actionName.apply(null, contexts); } else { this.triggerAction({ action: actionName, @@ -45818,16 +40697,14 @@ return; } } if (target = _emberMetalProperty_get.get(this, 'target')) { - var _target; - - (_target = target).send.apply(_target, arguments); + target.send.apply(target, arguments); } else { if (!hasAction) { - throw new Error(_emberMetalCore["default"].inspect(this) + ' had no action handler for: ' + actionName); + throw new Error(_emberMetalCore.default.inspect(this) + ' had no action handler for: ' + actionName); } } } /** @@ -45893,18 +40770,16 @@ Component.reopenClass({ isComponentFactory: true }); - exports["default"] = Component; + exports.default = Component; }); // Ember.assert, Ember.Handlebars -enifed("ember-views/views/container_view", ["exports", "ember-metal/core", "ember-runtime/mixins/mutable_array", "ember-views/views/view", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/enumerable_utils", "ember-metal/mixin", "ember-metal/events", "ember-htmlbars/templates/container-view"], function (exports, _emberMetalCore, _emberRuntimeMixinsMutable_array, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalEnumerable_utils, _emberMetalMixin, _emberMetalEvents, _emberHtmlbarsTemplatesContainerView) { - "use strict"; +enifed('ember-views/views/container_view', ['exports', 'ember-metal/core', 'ember-runtime/mixins/mutable_array', 'ember-views/views/view', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/events', 'ember-htmlbars/templates/container-view'], function (exports, _emberMetalCore, _emberRuntimeMixinsMutable_array, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalEvents, _emberHtmlbarsTemplatesContainerView) { + _emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.0.0-beta.2'; - _emberHtmlbarsTemplatesContainerView["default"].meta.revision = 'Ember@1.13.13'; - /** @module ember @submodule ember-views */ @@ -46055,45 +40930,46 @@ representation will only be the rendered HTML of its child views. @class ContainerView @namespace Ember @extends Ember.View - @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-containerview @private */ - var ContainerView = _emberViewsViewsView["default"].extend(_emberRuntimeMixinsMutable_array["default"], { + var ContainerView = _emberViewsViewsView.default.extend(_emberRuntimeMixinsMutable_array.default, { willWatchProperty: function (prop) { }, init: function () { + var _this = this; + this._super.apply(this, arguments); var userChildViews = _emberMetalProperty_get.get(this, 'childViews'); // redefine view's childViews property that was obliterated // 2.0TODO: Don't Ember.A() this so users disabling prototype extensions // don't pay a penalty. - var childViews = this.childViews = _emberMetalCore["default"].A([]); + var childViews = this.childViews = _emberMetalCore.default.A([]); - _emberMetalEnumerable_utils.forEach(userChildViews, function (viewName, idx) { + userChildViews.forEach(function (viewName, idx) { var view; if ('string' === typeof viewName) { - view = _emberMetalProperty_get.get(this, viewName); - view = this.createChildView(view); - _emberMetalProperty_set.set(this, viewName, view); + view = _emberMetalProperty_get.get(_this, viewName); + view = _this.createChildView(view); + _emberMetalProperty_set.set(_this, viewName, view); } else { - view = this.createChildView(viewName); + view = _this.createChildView(viewName); } childViews[idx] = view; - }, this); + }); var currentView = _emberMetalProperty_get.get(this, 'currentView'); if (currentView) { if (!childViews.length) { - childViews = this.childViews = _emberMetalCore["default"].A(this.childViews.slice()); + childViews = this.childViews = _emberMetalCore.default.A(this.childViews.slice()); } childViews.push(this.createChildView(currentView)); } _emberMetalProperty_set.set(this, 'length', childViews.length); @@ -46124,14 +41000,14 @@ if (currentView) { this.pushObject(currentView); } }), - layout: _emberHtmlbarsTemplatesContainerView["default"], + layout: _emberHtmlbarsTemplatesContainerView.default, replace: function (idx, removedCount) { - var _this = this; + var _this2 = this; var addedViews = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2]; var addedCount = _emberMetalProperty_get.get(addedViews, 'length'); var childViews = _emberMetalProperty_get.get(this, 'childViews'); @@ -46146,15 +41022,15 @@ // // Because of this, we synchronously fix up the parentView/childViews tree // as soon as views are added or removed, despite the fact that this will // happen automatically when we render. var removedViews = childViews.slice(idx, idx + removedCount); - _emberMetalEnumerable_utils.forEach(removedViews, function (view) { - return _this.unlinkChild(view); + removedViews.forEach(function (view) { + return _this2.unlinkChild(view); }); - _emberMetalEnumerable_utils.forEach(addedViews, function (view) { - return _this.linkChild(view); + addedViews.forEach(function (view) { + return _this2.linkChild(view); }); childViews.splice.apply(childViews, [idx, removedCount].concat(addedViews)); this.notifyPropertyChange('childViews'); @@ -46188,31 +41064,13 @@ } } }) }); - function containerViewDeprecationMessage() { - } - - var DeprecatedContainerView = ContainerView.extend({ - init: function () { - containerViewDeprecationMessage(); - this._super.apply(this, arguments); - } - }); - - exports.DeprecatedContainerView = DeprecatedContainerView; - DeprecatedContainerView.reopen = function () { - containerViewDeprecationMessage(); - ContainerView.reopen.apply(ContainerView, arguments); - return this; - }; - - exports["default"] = ContainerView; + exports.default = ContainerView; }); -enifed("ember-views/views/core_view", ["exports", "ember-metal-views/renderer", "ember-views/views/states", "ember-runtime/system/object", "ember-runtime/mixins/evented", "ember-runtime/mixins/action_handler", "ember-metal/property_get", "ember-runtime/utils", "htmlbars-runtime"], function (exports, _emberMetalViewsRenderer, _emberViewsViewsStates, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRuntimeMixinsAction_handler, _emberMetalProperty_get, _emberRuntimeUtils, _htmlbarsRuntime) { - "use strict"; +enifed('ember-views/views/core_view', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/action_handler', 'ember-runtime/utils', 'ember-metal-views/renderer', 'ember-views/views/states', 'htmlbars-runtime'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRuntimeMixinsAction_handler, _emberRuntimeUtils, _emberMetalViewsRenderer, _emberViewsViewsStates, _htmlbarsRuntime) { function K() { return this; } @@ -46237,11 +41095,11 @@ @deprecated Use `Ember.View` instead. @uses Ember.Evented @uses Ember.ActionHandler @private */ - var CoreView = _emberRuntimeSystemObject["default"].extend(_emberRuntimeMixinsEvented["default"], _emberRuntimeMixinsAction_handler["default"], { + var CoreView = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default, _emberRuntimeMixinsAction_handler.default, { isView: true, _states: _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states), init: function () { @@ -46252,11 +41110,11 @@ // Fallback for legacy cases where the view was created directly // via `create()` instead of going through the container. if (!this.renderer) { var DOMHelper = domHelper(); - renderer = renderer || new _emberMetalViewsRenderer["default"](new DOMHelper()); + renderer = renderer || new _emberMetalViewsRenderer.default(new DOMHelper()); this.renderer = renderer; } this._destroyingSubtreeForView = null; this._dispatching = null; @@ -46343,24 +41201,18 @@ }); exports.DeprecatedCoreView = DeprecatedCoreView; var _domHelper; function domHelper() { - return _domHelper = _domHelper || Ember.__loader.require("ember-htmlbars/system/dom-helper")['default']; + return _domHelper = _domHelper || _emberMetalCore.default.__loader.require('ember-htmlbars/system/dom-helper')['default']; } - exports["default"] = CoreView; + exports.default = CoreView; }); -enifed("ember-views/views/legacy_each_view", ["exports", "ember-htmlbars/templates/legacy-each", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/computed", "ember-views/views/view", "ember-views/views/collection_view", "ember-views/mixins/empty_view_support"], function (exports, _emberHtmlbarsTemplatesLegacyEach, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberViewsViewsView, _emberViewsViewsCollection_view, _emberViewsMixinsEmpty_view_support) { - //2.0TODO: Remove this in 2.0 - //This is a fallback path for the `{{#each}}` helper that supports deprecated - //behavior such as itemController. - - "use strict"; - - exports["default"] = _emberViewsViewsView["default"].extend(_emberViewsMixinsEmpty_view_support["default"], { - template: _emberHtmlbarsTemplatesLegacyEach["default"], +enifed('ember-views/views/legacy_each_view', ['exports', 'ember-htmlbars/templates/legacy-each', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-views/views/view', 'ember-views/views/collection_view', 'ember-views/mixins/empty_view_support'], function (exports, _emberHtmlbarsTemplatesLegacyEach, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberViewsViewsView, _emberViewsViewsCollection_view, _emberViewsMixinsEmpty_view_support) { + exports.default = _emberViewsViewsView.default.extend(_emberViewsMixinsEmpty_view_support.default, { + template: _emberHtmlbarsTemplatesLegacyEach.default, tagName: '', _arrayController: _emberMetalComputed.computed(function () { var itemController = this.getAttr('itemController'); var controller = _emberMetalProperty_get.get(this, 'container').lookupFactory('controller:array').create({ @@ -46396,46 +41248,43 @@ var tagName = _emberMetalProperty_get.get(this, 'tagName'); return _emberViewsViewsCollection_view.CONTAINER_MAP[tagName]; }) }); }); -enifed("ember-views/views/select", ["exports", "ember-metal/enumerable_utils", "ember-metal/property_get", "ember-metal/property_set", "ember-views/views/view", "ember-runtime/utils", "ember-metal/is_none", "ember-metal/computed", "ember-runtime/system/native_array", "ember-metal/mixin", "ember-metal/properties", "ember-htmlbars/templates/select", "ember-htmlbars/templates/select-option", "ember-htmlbars/templates/select-optgroup"], function (exports, _emberMetalEnumerable_utils, _emberMetalProperty_get, _emberMetalProperty_set, _emberViewsViewsView, _emberRuntimeUtils, _emberMetalIs_none, _emberMetalComputed, _emberRuntimeSystemNative_array, _emberMetalMixin, _emberMetalProperties, _emberHtmlbarsTemplatesSelect, _emberHtmlbarsTemplatesSelectOption, _emberHtmlbarsTemplatesSelectOptgroup) { - /** - @module ember - @submodule ember-views - */ +//2.0TODO: Remove this in 2.0 +//This is a fallback path for the `{{#each}}` helper that supports deprecated +//behavior such as itemController. +enifed('ember-views/views/select', ['exports', 'ember-metal/core', 'ember-metal/replace', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-views/views/view', 'ember-runtime/utils', 'ember-metal/is_none', 'ember-metal/computed', 'ember-runtime/system/native_array', 'ember-metal/mixin', 'ember-metal/properties', 'ember-htmlbars/templates/select', 'ember-htmlbars/templates/select-option', 'ember-htmlbars/templates/select-optgroup'], function (exports, _emberMetalCore, _emberMetalReplace, _emberMetalProperty_get, _emberMetalProperty_set, _emberViewsViewsView, _emberRuntimeUtils, _emberMetalIs_none, _emberMetalComputed, _emberRuntimeSystemNative_array, _emberMetalMixin, _emberMetalProperties, _emberHtmlbarsTemplatesSelect, _emberHtmlbarsTemplatesSelectOption, _emberHtmlbarsTemplatesSelectOptgroup) { - "use strict"; + var defaultTemplate = _emberHtmlbarsTemplatesSelect.default; - var defaultTemplate = _emberHtmlbarsTemplatesSelect["default"]; - - var SelectOption = _emberViewsViewsView["default"].extend({ + var SelectOption = _emberViewsViewsView.default.extend({ instrumentDisplay: 'Ember.SelectOption', tagName: 'option', attributeBindings: ['value', 'selected'], - defaultTemplate: _emberHtmlbarsTemplatesSelectOption["default"], + defaultTemplate: _emberHtmlbarsTemplatesSelectOption.default, content: null, _willRender: function () { this.labelPathDidChange(); this.valuePathDidChange(); }, - selected: _emberMetalComputed.computed(function () { + selected: _emberMetalComputed.computed('attrs.content', 'attrs.selection', function () { var value = _emberMetalProperty_get.get(this, 'value'); var selection = _emberMetalProperty_get.get(this, 'attrs.selection'); if (_emberMetalProperty_get.get(this, 'attrs.multiple')) { - return selection && _emberMetalEnumerable_utils.indexOf(selection, value) > -1; + return selection && selection.indexOf(value) > -1; } else { // Primitives get passed through bindings as objects... since // `new Number(4) !== 4`, we use `==` below return value == _emberMetalProperty_get.get(this, 'attrs.parentValue'); // jshint ignore:line } - }).property('attrs.content', 'attrs.selection'), + }), labelPathDidChange: _emberMetalMixin.observer('attrs.optionLabelPath', function () { var labelPath = _emberMetalProperty_get.get(this, 'attrs.optionLabelPath'); _emberMetalProperties.defineProperty(this, 'label', _emberMetalComputed.computed.alias(labelPath)); }), @@ -46444,15 +41293,15 @@ var valuePath = _emberMetalProperty_get.get(this, 'attrs.optionValuePath'); _emberMetalProperties.defineProperty(this, 'value', _emberMetalComputed.computed.alias(valuePath)); }) }); - var SelectOptgroup = _emberViewsViewsView["default"].extend({ + var SelectOptgroup = _emberViewsViewsView.default.extend({ instrumentDisplay: 'Ember.SelectOptgroup', tagName: 'optgroup', - defaultTemplate: _emberHtmlbarsTemplatesSelectOptgroup["default"], + defaultTemplate: _emberHtmlbarsTemplatesSelectOptgroup.default, attributeBindings: ['label'] }); /** The `Ember.Select` view class renders a @@ -46694,11 +41543,11 @@ @namespace Ember @extends Ember.View @public @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-select */ - var Select = _emberViewsViewsView["default"].extend({ + var Select = _emberViewsViewsView.default.extend({ instrumentDisplay: 'Ember.Select', tagName: 'select', classNames: ['ember-select'], defaultTemplate: defaultTemplate, @@ -46776,19 +41625,19 @@ @property value @type String @default null @public */ - value: _emberMetalComputed.computed({ + value: _emberMetalComputed.computed('_valuePath', 'selection', { get: function (key) { var valuePath = _emberMetalProperty_get.get(this, '_valuePath'); return valuePath ? _emberMetalProperty_get.get(this, 'selection.' + valuePath) : _emberMetalProperty_get.get(this, 'selection'); }, set: function (key, value) { return value; } - }).property('_valuePath', 'selection'), + }), /** If given, a top-most dummy option will be rendered to serve as a user prompt. @property prompt @@ -46833,16 +41682,16 @@ @default Ember.SelectOptgroup @public */ groupView: SelectOptgroup, - groupedContent: _emberMetalComputed.computed(function () { + groupedContent: _emberMetalComputed.computed('optionGroupPath', 'content.@each', function () { var groupPath = _emberMetalProperty_get.get(this, 'optionGroupPath'); var groupedContent = _emberRuntimeSystemNative_array.A(); var content = _emberMetalProperty_get.get(this, 'content') || []; - _emberMetalEnumerable_utils.forEach(content, function (item) { + content.forEach(function (item) { var label = _emberMetalProperty_get.get(item, groupPath); if (_emberMetalProperty_get.get(groupedContent, 'lastObject.label') !== label) { groupedContent.pushObject({ label: label, @@ -46852,11 +41701,11 @@ _emberMetalProperty_get.get(groupedContent, 'lastObject.content').push(item); }); return groupedContent; - }).property('optionGroupPath', 'content.[]'), + }), /** The view class for option. @property optionView @type Ember.View @@ -46871,11 +41720,11 @@ } else { this._changeSingle(hasDOM); } }, - selectionDidChange: _emberMetalMixin.observer('selection.[]', function () { + selectionDidChange: _emberMetalMixin.observer('selection.@each', function () { var selection = _emberMetalProperty_get.get(this, 'selection'); if (_emberMetalProperty_get.get(this, 'multiple')) { if (!_emberRuntimeUtils.isArray(selection)) { _emberMetalProperty_set.set(this, 'selection', _emberRuntimeSystemNative_array.A([selection])); return; @@ -46904,17 +41753,17 @@ _setDefaults: function () { var selection = _emberMetalProperty_get.get(this, 'selection'); var value = _emberMetalProperty_get.get(this, 'value'); - if (!_emberMetalIs_none["default"](selection)) { + if (!_emberMetalIs_none.default(selection)) { this.selectionDidChange(); } - if (!_emberMetalIs_none["default"](value)) { + if (!_emberMetalIs_none.default(value)) { this.valueDidChange(); } - if (_emberMetalIs_none["default"](selection)) { + if (_emberMetalIs_none.default(selection)) { this._change(false); } }, _changeSingle: function (hasDOM) { @@ -46940,11 +41789,11 @@ _selectedIndex: function (value) { var defaultIndex = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; var content = _emberMetalProperty_get.get(this, 'contentValues'); - var selectionIndex = _emberMetalEnumerable_utils.indexOf(content, value); + var selectionIndex = content.indexOf(value); var prompt = _emberMetalProperty_get.get(this, 'prompt'); if (prompt) { selectionIndex += 1; } @@ -46971,11 +41820,11 @@ return this.index - offset; }); var newSelection = content.objectsAt([].slice.call(selectedIndexes)); if (_emberRuntimeUtils.isArray(selection)) { - _emberMetalEnumerable_utils.replace(selection, 0, _emberMetalProperty_get.get(selection, 'length'), newSelection); + _emberMetalReplace.default(selection, 0, _emberMetalProperty_get.get(selection, 'length'), newSelection); } else { _emberMetalProperty_set.set(this, 'selection', newSelection); } } }, @@ -47012,125 +41861,133 @@ contentValues: _emberMetalComputed.computed('content.[]', '_valuePath', function () { var valuePath = _emberMetalProperty_get.get(this, '_valuePath'); var content = _emberMetalProperty_get.get(this, 'content') || []; if (valuePath) { - return _emberMetalEnumerable_utils.map(content, function (el) { + return content.map(function (el) { return _emberMetalProperty_get.get(el, valuePath); }); } else { - return _emberMetalEnumerable_utils.map(content, function (el) { - return el; - }); + return content.slice(); } }), _selectionDidChangeMultiple: function () { var content = _emberMetalProperty_get.get(this, 'content'); var selection = _emberMetalProperty_get.get(this, 'selection'); - var selectedIndexes = content ? _emberMetalEnumerable_utils.indexesOf(content, selection) : [-1]; + var selectedIndexes = content ? indexesOf(content, selection) : [-1]; var prompt = _emberMetalProperty_get.get(this, 'prompt'); var offset = prompt ? 1 : 0; var options = this.$('option'); var adjusted; if (options) { options.each(function () { adjusted = this.index > -1 ? this.index - offset : -1; - this.selected = _emberMetalEnumerable_utils.indexOf(selectedIndexes, adjusted) > -1; + this.selected = selectedIndexes.indexOf(adjusted) > -1; }); } }, _willRender: function () { this._setDefaults(); }, init: function () { this._super.apply(this, arguments); - this.on("change", this, this._change); + this.on('change', this, this._change); } }); - function selectViewDeprecationMessage() { - } - var DeprecatedSelect = Select.extend({ init: function () { - selectViewDeprecationMessage(); this._super.apply(this, arguments); - } + } }); - DeprecatedSelect.reopen = function () { - selectViewDeprecationMessage(); - Select.reopen.apply(Select, arguments); - return this; - }; + function indexesOf(iterable, elements) { + return elements === undefined ? [] : elements.map(function (item) { + return iterable.indexOf(item); + }); + } - exports["default"] = Select; + exports.default = Select; exports.Select = Select; exports.DeprecatedSelect = DeprecatedSelect; exports.SelectOption = SelectOption; exports.SelectOptgroup = SelectOptgroup; }); -enifed("ember-views/views/states", ["exports", "ember-metal/platform/create", "ember-metal/merge", "ember-views/views/states/default", "ember-views/views/states/pre_render", "ember-views/views/states/has_element", "ember-views/views/states/in_dom", "ember-views/views/states/destroying"], function (exports, _emberMetalPlatformCreate, _emberMetalMerge, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { - "use strict"; - +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/views/states', ['exports', 'ember-metal/merge', 'ember-views/views/states/default', 'ember-views/views/states/pre_render', 'ember-views/views/states/has_element', 'ember-views/views/states/in_dom', 'ember-views/views/states/destroying'], function (exports, _emberMetalMerge, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { exports.cloneStates = cloneStates; function cloneStates(from) { var into = {}; into._default = {}; - into.preRender = _emberMetalPlatformCreate["default"](into._default); - into.destroying = _emberMetalPlatformCreate["default"](into._default); - into.hasElement = _emberMetalPlatformCreate["default"](into._default); - into.inDOM = _emberMetalPlatformCreate["default"](into.hasElement); + into.preRender = Object.create(into._default); + into.destroying = Object.create(into._default); + into.hasElement = Object.create(into._default); + into.inDOM = Object.create(into.hasElement); for (var stateName in from) { if (!from.hasOwnProperty(stateName)) { continue; } - _emberMetalMerge["default"](into[stateName], from[stateName]); + _emberMetalMerge.default(into[stateName], from[stateName]); } return into; } var states = { - _default: _emberViewsViewsStatesDefault["default"], - preRender: _emberViewsViewsStatesPre_render["default"], - inDOM: _emberViewsViewsStatesIn_dom["default"], - hasElement: _emberViewsViewsStatesHas_element["default"], - destroying: _emberViewsViewsStatesDestroying["default"] + _default: _emberViewsViewsStatesDefault.default, + preRender: _emberViewsViewsStatesPre_render.default, + inDOM: _emberViewsViewsStatesIn_dom.default, + hasElement: _emberViewsViewsStatesHas_element.default, + destroying: _emberViewsViewsStatesDestroying.default }; exports.states = states; }); -enifed("ember-views/views/states/default", ["exports", "ember-metal/error", "ember-metal/property_get", "ember-views/compat/attrs-proxy"], function (exports, _emberMetalError, _emberMetalProperty_get, _emberViewsCompatAttrsProxy) { - "use strict"; +enifed('ember-views/views/states/default', ['exports', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_events, _emberViewsCompatAttrsProxy) { /** @module ember @submodule ember-views */ - exports["default"] = { + exports.default = { // appendChild is only legal while rendering the buffer. appendChild: function () { - throw new _emberMetalError["default"]("You can't use appendChild outside of the rendering process"); + throw new _emberMetalError.default('You can\'t use appendChild outside of the rendering process'); }, $: function () { return undefined; }, getElement: function () { return null; }, + legacyAttrWillChange: function (view, key) { + if (key in view.attrs && !(key in view)) { + _emberMetalProperty_events.propertyWillChange(view, key); + } + }, + + legacyAttrDidChange: function (view, key) { + if (key in view.attrs && !(key in view)) { + _emberMetalProperty_events.propertyDidChange(view, key); + } + }, + legacyPropertyDidChange: function (view, key) { var attrs = view.attrs; + if (attrs && key in attrs) { var possibleCell = attrs[key]; if (possibleCell && possibleCell[_emberViewsCompatAttrsProxy.MUTABLE_CELL]) { var value = _emberMetalProperty_get.get(view, key); @@ -47154,56 +42011,53 @@ view.renderer.ensureViewNotRendering(view); }, invokeObserver: function () {} }; }); -enifed("ember-views/views/states/destroying", ["exports", "ember-metal/merge", "ember-metal/platform/create", "ember-runtime/system/string", "ember-views/views/states/default", "ember-metal/error"], function (exports, _emberMetalMerge, _emberMetalPlatformCreate, _emberRuntimeSystemString, _emberViewsViewsStatesDefault, _emberMetalError) { - "use strict"; - +enifed('ember-views/views/states/destroying', ['exports', 'ember-metal/merge', 'ember-runtime/system/string', 'ember-views/views/states/default', 'ember-metal/error'], function (exports, _emberMetalMerge, _emberRuntimeSystemString, _emberViewsViewsStatesDefault, _emberMetalError) { /** @module ember @submodule ember-views */ - var destroyingError = "You can't call %@ on a view being destroyed"; + var destroyingError = 'You can\'t call %@ on a view being destroyed'; - var destroying = _emberMetalPlatformCreate["default"](_emberViewsViewsStatesDefault["default"]); + var destroying = Object.create(_emberViewsViewsStatesDefault.default); - _emberMetalMerge["default"](destroying, { + _emberMetalMerge.default(destroying, { appendChild: function () { - throw new _emberMetalError["default"](_emberRuntimeSystemString.fmt(destroyingError, ['appendChild'])); + throw new _emberMetalError.default(_emberRuntimeSystemString.fmt(destroyingError, ['appendChild'])); }, rerender: function () { - throw new _emberMetalError["default"](_emberRuntimeSystemString.fmt(destroyingError, ['rerender'])); + throw new _emberMetalError.default(_emberRuntimeSystemString.fmt(destroyingError, ['rerender'])); }, destroyElement: function () { - throw new _emberMetalError["default"](_emberRuntimeSystemString.fmt(destroyingError, ['destroyElement'])); + throw new _emberMetalError.default(_emberRuntimeSystemString.fmt(destroyingError, ['destroyElement'])); } }); - exports["default"] = destroying; + exports.default = destroying; }); -enifed("ember-views/views/states/has_element", ["exports", "ember-views/views/states/default", "ember-metal/merge", "ember-metal/platform/create", "ember-views/system/jquery", "ember-metal/property_get", "htmlbars-runtime"], function (exports, _emberViewsViewsStatesDefault, _emberMetalMerge, _emberMetalPlatformCreate, _emberViewsSystemJquery, _emberMetalProperty_get, _htmlbarsRuntime) { - "use strict"; +enifed('ember-views/views/states/has_element', ['exports', 'ember-views/views/states/default', 'ember-metal/merge', 'ember-views/system/jquery', 'ember-metal/property_get', 'htmlbars-runtime'], function (exports, _emberViewsViewsStatesDefault, _emberMetalMerge, _emberViewsSystemJquery, _emberMetalProperty_get, _htmlbarsRuntime) { - var hasElement = _emberMetalPlatformCreate["default"](_emberViewsViewsStatesDefault["default"]); + var hasElement = Object.create(_emberViewsViewsStatesDefault.default); - _emberMetalMerge["default"](hasElement, { + _emberMetalMerge.default(hasElement, { $: function (view, sel) { var elem = view.element; - return sel ? _emberViewsSystemJquery["default"](sel, elem) : _emberViewsSystemJquery["default"](elem); + return sel ? _emberViewsSystemJquery.default(sel, elem) : _emberViewsSystemJquery.default(elem); }, getElement: function (view) { var parent = _emberMetalProperty_get.get(view, 'parentView'); if (parent) { parent = _emberMetalProperty_get.get(parent, 'element'); } if (parent) { return view.findElementInParentElement(parent); } - return _emberViewsSystemJquery["default"]("#" + _emberMetalProperty_get.get(view, 'elementId'))[0]; + return _emberViewsSystemJquery.default('#' + _emberMetalProperty_get.get(view, 'elementId'))[0]; }, // once the view has been inserted into the DOM, rerendering is // deferred to allow bindings to synchronize. rerender: function (view) { @@ -47217,11 +42071,11 @@ node.shouldReceiveAttrs = true; } node.isDirty = true; }); - renderNode.ownerNode.emberView.scheduleRevalidate(renderNode, view.toString(), "rerendering"); + renderNode.ownerNode.emberView.scheduleRevalidate(renderNode, view.toString(), 'rerendering'); }, cleanup: function (view) { view.currentState.destroyElement(view); }, @@ -47249,28 +42103,26 @@ invokeObserver: function (target, observer) { observer.call(target); } }); - exports["default"] = hasElement; + exports.default = hasElement; }); /** @module ember @submodule ember-views */ -enifed('ember-views/views/states/in_dom', ['exports', 'ember-metal/core', 'ember-metal/platform/create', 'ember-metal/merge', 'ember-metal/error', 'ember-metal/observer', 'ember-views/views/states/has_element'], function (exports, _emberMetalCore, _emberMetalPlatformCreate, _emberMetalMerge, _emberMetalError, _emberMetalObserver, _emberViewsViewsStatesHas_element) { - 'use strict'; - +enifed('ember-views/views/states/in_dom', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/error', 'ember-metal/observer', 'ember-views/views/states/has_element'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalError, _emberMetalObserver, _emberViewsViewsStatesHas_element) { /** @module ember @submodule ember-views */ - var inDOM = _emberMetalPlatformCreate["default"](_emberViewsViewsStatesHas_element["default"]); + var inDOM = Object.create(_emberViewsViewsStatesHas_element.default); - _emberMetalMerge["default"](inDOM, { + _emberMetalMerge.default(inDOM, { enter: function (view) { // Register the view for event handling. This hash is used by // Ember.EventDispatcher to dispatch incoming events. if (view.tagName !== '') { view._register(); @@ -47298,34 +42150,30 @@ return attrNode; } }); - exports["default"] = inDOM; + exports.default = inDOM; }); -enifed("ember-views/views/states/pre_render", ["exports", "ember-views/views/states/default", "ember-metal/platform/create", "ember-metal/merge"], function (exports, _emberViewsViewsStatesDefault, _emberMetalPlatformCreate, _emberMetalMerge) { - "use strict"; +enifed('ember-views/views/states/pre_render', ['exports', 'ember-views/views/states/default', 'ember-metal/merge'], function (exports, _emberViewsViewsStatesDefault, _emberMetalMerge) { /** @module ember @submodule ember-views */ - var preRender = _emberMetalPlatformCreate["default"](_emberViewsViewsStatesDefault["default"]); + var preRender = Object.create(_emberViewsViewsStatesDefault.default); - _emberMetalMerge["default"](preRender, { + _emberMetalMerge.default(preRender, { + legacyAttrWillChange: function (view, key) {}, + legacyAttrDidChange: function (view, key) {}, legacyPropertyDidChange: function (view, key) {} }); - exports["default"] = preRender; + exports.default = preRender; }); -enifed("ember-views/views/text_area", ["exports", "ember-views/views/component", "ember-views/mixins/text_support"], function (exports, _emberViewsViewsComponent, _emberViewsMixinsText_support) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +enifed('ember-views/views/text_area', ['exports', 'ember-views/views/component', 'ember-views/mixins/text_support'], function (exports, _emberViewsViewsComponent, _emberViewsMixinsText_support) { /** The internal class used to create textarea element when the `{{textarea}}` helper is used. @@ -47341,38 +42189,37 @@ @namespace Ember @extends Ember.Component @uses Ember.TextSupport @public */ - exports["default"] = _emberViewsViewsComponent["default"].extend(_emberViewsMixinsText_support["default"], { + exports.default = _emberViewsViewsComponent.default.extend(_emberViewsMixinsText_support.default, { instrumentDisplay: '{{textarea}}', classNames: ['ember-text-area'], - tagName: "textarea", + tagName: 'textarea', attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap', 'lang', 'dir', 'value'], rows: null, cols: null }); }); -enifed("ember-views/views/text_field", ["exports", "ember-metal/computed", "ember-metal/environment", "ember-metal/platform/create", "ember-views/views/component", "ember-views/mixins/text_support"], function (exports, _emberMetalComputed, _emberMetalEnvironment, _emberMetalPlatformCreate, _emberViewsViewsComponent, _emberViewsMixinsText_support) { - /** - @module ember - @submodule ember-views - */ - "use strict"; +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/views/text_field', ['exports', 'ember-metal/computed', 'ember-metal/environment', 'ember-views/views/component', 'ember-views/mixins/text_support'], function (exports, _emberMetalComputed, _emberMetalEnvironment, _emberViewsViewsComponent, _emberViewsMixinsText_support) { var inputTypeTestElement; - var inputTypes = _emberMetalPlatformCreate["default"](null); + var inputTypes = Object.create(null); function canSetTypeOfInput(type) { if (type in inputTypes) { return inputTypes[type]; } // if running in outside of a browser always return the // original type - if (!_emberMetalEnvironment["default"].hasDOM) { + if (!_emberMetalEnvironment.default.hasDOM) { inputTypes[type] = type; return type; } @@ -47404,15 +42251,15 @@ @namespace Ember @extends Ember.Component @uses Ember.TextSupport @public */ - exports["default"] = _emberViewsViewsComponent["default"].extend(_emberViewsMixinsText_support["default"], { + exports.default = _emberViewsViewsComponent.default.extend(_emberViewsMixinsText_support.default, { instrumentDisplay: '{{input type="text"}}', classNames: ['ember-text-field'], - tagName: "input", + tagName: 'input', attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'type', 'value', 'width'], defaultLayout: null, /** @@ -47421,16 +42268,14 @@ @property value @type String @default "" @public */ - value: "", + value: '', /** - The `type` attribute of the input element. To remain compatible with IE8, this - cannot change after the element has been rendered. It is suggested to avoid using - a dynamic type attribute if you are supporting IE8 since it will be set once and never change. + The `type` attribute of the input element. @property type @type String @default "text" @public */ @@ -47487,16 +42332,15 @@ @public */ max: null }); }); -enifed("ember-views/views/view", ["exports", "ember-metal/core", "ember-runtime/mixins/evented", "ember-runtime/system/object", "ember-metal/error", "ember-metal/property_get", "ember-metal/run_loop", "ember-metal/observer", "ember-metal/utils", "ember-metal/computed", "ember-metal/mixin", "ember-metal/deprecate_property", "ember-views/system/jquery", "ember-views/system/ext", "ember-views/views/core_view", "ember-views/mixins/view_context_support", "ember-views/mixins/view_child_views_support", "ember-views/mixins/view_state_support", "ember-views/mixins/template_rendering_support", "ember-views/mixins/class_names_support", "ember-views/mixins/legacy_view_support", "ember-views/mixins/instrumentation_support", "ember-views/mixins/aria_role_support", "ember-views/mixins/visibility_support", "ember-views/compat/attrs-proxy"], function (exports, _emberMetalCore, _emberRuntimeMixinsEvented, _emberRuntimeSystemObject, _emberMetalError, _emberMetalProperty_get, _emberMetalRun_loop, _emberMetalObserver, _emberMetalUtils, _emberMetalComputed, _emberMetalMixin, _emberMetalDeprecate_property, _emberViewsSystemJquery, _emberViewsSystemExt, _emberViewsViewsCore_view, _emberViewsMixinsView_context_support, _emberViewsMixinsView_child_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsTemplate_rendering_support, _emberViewsMixinsClass_names_support, _emberViewsMixinsLegacy_view_support, _emberViewsMixinsInstrumentation_support, _emberViewsMixinsAria_role_support, _emberViewsMixinsVisibility_support, _emberViewsCompatAttrsProxy) { - // Ember.assert, Ember.deprecate, Ember.warn, Ember.TEMPLATES, - // jQuery, Ember.lookup, - // Ember.ContainerView circular dependency - // Ember.ENV - "use strict"; +/** +@module ember +@submodule ember-views +*/ +enifed('ember-views/views/view', ['exports', 'ember-metal/core', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-views/system/jquery', 'ember-views/system/ext', 'ember-views/views/core_view', 'ember-views/mixins/view_context_support', 'ember-views/mixins/view_child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/template_rendering_support', 'ember-views/mixins/class_names_support', 'ember-views/mixins/legacy_view_support', 'ember-views/mixins/instrumentation_support', 'ember-views/mixins/aria_role_support', 'ember-views/mixins/visibility_support', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalCore, _emberMetalError, _emberMetalProperty_get, _emberMetalRun_loop, _emberMetalObserver, _emberMetalUtils, _emberMetalComputed, _emberMetalMixin, _emberViewsSystemJquery, _emberViewsSystemExt, _emberViewsViewsCore_view, _emberViewsMixinsView_context_support, _emberViewsMixinsView_child_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsTemplate_rendering_support, _emberViewsMixinsClass_names_support, _emberViewsMixinsLegacy_view_support, _emberViewsMixinsInstrumentation_support, _emberViewsMixinsAria_role_support, _emberViewsMixinsVisibility_support, _emberViewsCompatAttrsProxy) { function K() { return this; } @@ -47514,11 +42358,11 @@ @property TEMPLATES @for Ember @type Object @private */ - _emberMetalCore["default"].TEMPLATES = {}; + _emberMetalCore.default.TEMPLATES = {}; /** `Ember.View` is the class in Ember responsible for encapsulating templates of HTML content, combining templates with data to render as sections of a page's DOM, and registering and responding to user-initiated events. @@ -47565,13 +42409,13 @@ ```javascript MyView = Ember.View.extend({ classNameBindings: ['propertyA', 'propertyB'], propertyA: 'from-a', - propertyB: function() { + propertyB: Ember.computed(function() { if (someLogic) { return 'from-b'; } - }.property() + }) }); ``` Will result in view instances with an HTML representation of: @@ -47780,17 +42624,17 @@ ```javascript MyTextInput = Ember.View.extend({ tagName: 'input', attributeBindings: ['disabled'], - disabled: function() { + disabled: Ember.computed(function() { if (someLogic) { return true; } else { return false; } - }.property() + }) }); ``` Updates to the the property of an attribute binding will result in automatic update of the HTML attribute in the view's rendered HTML representation. @@ -47833,11 +42677,11 @@ AView = Ember.View.extend({ templateName: 'some-template' }); ``` - If you have nested resources, your Handlebars template will look like this: + If you have nested routes, your Handlebars template will look like this: ```html <script type='text/x-handlebars' data-template-name='posts/new'> <h1>New Post</h1> </script> @@ -47902,13 +42746,13 @@ template: Ember.HTMLBars.compile('Hello {{excitedGreeting}}') }); aController = Ember.Object.create({ firstName: 'Barry', - excitedGreeting: function() { - return this.get("content.firstName") + "!!!" - }.property() + excitedGreeting: Ember.computed('content.firstName', function() { + return this.get('content.firstName') + '!!!'; + }) }); aView = AView.create({ controller: aController }); @@ -48130,11 +42974,11 @@ @uses Ember.VisibilitySupport @uses Ember.AriaRoleSupport @public */ // jscs:disable validateIndentation - var View = _emberViewsViewsCore_view["default"].extend(_emberViewsMixinsView_context_support["default"], _emberViewsMixinsView_child_views_support["default"], _emberViewsMixinsView_state_support["default"], _emberViewsMixinsTemplate_rendering_support["default"], _emberViewsMixinsClass_names_support["default"], _emberViewsMixinsLegacy_view_support["default"], _emberViewsMixinsInstrumentation_support["default"], _emberViewsMixinsVisibility_support["default"], _emberViewsCompatAttrsProxy["default"], _emberViewsMixinsAria_role_support["default"], { + var View = _emberViewsViewsCore_view.default.extend(_emberViewsMixinsView_context_support.default, _emberViewsMixinsView_child_views_support.default, _emberViewsMixinsView_state_support.default, _emberViewsMixinsTemplate_rendering_support.default, _emberViewsMixinsClass_names_support.default, _emberViewsMixinsLegacy_view_support.default, _emberViewsMixinsInstrumentation_support.default, _emberViewsMixinsVisibility_support.default, _emberViewsCompatAttrsProxy.default, _emberViewsMixinsAria_role_support.default, { concatenatedProperties: ['attributeBindings'], /** @property isView @type Boolean @@ -48164,11 +43008,11 @@ By default `Ember.View` will lookup a template with this name in `Ember.TEMPLATES` (a shared global object). @property layoutName @type String @default null - @public + @private */ layoutName: null, /** The template used to render the view. This should be a function that @@ -48178,11 +43022,11 @@ the template yourself. @property template @type Function @private */ - template: _emberMetalComputed.computed({ + template: _emberMetalComputed.computed('templateName', { get: function () { var templateName = _emberMetalProperty_get.get(this, 'templateName'); var template = this.templateForName(templateName, 'template'); return template || _emberMetalProperty_get.get(this, 'defaultTemplate'); }, @@ -48203,13 +43047,13 @@ This is useful for a view that has a shared wrapper, but which delegates the rendering of the contents of the wrapper to the `template` property on a subclass. @property layout @type Function - @public + @private */ - layout: _emberMetalComputed.computed({ + layout: _emberMetalComputed.computed('layoutName', { get: function (key) { var layoutName = _emberMetalProperty_get.get(this, 'layoutName'); var layout = this.templateForName(layoutName, 'layout'); @@ -48225,11 +43069,11 @@ if (!name) { return; } if (!this.container) { - throw new _emberMetalError["default"]('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); + throw new _emberMetalError.default('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); } return this.container.lookup('template:' + name); }, @@ -48392,11 +43236,11 @@ @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object @return {Ember.View} receiver @private */ appendTo: function (selector) { - var target = _emberViewsSystemJquery["default"](selector); + var target = _emberViewsSystemJquery.default(selector); this.renderer.appendTo(this, target[0]); return this; @@ -48457,11 +43301,11 @@ @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object @return {Ember.View} received @private */ replaceIn: function (selector) { - var target = _emberViewsSystemJquery["default"](selector); + var target = _emberViewsSystemJquery.default(selector); this.renderer.replaceIn(this, target[0]); return this; @@ -48516,14 +43360,14 @@ should never change it. If you need to compute a dynamic value for the `elementId`, you should do this when the component or element is being instantiated: ```javascript export default Ember.Component.extend({ - setElementId: function() { + setElementId: Ember.on('init', function() { var index = this.get('index'); this.set('elementId', 'component-id' + index); - }.on('init') + }) }); ``` @property elementId @type String @public @@ -48540,12 +43384,12 @@ @param {DOMElement} parentElement The parent's DOM element @return {DOMElement} The discovered element @private */ findElementInParentElement: function (parentElem) { - var id = "#" + this.elementId; - return _emberViewsSystemJquery["default"](id)[0] || _emberViewsSystemJquery["default"](id, parentElem)[0]; + var id = '#' + this.elementId; + return _emberViewsSystemJquery.default(id)[0] || _emberViewsSystemJquery.default(id, parentElem)[0]; }, /** Creates a DOM representation of the view and all of its child views by recursively calling the `render()` method. Once the element is created, @@ -48714,15 +43558,12 @@ this._super.apply(this, arguments); if (!this._viewRegistry) { this._viewRegistry = View.views; } + }, - this.renderer.componentInitAttrs(this, this.attrs || {}); - - }, - __defineNonEnumerable: function (property) { this[property.name] = property.descriptor.value; }, revalidate: function () { @@ -48733,18 +43574,18 @@ scheduleRevalidate: function (node, label, manualRerender) { if (node && !this._dispatching && node.guid in this.env.renderedNodes) { if (manualRerender) { } else { } - _emberMetalRun_loop["default"].scheduleOnce('render', this, this.revalidate); + _emberMetalRun_loop.default.scheduleOnce('render', this, this.revalidate); return; } if (!this.scheduledRevalidation || this._dispatching) { this.scheduledRevalidation = true; - _emberMetalRun_loop["default"].scheduleOnce('render', this, this.revalidate); + _emberMetalRun_loop.default.scheduleOnce('render', this, this.revalidate); } }, appendAttr: function (node, buffer) { return this.currentState.appendAttr(this, node, buffer); @@ -48862,20 +43703,17 @@ var view = this; var stateCheckedFn = function () { view.currentState.invokeObserver(this, fn); }; var scheduledFn = function () { - _emberMetalRun_loop["default"].scheduleOnce('render', this, stateCheckedFn); + _emberMetalRun_loop.default.scheduleOnce('render', this, stateCheckedFn); }; return scheduledFn; } }); // jscs:enable validateIndentation - _emberMetalDeprecate_property.deprecateProperty(View.prototype, 'state', '_state'); - _emberMetalDeprecate_property.deprecateProperty(View.prototype, 'states', '_states'); - /* Describe how the specified actions should behave in the various states that a view can exist in. Possible states: * preRender: when a view is first instantiated, and after its @@ -48899,91 +43737,68 @@ // inside the buffer, legal manipulations are done on the buffer // once the view has been inserted into the DOM, legal manipulations // are done on the DOM element. - var mutation = _emberRuntimeSystemObject["default"].extend(_emberRuntimeMixinsEvented["default"]).create(); - // TODO MOVE TO RENDERER HOOKS - View.addMutationListener = function (callback) { - mutation.on('change', callback); - }; + /** + Global views hash + + @property views + @static + @type Object + @private + */ + View.views = {}; - View.removeMutationListener = function (callback) { - mutation.off('change', callback); - }; + // If someone overrides the child views computed property when + // defining their class, we want to be able to process the user's + // supplied childViews and then restore the original computed property + // at view initialization time. This happens in Ember.ContainerView's init + // method. + View.childViewsProperty = _emberViewsMixinsView_child_views_support.childViewsProperty; - View.notifyMutationListeners = function () { - mutation.trigger('change'); - }; - - View.reopenClass({ - /** - Global views hash - @property views - @static - @type Object - @private - */ - views: {}, - - // If someone overrides the child views computed property when - // defining their class, we want to be able to process the user's - // supplied childViews and then restore the original computed property - // at view initialization time. This happens in Ember.ContainerView's init - // method. - childViewsProperty: _emberViewsMixinsView_child_views_support.childViewsProperty - }); - - function viewDeprecationMessage() { - } - var DeprecatedView = View.extend({ init: function () { - viewDeprecationMessage(); this._super.apply(this, arguments); - } + } }); - DeprecatedView.reopen = function () { - viewDeprecationMessage(); - View.reopen.apply(View, arguments); - return this; - }; - - exports["default"] = View; - exports.ViewContextSupport = _emberViewsMixinsView_context_support["default"]; - exports.ViewChildViewsSupport = _emberViewsMixinsView_child_views_support["default"]; - exports.ViewStateSupport = _emberViewsMixinsView_state_support["default"]; - exports.TemplateRenderingSupport = _emberViewsMixinsTemplate_rendering_support["default"]; - exports.ClassNamesSupport = _emberViewsMixinsClass_names_support["default"]; + exports.default = View; + exports.ViewContextSupport = _emberViewsMixinsView_context_support.default; + exports.ViewChildViewsSupport = _emberViewsMixinsView_child_views_support.default; + exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; + exports.TemplateRenderingSupport = _emberViewsMixinsTemplate_rendering_support.default; + exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; exports.DeprecatedView = DeprecatedView; }); +// Ember.assert, Ember.deprecate, Ember.warn, Ember.TEMPLATES, +// jQuery, Ember.lookup, +// Ember.ContainerView circular dependency +// Ember.ENV // for the side effect of extending Ember.run.queues -enifed("ember", ["exports", "ember-metal", "ember-runtime", "ember-views", "ember-routing", "ember-application", "ember-extension-support", "ember-htmlbars", "ember-routing-htmlbars", "ember-routing-views", "ember-metal/environment", "ember-runtime/system/lazy_load"], function (exports, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport, _emberHtmlbars, _emberRoutingHtmlbars, _emberRoutingViews, _emberMetalEnvironment, _emberRuntimeSystemLazy_load) { - // require the main entry points for each of these packages - // this is so that the global exports occur properly - "use strict"; +enifed('ember', ['exports', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support', 'ember-htmlbars', 'ember-routing-htmlbars', 'ember-routing-views', 'ember-metal/core', 'ember-metal/environment', 'ember-runtime/system/lazy_load'], function (exports, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport, _emberHtmlbars, _emberRoutingHtmlbars, _emberRoutingViews, _emberMetalCore, _emberMetalEnvironment, _emberRuntimeSystemLazy_load) { - if (Ember.__loader.registry['ember-template-compiler']) { + if (_emberMetalCore.default.__loader.registry['ember-template-compiler']) { requireModule('ember-template-compiler'); } // do this to ensure that Ember.Test is defined properly on the global // if it is present. - if (Ember.__loader.registry['ember-testing']) { + if (_emberMetalCore.default.__loader.registry['ember-testing']) { requireModule('ember-testing'); } _emberRuntimeSystemLazy_load.runLoadHooks('Ember'); /** @module ember */ }); +// require the main entry points for each of these packages +// this is so that the global exports occur properly enifed('htmlbars-runtime', ['exports', './htmlbars-runtime/hooks', './htmlbars-runtime/render', '../htmlbars-util/morph-utils', '../htmlbars-util/template-utils', './htmlbars-runtime/expression-visitor', 'htmlbars-runtime/hooks'], function (exports, _htmlbarsRuntimeHooks, _htmlbarsRuntimeRender, _htmlbarsUtilMorphUtils, _htmlbarsUtilTemplateUtils, _htmlbarsRuntimeExpressionVisitor, _htmlbarsRuntimeHooks2) { - 'use strict'; var internal = { blockFor: _htmlbarsUtilTemplateUtils.blockFor, manualElement: _htmlbarsRuntimeRender.manualElement, hostBlock: _htmlbarsRuntimeHooks2.hostBlock, @@ -48992,16 +43807,15 @@ visitChildren: _htmlbarsUtilMorphUtils.visitChildren, validateChildMorphs: _htmlbarsRuntimeExpressionVisitor.validateChildMorphs, clearMorph: _htmlbarsUtilTemplateUtils.clearMorph }; - exports.hooks = _htmlbarsRuntimeHooks["default"]; - exports.render = _htmlbarsRuntimeRender["default"]; + exports.hooks = _htmlbarsRuntimeHooks.default; + exports.render = _htmlbarsRuntimeRender.default; exports.internal = internal; }); enifed("htmlbars-runtime/expression-visitor", ["exports", "../htmlbars-util/object-utils", "../htmlbars-util/morph-utils"], function (exports, _htmlbarsUtilObjectUtils, _htmlbarsUtilMorphUtils) { - "use strict"; /** Node classification: # Primary Statement Nodes: @@ -49034,24 +43848,24 @@ acceptExpression: function (node, env, scope) { var ret = { value: null }; // Primitive literals are unambiguously non-array representations of // themselves. - if (typeof node !== 'object' || node === null) { + if (typeof node !== "object" || node === null) { ret.value = node; return ret; } switch (node[0]) { // can be used by manualElement - case 'value': + case "value": ret.value = node[1];break; - case 'get': + case "get": ret.value = this.get(node, env, scope);break; - case 'subexpr': + case "subexpr": ret.value = this.subexpr(node, env, scope);break; - case 'concat': + case "concat": ret.value = this.concat(node, env, scope);break; } return ret; }, @@ -49140,11 +43954,11 @@ morph.isDirty = morph.isSubtreeDirty = false; if (isHelper(env, scope, path)) { env.hooks.inline(morph, env, scope, path, [], {}, visitor); if (morph.linkedResult) { - _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, '@content-helper', [morph.linkedResult], null); + _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, "@content-helper", [morph.linkedResult], null); } return; } var params; @@ -49152,11 +43966,11 @@ params = morph.linkedParams.params; } else { params = [env.hooks.get(env, scope, path)]; } - _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, '@range', params, null); + _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, "@range", params, null); env.hooks.range(morph, env, scope, path, params[0], visitor); }, // [ 'element', path, params, hash ] element: function (node, morph, env, scope, visitor) { @@ -49171,11 +43985,11 @@ // [ 'attribute', name, value ] attribute: function (node, morph, env, scope) { var name = node[1], value = node[2]; - var paramsAndHash = this.linkParamsAndHash(env, scope, morph, '@attribute', [value], null); + var paramsAndHash = this.linkParamsAndHash(env, scope, morph, "@attribute", [value], null); morph.isDirty = morph.isSubtreeDirty = false; env.hooks.attribute(morph, env, scope, name, paramsAndHash[0][0]); }, @@ -49185,11 +43999,11 @@ attrs = node[2], templateId = node[3], inverseId = node[4]; var paramsAndHash = this.linkParamsAndHash(env, scope, morph, path, [], attrs); var templates = { - "default": template.templates[templateId], + default: template.templates[templateId], inverse: template.templates[inverseId] }; morph.isDirty = morph.isSubtreeDirty = false; env.hooks.component(morph, env, scope, path, paramsAndHash[0], paramsAndHash[1], templates, visitor); @@ -49201,11 +44015,11 @@ env.hooks.attributes(morph, env, scope, template, parentMorph, visitor); } }); exports.AlwaysDirtyVisitor = AlwaysDirtyVisitor; - exports["default"] = _htmlbarsUtilObjectUtils.merge(Object.create(base), { + exports.default = _htmlbarsUtilObjectUtils.merge(Object.create(base), { // [ 'block', path, params, hash, templateId, inverseId ] block: function (node, morph, env, scope, template, visitor) { dirtyCheck(env, morph, visitor, function (visitor) { AlwaysDirtyVisitor.block(node, morph, env, scope, template, visitor); }); @@ -49274,12 +44088,10 @@ function isHelper(env, scope, path) { return env.hooks.keywords[path] !== undefined || env.hooks.hasHelper(env, scope, path); } }); enifed("htmlbars-runtime/hooks", ["exports", "./render", "../morph-range/morph-list", "../htmlbars-util/object-utils", "../htmlbars-util/morph-utils", "../htmlbars-util/template-utils"], function (exports, _render, _morphRangeMorphList, _htmlbarsUtilObjectUtils, _htmlbarsUtilMorphUtils, _htmlbarsUtilTemplateUtils) { - "use strict"; - exports.wrap = wrap; exports.wrapForHelper = wrapForHelper; exports.hostYieldWithShadowTemplate = hostYieldWithShadowTemplate; exports.createScope = createScope; exports.createFreshScope = createFreshScope; @@ -49403,11 +44215,11 @@ options = options || {}; options.self = self; options.blockArguments = blockArguments; - return _render["default"](template, env, scope, options); + return _render.default(template, env, scope, options); } }; } function wrapForHelper(template, env, scope, morph, renderState, visitor) { @@ -49420,11 +44232,11 @@ var yieldArgs = yieldTemplate(template, env, scope, morph, renderState, visitor); return { meta: template.meta, arity: template.arity, - "yield": yieldArgs, + yield: yieldArgs, yieldItem: yieldItem(template, env, scope, morph, renderState, visitor), yieldIn: yieldInShadowTemplate(template, env, scope, morph, renderState, visitor), raw: template, render: function (self, blockArguments) { @@ -49471,11 +44283,11 @@ } morph.lastYielded = { self: self, template: template, shadowTemplate: null }; // Render the template that was selected by the helper - _render["default"](template, env, scope, { renderNode: morph, self: self, blockArguments: blockArguments }); + _render.default(template, env, scope, { renderNode: morph, self: self, blockArguments: blockArguments }); }; } function yieldItem(template, env, parentScope, morph, renderState, visitor) { // Initialize state that tracks multiple items being @@ -49510,24 +44322,24 @@ currentMorph = seek.nextMorph; return seek; } - return function (_key, blockArguments, self) { - if (typeof _key !== 'string') { - throw new Error("You must provide a string key when calling `yieldItem`; you provided " + _key); + return function (key, blockArguments, self) { + if (typeof key !== "string") { + throw new Error("You must provide a string key when calling `yieldItem`; you provided " + key); } // At least one item has been yielded, so we do not wholesale // clear the last MorphList but instead apply a prune operation. renderState.morphListToClear = null; morph.lastYielded = null; var morphList, morphMap; if (!morph.morphList) { - morph.morphList = new _morphRangeMorphList["default"](); + morph.morphList = new _morphRangeMorphList.default(); morph.morphMap = {}; morph.setMorphList(morph.morphList); } morphList = morph.morphList; @@ -49536,30 +44348,11 @@ // A map of morphs that have been yielded in on this // rendering pass. Any morphs that do not make it into // this list will be pruned from the MorphList during the cleanup // process. var handledMorphs = renderState.handledMorphs; - var key = undefined; - if (_key in handledMorphs) { - // In this branch we are dealing with a duplicate key. The strategy - // is to take the original key and append a counter to it that is - // incremented every time the key is reused. In order to greatly - // reduce the chance of colliding with another valid key we also add - // an extra string "--z8mS2hvDW0A--" to the new key. - var collisions = renderState.collisions; - if (collisions === undefined) { - collisions = renderState.collisions = {}; - } - var count = collisions[_key] | 0; - collisions[_key] = ++count; - - key = _key + '--z8mS2hvDW0A--' + count; - } else { - key = _key; - } - if (currentMorph && currentMorph.key === key) { yieldTemplate(template, env, parentScope, currentMorph, renderState, visitor)(blockArguments, self); currentMorph = currentMorph.nextMorph; handledMorphs[key] = currentMorph; } else if (morphMap[key] !== undefined) { @@ -49614,11 +44407,11 @@ env.hooks.bindBlock(env, shadowScope, blockToYield); morph.lastYielded = { self: self, template: template, shadowTemplate: shadowTemplate }; // Render the shadow template with the block available - _render["default"](shadowTemplate.raw, env, shadowScope, { renderNode: morph, self: self, blockArguments: blockArguments }); + _render.default(shadowTemplate.raw, env, shadowScope, { renderNode: morph, self: self, blockArguments: blockArguments }); }; function blockToYield(env, blockArguments, self, renderNode, shadowParent, visitor) { if (renderNode.lastResult) { renderNode.lastResult.revalidateWith(env, undefined, undefined, blockArguments, visitor); @@ -49629,11 +44422,11 @@ // we only need to create a new scope if the template has block parameters if (template.arity) { scope = env.hooks.createChildScope(parentScope); } - _render["default"](template, env, scope, { renderNode: renderNode, self: self, blockArguments: blockArguments }); + _render.default(template, env, scope, { renderNode: renderNode, self: self, blockArguments: blockArguments }); } } } function isStableShadowRoot(template, shadowTemplate, lastYielded) { @@ -49656,11 +44449,11 @@ } function thisFor(options) { return { arity: options.template.arity, - "yield": options.template["yield"], + yield: options.template.yield, yieldItem: options.template.yieldItem, yieldIn: options.template.yieldIn }; } @@ -49831,11 +44624,11 @@ `{{yield}}` is used. Optionally provide a non-default block name that can be targeted by `{{yield to=blockName}}`. */ function bindBlock(env, scope, block) { - var name = arguments.length <= 3 || arguments[3] === undefined ? 'default' : arguments[3]; + var name = arguments.length <= 3 || arguments[3] === undefined ? "default" : arguments[3]; scope.blocks[name] = block; } /** @@ -49913,15 +44706,15 @@ } var redirect = env.hooks.classify(env, scope, path); if (redirect) { switch (redirect) { - case 'component': - env.hooks.component(morph, env, scope, path, params, hash, { "default": template, inverse: inverse }, visitor);break; - case 'inline': + case "component": + env.hooks.component(morph, env, scope, path, params, hash, { default: template, inverse: inverse }, visitor);break; + case "inline": env.hooks.inline(morph, env, scope, path, params, hash, visitor);break; - case 'block': + case "block": env.hooks.block(morph, env, scope, path, params, hash, template, inverse, visitor);break; default: throw new Error("Internal HTMLBars redirection to " + redirect + " not supported"); } return true; @@ -49938,11 +44731,11 @@ var keyword = env.hooks.keywords[path]; if (!keyword) { return false; } - if (typeof keyword === 'function') { + if (typeof keyword === "function") { return keyword(morph, env, scope, params, hash, template, inverse, visitor); } if (keyword.willRender) { keyword.willRender(morph, env); @@ -50024,11 +44817,11 @@ } return true; } - function linkRenderNode() /* morph, env, scope, params, hash */{ + function linkRenderNode() { return; } /** Host Hook: inline @@ -50085,14 +44878,14 @@ var helper = env.hooks.lookupHelper(env, scope, path); var result = env.hooks.invokeHelper(morph, env, scope, visitor, params, hash, helper, options.templates, thisFor(options.templates)); if (result && result.link) { morph.linkedResult = result.value; - _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, '@content-helper', [morph.linkedResult], null); + _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, "@content-helper", [morph.linkedResult], null); } - if (result && 'value' in result) { + if (result && "value" in result) { value = env.hooks.getValue(result.value); hasValue = true; } } @@ -50132,39 +44925,39 @@ } return out; } - function classify() /* env, scope, path */{ + function classify() { return null; } var keywords = { partial: function (morph, env, scope, params) { var value = env.hooks.partial(morph, env, scope, params[0]); morph.setContent(value); return true; }, - "yield": function (morph, env, scope, params, hash, template, inverse, visitor) { + yield: function (morph, env, scope, params, hash, template, inverse, visitor) { // the current scope is provided purely for the creation of shadow // scopes; it should not be provided to user code. - var to = env.hooks.getValue(hash.to) || 'default'; + var to = env.hooks.getValue(hash.to) || "default"; if (scope.blocks[to]) { scope.blocks[to](env, params, hash.self, morph, scope, visitor); } return true; }, hasBlock: function (morph, env, scope, params) { - var name = env.hooks.getValue(params[0]) || 'default'; + var name = env.hooks.getValue(params[0]) || "default"; return !!scope.blocks[name]; }, hasBlockParams: function (morph, env, scope, params) { - var name = env.hooks.getValue(params[0]) || 'default'; + var name = env.hooks.getValue(params[0]) || "default"; return !!(scope.blocks[name] && scope.blocks[name].arity); } }; @@ -50306,11 +45099,11 @@ } function subexpr(env, scope, helperName, params, hash) { var helper = env.hooks.lookupHelper(env, scope, helperName); var result = env.hooks.invokeHelper(null, env, scope, null, params, hash, helper, {}); - if (result && 'value' in result) { + if (result && "value" in result) { return env.hooks.getValue(result.value); } } /** @@ -50333,15 +45126,15 @@ This hook is the "leaf" hook of the system. It is used to resolve a path relative to the current scope. */ function get(env, scope, path) { - if (path === '') { + if (path === "") { return scope.self; } - var keys = path.split('.'); + var keys = path.split("."); var value = env.hooks.getRoot(scope, keys[0])[0]; for (var i = 1; i < keys.length; i++) { if (value) { value = env.hooks.getChild(value, keys[i]); @@ -50375,14 +45168,14 @@ return reference; } function component(morph, env, scope, tagName, params, attrs, templates, visitor) { if (env.hooks.hasHelper(env, scope, tagName)) { - return env.hooks.block(morph, env, scope, tagName, params, attrs, templates["default"], templates.inverse, visitor); + return env.hooks.block(morph, env, scope, tagName, params, attrs, templates.default, templates.inverse, visitor); } - componentFallback(morph, env, scope, tagName, attrs, templates["default"]); + componentFallback(morph, env, scope, tagName, attrs, templates.default); } function concat(env, params) { var value = ""; for (var i = 0, l = params.length; i < l; i++) { @@ -50394,11 +45187,11 @@ function componentFallback(morph, env, scope, tagName, attrs, template) { var element = env.dom.createElement(tagName); for (var name in attrs) { element.setAttribute(name, env.hooks.getValue(attrs[name])); } - var fragment = _render["default"](template, env, scope, {}).fragment; + var fragment = _render.default(template, env, scope, {}).fragment; element.appendChild(fragment); morph.setNode(element); } function hasHelper(env, scope, helperName) { @@ -50407,20 +45200,17 @@ function lookupHelper(env, scope, helperName) { return env.helpers[helperName]; } - function bindScope() /* env, scope */{ - // this function is used to handle host-specified extensions to scope - // other than `self`, `locals` and `block`. - } + function bindScope() {} function updateScope(env, scope) { env.hooks.bindScope(env, scope); } - exports["default"] = { + exports.default = { // fundamental hooks that you will likely want to override bindLocal: bindLocal, bindSelf: bindSelf, bindScope: bindScope, classify: classify, @@ -50462,12 +45252,14 @@ inline: inline, range: range, keyword: keyword }; }); +/* morph, env, scope, params, hash */ /* env, scope, path */ /* env, scope */ +// this function is used to handle host-specified extensions to scope +// other than `self`, `locals` and `block`. enifed("htmlbars-runtime/morph", ["exports", "../morph-range"], function (exports, _morphRange) { - "use strict"; var guid = 1; function HTMLBarsMorph(domHelper, contextualElement) { this.super$constructor(domHelper, contextualElement); @@ -50506,20 +45298,18 @@ var morph = new HTMLBarsMorph(domHelper, contextualElement); morph.setRange(firstNode, lastNode); return morph; }; - var prototype = HTMLBarsMorph.prototype = Object.create(_morphRange["default"].prototype); + var prototype = HTMLBarsMorph.prototype = Object.create(_morphRange.default.prototype); prototype.constructor = HTMLBarsMorph; - prototype.super$constructor = _morphRange["default"]; + prototype.super$constructor = _morphRange.default; - exports["default"] = HTMLBarsMorph; + exports.default = HTMLBarsMorph; }); enifed("htmlbars-runtime/render", ["exports", "../htmlbars-util/array-utils", "../htmlbars-util/morph-utils", "./expression-visitor", "./morph", "../htmlbars-util/template-utils", "../htmlbars-util/void-tag-names"], function (exports, _htmlbarsUtilArrayUtils, _htmlbarsUtilMorphUtils, _expressionVisitor, _morph, _htmlbarsUtilTemplateUtils, _htmlbarsUtilVoidTagNames) { - "use strict"; - - exports["default"] = render; + exports.default = render; exports.manualElement = manualElement; exports.attachAttributes = attachAttributes; exports.createChildMorph = createChildMorph; exports.getCachedFragment = getCachedFragment; @@ -50558,11 +45348,11 @@ this.bindScope(); if (options.attributes !== undefined) { nodes.push({ state: {} }); - this.statements.push(['attributes', attachAttributes(options.attributes)]); + this.statements.push(["attributes", attachAttributes(options.attributes)]); } if (options.self !== undefined) { this.bindSelf(options.self); } @@ -50603,37 +45393,37 @@ function manualElement(tagName, attributes) { var statements = []; for (var key in attributes) { - if (typeof attributes[key] === 'string') { + if (typeof attributes[key] === "string") { continue; } statements.push(["attribute", key, attributes[key]]); } - statements.push(['content', 'yield']); + statements.push(["content", "yield"]); var template = { arity: 0, cachedFragment: null, hasRendered: false, buildFragment: function buildFragment(dom) { var el0 = dom.createDocumentFragment(); - if (tagName === 'svg') { + if (tagName === "svg") { dom.setNamespace(svgNamespace); } var el1 = dom.createElement(tagName); for (var key in attributes) { - if (typeof attributes[key] !== 'string') { + if (typeof attributes[key] !== "string") { continue; } dom.setAttribute(el1, key, attributes[key]); } - if (!_htmlbarsUtilVoidTagNames["default"][tagName]) { + if (!_htmlbarsUtilVoidTagNames.default[tagName]) { var el2 = dom.createComment(""); dom.appendChild(el1, el2); } dom.appendChild(el0, el1); @@ -50643,11 +45433,11 @@ buildRenderNodes: function buildRenderNodes(dom, fragment) { var element = dom.childAt(fragment, [0]); var morphs = []; for (var key in attributes) { - if (typeof attributes[key] === 'string') { + if (typeof attributes[key] === "string") { continue; } morphs.push(dom.createAttrMorph(element, key)); } @@ -50664,11 +45454,11 @@ function attachAttributes(attributes) { var statements = []; for (var key in attributes) { - if (typeof attributes[key] === 'string') { + if (typeof attributes[key] === "string") { continue; } statements.push(["attribute", key, attributes[key]]); } @@ -50680,11 +45470,11 @@ var el0 = this.element; if (el0.namespaceURI === "http://www.w3.org/2000/svg") { dom.setNamespace(svgNamespace); } for (var key in attributes) { - if (typeof attributes[key] !== 'string') { + if (typeof attributes[key] !== "string") { continue; } dom.setAttribute(el0, key, attributes[key]); } @@ -50693,11 +45483,11 @@ buildRenderNodes: function buildRenderNodes(dom) { var element = this.element; var morphs = []; for (var key in attributes) { - if (typeof attributes[key] === 'string') { + if (typeof attributes[key] === "string") { continue; } morphs.push(dom.createAttrMorph(element, key)); } @@ -50733,11 +45523,11 @@ node.isDirty = true; }); }; RenderResult.prototype.revalidate = function (env, self, blockArguments, scope) { - this.revalidateWith(env, scope, self, blockArguments, _expressionVisitor["default"]); + this.revalidateWith(env, scope, self, blockArguments, _expressionVisitor.default); }; RenderResult.prototype.rerender = function (env, self, blockArguments, scope) { this.revalidateWith(env, scope, self, blockArguments, _expressionVisitor.AlwaysDirtyVisitor); }; @@ -50781,23 +45571,23 @@ if (env.hooks.willRenderNode) { env.hooks.willRenderNode(morph, env, scope); } switch (statement[0]) { - case 'block': + case "block": visitor.block(statement, morph, env, scope, template, visitor);break; - case 'inline': + case "inline": visitor.inline(statement, morph, env, scope, visitor);break; - case 'content': + case "content": visitor.content(statement, morph, env, scope, visitor);break; - case 'element': + case "element": visitor.element(statement, morph, env, scope, template, visitor);break; - case 'attribute': + case "attribute": visitor.attribute(statement, morph, env, scope);break; - case 'component': + case "component": visitor.component(statement, morph, env, scope, template, visitor);break; - case 'attributes': + case "attributes": visitor.attributes(statement, morph, env, scope, this.fragment, visitor);break; } if (env.hooks.didRenderNode) { env.hooks.didRenderNode(morph, env, scope); @@ -50840,11 +45630,11 @@ function initializeNode(node, owner) { node.ownerNode = owner; } function createChildMorph(dom, parentMorph, contextualElement) { - var morph = _morph["default"].empty(dom, contextualElement || parentMorph.contextualElement); + var morph = _morph.default.empty(dom, contextualElement || parentMorph.contextualElement); initializeNode(morph, parentMorph.ownerNode); return morph; } function getCachedFragment(template, env) { @@ -50868,22 +45658,18 @@ return fragment; } }); enifed('htmlbars-util', ['exports', './htmlbars-util/safe-string', './htmlbars-util/handlebars/utils', './htmlbars-util/namespaces', './htmlbars-util/morph-utils'], function (exports, _htmlbarsUtilSafeString, _htmlbarsUtilHandlebarsUtils, _htmlbarsUtilNamespaces, _htmlbarsUtilMorphUtils) { - 'use strict'; - - exports.SafeString = _htmlbarsUtilSafeString["default"]; + exports.SafeString = _htmlbarsUtilSafeString.default; exports.escapeExpression = _htmlbarsUtilHandlebarsUtils.escapeExpression; exports.getAttrNamespace = _htmlbarsUtilNamespaces.getAttrNamespace; exports.validateChildMorphs = _htmlbarsUtilMorphUtils.validateChildMorphs; exports.linkParams = _htmlbarsUtilMorphUtils.linkParams; exports.dump = _htmlbarsUtilMorphUtils.dump; }); enifed('htmlbars-util/array-utils', ['exports'], function (exports) { - 'use strict'; - exports.forEach = forEach; exports.map = map; function forEach(array, callback, binding) { var i, l; @@ -50938,25 +45724,21 @@ var indexOfArray = getIdx; exports.indexOfArray = indexOfArray; }); enifed('htmlbars-util/handlebars/safe-string', ['exports'], function (exports) { // Build out our basic SafeString type - 'use strict'; - function SafeString(string) { this.string = string; } SafeString.prototype.toString = SafeString.prototype.toHTML = function () { return '' + this.string; }; - exports["default"] = SafeString; + exports.default = SafeString; }); enifed('htmlbars-util/handlebars/utils', ['exports'], function (exports) { - 'use strict'; - exports.extend = extend; exports.indexOf = indexOf; exports.escapeExpression = escapeExpression; exports.isEmpty = isEmpty; exports.blockParams = blockParams; @@ -50964,11 +45746,11 @@ var escape = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', - "'": '&#x27;', + '\'': '&#x27;', '`': '&#x60;' }; var badChars = /[&<>"'`]/g, possible = /[&<>"'`]/; @@ -51067,18 +45849,15 @@ function appendContextPath(contextPath, id) { return (contextPath ? contextPath + '.' : '') + id; } }); enifed("htmlbars-util/morph-utils", ["exports"], function (exports) { - /*globals console*/ - - "use strict"; - exports.visitChildren = visitChildren; exports.validateChildMorphs = validateChildMorphs; exports.linkParams = linkParams; exports.dump = dump; + /*globals console*/ function visitChildren(nodes, callback) { if (!nodes || nodes.length === 0) { return; } @@ -51097,16 +45876,11 @@ while (current) { nodes.push(current); current = current.nextMorph; } } else if (node.morphList) { - var current = node.morphList.firstChildMorph; - - while (current) { - nodes.push(current); - current = current.nextMorph; - } + nodes.push(node.morphList); } } } function validateChildMorphs(env, morph, visitor) { @@ -51163,14 +45937,12 @@ cb(nodes[i]); } } }); enifed('htmlbars-util/namespaces', ['exports'], function (exports) { - // ref http://dev.w3.org/html5/spec-LC/namespaces.html - 'use strict'; - exports.getAttrNamespace = getAttrNamespace; + // ref http://dev.w3.org/html5/spec-LC/namespaces.html var defaultNamespaces = { html: 'http://www.w3.org/1999/xhtml', mathml: 'http://www.w3.org/1998/Math/MathML', svg: 'http://www.w3.org/2000/svg', xlink: 'http://www.w3.org/1999/xlink', @@ -51188,12 +45960,10 @@ return namespace || null; } }); enifed("htmlbars-util/object-utils", ["exports"], function (exports) { - "use strict"; - exports.merge = merge; exports.shallowCopy = shallowCopy; exports.keySet = keySet; exports.keyLength = keyLength; @@ -51234,25 +46004,23 @@ return count; } }); enifed("htmlbars-util/quoting", ["exports"], function (exports) { - "use strict"; - exports.hash = hash; exports.repeat = repeat; function escapeString(str) { str = str.replace(/\\/g, "\\\\"); - str = str.replace(/"/g, '\\"'); + str = str.replace(/"/g, "\\\""); str = str.replace(/\n/g, "\\n"); return str; } exports.escapeString = escapeString; function string(str) { - return '"' + escapeString(str) + '"'; + return "\"" + escapeString(str) + "\""; } exports.string = string; function array(a) { @@ -51272,17 +46040,13 @@ } return str; } }); enifed('htmlbars-util/safe-string', ['exports', './handlebars/safe-string'], function (exports, _handlebarsSafeString) { - 'use strict'; - - exports["default"] = _handlebarsSafeString["default"]; + exports.default = _handlebarsSafeString.default; }); enifed("htmlbars-util/template-utils", ["exports", "../htmlbars-util/morph-utils"], function (exports, _htmlbarsUtilMorphUtils) { - "use strict"; - exports.RenderState = RenderState; exports.blockFor = blockFor; exports.renderAndCleanup = renderAndCleanup; exports.clearMorph = clearMorph; exports.clearMorphList = clearMorphList; @@ -51298,11 +46062,10 @@ // A map of morphs for each item yielded in during this // rendering pass. Any morphs in the DOM but not in this map // will be pruned during cleanup. this.handledMorphs = {}; - this.collisions = undefined; // The morph to clear once rendering is complete. By // default, we set this to the previous morph (to catch // the case where nothing is yielded; in that case, we // should just clear the morph). Otherwise this gets set @@ -51347,11 +46110,11 @@ function bindBlocks(env, shadowScope, blocks) { if (!blocks) { return; } - if (typeof blocks === 'function') { + if (typeof blocks === "function") { env.hooks.bindBlock(env, shadowScope, blocks); } else { for (var name in blocks) { if (blocks.hasOwnProperty(name)) { env.hooks.bindBlock(env, shadowScope, blocks[name], name); @@ -51365,11 +46128,10 @@ // helper or hook being invoked has yielded. Once it has finished either // yielding multiple items (via yieldItem) or a single template (via // yieldTemplate), we detect what was rendered and how it differs from // the previous render, cleaning up old state in DOM as appropriate. var renderState = options.renderState; - renderState.collisions = undefined; renderState.shadowOptions = shadowOptions; // Invoke the callback, instructing it to save information about what it // renders into RenderState. var result = callback(options); @@ -51468,11 +46230,10 @@ morphList.clear(); morph.morphList = null; } }); enifed("htmlbars-util/void-tag-names", ["exports", "./array-utils"], function (exports, _arrayUtils) { - "use strict"; // The HTML elements in this list are speced by // http://www.w3.org/TR/html-markup/syntax.html#syntax-elements, // and will be forced to close regardless of if they have a // self-closing /> at the end. @@ -51481,14 +46242,13 @@ _arrayUtils.forEach(voidTagNames.split(" "), function (tagName) { voidMap[tagName] = true; }); - exports["default"] = voidMap; + exports.default = voidMap; }); enifed("morph-attr", ["exports", "./morph-attr/sanitize-attribute-value", "./dom-helper/prop", "./dom-helper/build-html-dom", "./htmlbars-util"], function (exports, _morphAttrSanitizeAttributeValue, _domHelperProp, _domHelperBuildHtmlDom, _htmlbarsUtil) { - "use strict"; function getProperty() { return this.domHelper.getPropertyStrict(this.element, this.attrName); } @@ -51556,11 +46316,11 @@ var _normalizeProperty = _domHelperProp.normalizeProperty(this.element, attrName); var normalized = _normalizeProperty.normalized; var type = _normalizeProperty.type; - if (element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace || attrName === 'style' || type === 'attr') { + if (element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace || attrName === "style" || type === "attr") { this._update = updateAttribute; this._get = getAttribute; this.attrName = normalized; } else { this._update = updateProperty; @@ -51599,19 +46359,17 @@ AttrMorph.prototype.destroy = function () { this.element = null; this.domHelper = null; }; - exports["default"] = AttrMorph; + exports.default = AttrMorph; exports.sanitizeAttributeValue = _morphAttrSanitizeAttributeValue.sanitizeAttributeValue; }); enifed('morph-attr/sanitize-attribute-value', ['exports'], function (exports) { + exports.sanitizeAttributeValue = sanitizeAttributeValue; /* jshint scripturl:true */ - 'use strict'; - - exports.sanitizeAttributeValue = sanitizeAttributeValue; var badProtocols = { 'javascript:': true, 'vbscript:': true }; @@ -51667,11 +46425,10 @@ return value; } }); enifed('morph-range', ['exports', './morph-range/utils'], function (exports, _morphRangeUtils) { - 'use strict'; // constructor just initializes the fields // use one of the static initializers to create a valid morph. function Morph(domHelper, contextualElement) { this.domHelper = domHelper; @@ -51724,12 +46481,12 @@ case 'object': if (typeof content.nodeType === 'number') { return this.setNode(content); } /* Handlebars.SafeString */ - if (typeof content.toHTML === 'function') { - return this.setHTML(content.toHTML()); + if (typeof content.string === 'string') { + return this.setHTML(content.string); } if (this.parseTextAsHTML) { return this.setHTML(content.toString()); } /* falls through */ @@ -51928,14 +46685,13 @@ Morph.prototype.appendToNode = function Morph$appendToNode(parentNode) { _morphRangeUtils.insertBefore(parentNode, this.firstNode, this.lastNode, null); }; - exports["default"] = Morph; + exports.default = Morph; }); enifed('morph-range/morph-list', ['exports', './utils'], function (exports, _utils) { - 'use strict'; function MorphList() { // morph graph this.firstChildMorph = null; this.lastChildMorph = null; @@ -52009,39 +46765,36 @@ this.lastChildMorph._syncLastNode(); }; prototype.removeChildMorph = function MorphList$removeChildMorph(morph) { if (morph.parentMorphList !== this) { - throw new Error("Cannot remove a morph from a parent it is not inside of"); + throw new Error('Cannot remove a morph from a parent it is not inside of'); } morph.destroy(); }; - exports["default"] = MorphList; + exports.default = MorphList; }); enifed('morph-range/morph-list.umd', ['exports', './morph-list'], function (exports, _morphList) { - 'use strict'; (function (root, factory) { if (typeof enifed === 'function' && enifed.amd) { enifed([], factory); } else if (typeof exports === 'object') { module.exports = factory(); } else { root.MorphList = factory(); } - })(undefined, function () { - return _morphList["default"]; + })(this, function () { + return _morphList.default; }); }); enifed("morph-range/utils", ["exports"], function (exports) { - // inclusive of both nodes - "use strict"; - exports.clear = clear; exports.insertBefore = insertBefore; + // inclusive of both nodes function clear(parentNode, firstNode, lastNode) { if (!parentNode) { return; } @@ -52070,18 +46823,17 @@ node = nextNode; } while (node); } }); enifed('route-recognizer', ['exports', './route-recognizer/dsl'], function (exports, _routeRecognizerDsl) { - 'use strict'; var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; var escapeRegex = new RegExp('(\\' + specials.join('|\\') + ')', 'g'); function isArray(test) { - return Object.prototype.toString.call(test) === "[object Array]"; + return Object.prototype.toString.call(test) === '[object Array]'; } // A Segment represents a segment in the original route description. // Each Segment type provides an `eachChar` and `regex` method. // @@ -52125,15 +46877,15 @@ function DynamicSegment(name) { this.name = name; } DynamicSegment.prototype = { eachChar: function (callback) { - callback({ invalidChars: "/", repeat: true }); + callback({ invalidChars: '/', repeat: true }); }, regex: function () { - return "([^/]+)"; + return '([^/]+)'; }, generate: function (params) { return params[this.name]; } @@ -52142,15 +46894,15 @@ function StarSegment(name) { this.name = name; } StarSegment.prototype = { eachChar: function (callback) { - callback({ invalidChars: "", repeat: true }); + callback({ invalidChars: '', repeat: true }); }, regex: function () { - return "(.+)"; + return '(.+)'; }, generate: function (params) { return params[this.name]; } @@ -52158,25 +46910,25 @@ function EpsilonSegment() {} EpsilonSegment.prototype = { eachChar: function () {}, regex: function () { - return ""; + return ''; }, generate: function () { - return ""; + return ''; } }; function parse(route, names, types) { // normalize route as not starting with a "/". Recognition will // also normalize. - if (route.charAt(0) === "/") { + if (route.charAt(0) === '/') { route = route.substr(1); } - var segments = route.split("/"), + var segments = route.split('/'), results = []; for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i], match; @@ -52187,11 +46939,11 @@ types.dynamics++; } else if (match = segment.match(/^\*([^\/]+)$/)) { results.push(new StarSegment(match[1])); names.push(match[1]); types.stars++; - } else if (segment === "") { + } else if (segment === '') { results.push(new EpsilonSegment()); } else { results.push(new StaticSegment(segment)); types.statics++; } @@ -52432,11 +47184,11 @@ }; RouteRecognizer.prototype = { add: function (routes, options) { var currentState = this.rootState, - regex = "^", + regex = '^', types = { statics: 0, dynamics: 0, stars: 0 }, handlers = [], allSegments = [], name; @@ -52458,12 +47210,12 @@ } isEmpty = false; // Add a "/" for the new segment - currentState = currentState.put({ validChars: "/" }); - regex += "/"; + currentState = currentState.put({ validChars: '/' }); + regex += '/'; // Add a representation of the segment to the NFA and regex currentState = addSegment(currentState, segment); regex += segment.regex(); } @@ -52471,16 +47223,16 @@ var handler = { handler: route.handler, names: names }; handlers.push(handler); } if (isEmpty) { - currentState = currentState.put({ validChars: "/" }); - regex += "/"; + currentState = currentState.put({ validChars: '/' }); + regex += '/'; } currentState.handlers = handlers; - currentState.regex = new RegExp(regex + "$"); + currentState.regex = new RegExp(regex + '$'); currentState.types = types; if (name = options && options.as) { this.names[name] = { segments: allSegments, @@ -52491,11 +47243,11 @@ handlersFor: function (name) { var route = this.names[name], result = []; if (!route) { - throw new Error("There is no route named " + name); + throw new Error('There is no route named ' + name); } for (var i = 0, l = route.handlers.length; i < l; i++) { result.push(route.handlers[i]); } @@ -52507,13 +47259,13 @@ return !!this.names[name]; }, generate: function (name, params) { var route = this.names[name], - output = ""; + output = ''; if (!route) { - throw new Error("There is no route named " + name); + throw new Error('There is no route named ' + name); } var segments = route.segments; for (var i = 0, l = segments.length; i < l; i++) { @@ -52521,11 +47273,11 @@ if (segment instanceof EpsilonSegment) { continue; } - output += "/"; + output += '/'; output += segment.generate(params); } if (output.charAt(0) !== '/') { output = '/' + output; @@ -52558,24 +47310,24 @@ for (var j = 0, l = value.length; j < l; j++) { var arrayPair = key + '[]' + '=' + encodeURIComponent(value[j]); pairs.push(arrayPair); } } else { - pair += "=" + encodeURIComponent(value); + pair += '=' + encodeURIComponent(value); pairs.push(pair); } } if (pairs.length === 0) { return ''; } - return "?" + pairs.join("&"); + return '?' + pairs.join('&'); }, parseQueryString: function (queryString) { - var pairs = queryString.split("&"), + var pairs = queryString.split('&'), queryParams = {}; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split('='), key = decodeQueryParamPart(pair[0]), keyLength = key.length, @@ -52621,16 +47373,16 @@ path = decodeURI(path); // DEBUG GROUP path - if (path.charAt(0) !== "/") { - path = "/" + path; + if (path.charAt(0) !== '/') { + path = '/' + path; } pathLen = path.length; - if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { + if (pathLen > 1 && path.charAt(pathLen - 1) === '/') { path = path.substr(0, pathLen - 1); isSlashDropped = true; } for (i = 0, l = path.length; i < l; i++) { @@ -52654,27 +47406,25 @@ var state = solutions[0]; if (state && state.handlers) { // if a trailing slash was dropped and a star segment is the last segment // specified, put the trailing slash back - if (isSlashDropped && state.regex.source.slice(-5) === "(.+)$") { - path = path + "/"; + if (isSlashDropped && state.regex.source.slice(-5) === '(.+)$') { + path = path + '/'; } return findHandler(state, path, queryParams); } } }; - RouteRecognizer.prototype.map = _routeRecognizerDsl["default"]; + RouteRecognizer.prototype.map = _routeRecognizerDsl.default; RouteRecognizer.VERSION = '0.1.5'; - exports["default"] = RouteRecognizer; + exports.default = RouteRecognizer; }); enifed("route-recognizer/dsl", ["exports"], function (exports) { - "use strict"; - function Target(path, matcher, delegate) { this.path = path; this.matcher = matcher; this.delegate = delegate; } @@ -52762,11 +47512,11 @@ } } } } - exports["default"] = function (callback, addRouteCallback) { + exports.default = function (callback, addRouteCallback) { var matcher = new Matcher(); callback(generateMatch("", matcher, this.delegate)); eachRoute([], matcher, function (route) { @@ -52777,16 +47527,13 @@ } }, this); }; }); enifed('router', ['exports', './router/router'], function (exports, _routerRouter) { - 'use strict'; - - exports["default"] = _routerRouter["default"]; + exports.default = _routerRouter.default; }); enifed('router/handler-info', ['exports', './utils', 'rsvp/promise'], function (exports, _utils, _rsvpPromise) { - 'use strict'; function HandlerInfo(_props) { var props = _props || {}; _utils.merge(this, props); this.initialize(props); @@ -52808,11 +47555,11 @@ payload.log(this.name + ': ' + message); } }, promiseLabel: function (label) { - return _utils.promiseLabel("'" + this.name + "' " + label); + return _utils.promiseLabel('\'' + this.name + '\' ' + label); }, getUnresolved: function () { return this; }, @@ -52826,11 +47573,11 @@ beforeModel = _utils.bind(this, this.runBeforeModelHook, payload), model = _utils.bind(this, this.getModel, payload), afterModel = _utils.bind(this, this.runAfterModelHook, payload), becomeResolved = _utils.bind(this, this.becomeResolved, payload); - return _rsvpPromise["default"].resolve(undefined, this.promiseLabel("Start handler")).then(checkForAbort, null, this.promiseLabel("Check for abort")).then(beforeModel, null, this.promiseLabel("Before model")).then(checkForAbort, null, this.promiseLabel("Check if aborted during 'beforeModel' hook")).then(model, null, this.promiseLabel("Model")).then(checkForAbort, null, this.promiseLabel("Check if aborted in 'model' hook")).then(afterModel, null, this.promiseLabel("After model")).then(checkForAbort, null, this.promiseLabel("Check if aborted in 'afterModel' hook")).then(becomeResolved, null, this.promiseLabel("Become resolved")); + return _rsvpPromise.default.resolve(undefined, this.promiseLabel('Start handler')).then(checkForAbort, null, this.promiseLabel('Check for abort')).then(beforeModel, null, this.promiseLabel('Before model')).then(checkForAbort, null, this.promiseLabel('Check if aborted during \'beforeModel\' hook')).then(model, null, this.promiseLabel('Model')).then(checkForAbort, null, this.promiseLabel('Check if aborted in \'model\' hook')).then(afterModel, null, this.promiseLabel('After model')).then(checkForAbort, null, this.promiseLabel('Check if aborted in \'afterModel\' hook')).then(becomeResolved, null, this.promiseLabel('Become resolved')); }, runBeforeModelHook: function (payload) { if (payload.trigger) { payload.trigger(true, 'willResolveModel', payload, this.handler); @@ -52848,15 +47595,15 @@ return this.runSharedModelHook(payload, 'afterModel', [resolvedModel]).then(function () { // Ignore the fulfilled value returned from afterModel. // Return the value stashed in resolvedModels, which // might have been swapped out in afterModel. return payload.resolvedModels[name]; - }, null, this.promiseLabel("Ignore fulfillment value and return model value")); + }, null, this.promiseLabel('Ignore fulfillment value and return model value')); }, runSharedModelHook: function (payload, hookName, args) { - this.log(payload, "calling " + hookName + " hook"); + this.log(payload, 'calling ' + hookName + ' hook'); if (this.queryParams) { args.push(this.queryParams); } args.push(payload); @@ -52865,22 +47612,22 @@ if (result && result.isTransition) { result = null; } - return _rsvpPromise["default"].resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks")); + return _rsvpPromise.default.resolve(result, this.promiseLabel('Resolve value returned from one of the model hooks')); }, // overridden by subclasses getModel: null, checkForAbort: function (shouldContinue, promiseValue) { - return _rsvpPromise["default"].resolve(shouldContinue(), this.promiseLabel("Check for abort")).then(function () { + return _rsvpPromise.default.resolve(shouldContinue(), this.promiseLabel('Check for abort')).then(function () { // We don't care about shouldContinue's resolve value; // pass along the original value passed to this fn. return promiseValue; - }, null, this.promiseLabel("Ignore fulfillment value and continue")); + }, null, this.promiseLabel('Ignore fulfillment value and continue')); }, stashResolvedModel: function (payload, resolvedModel) { payload.resolvedModels = payload.resolvedModels || {}; payload.resolvedModels[this.name] = resolvedModel; @@ -52939,40 +47686,38 @@ } } return true; } - exports["default"] = HandlerInfo; + exports.default = HandlerInfo; }); enifed('router/handler-info/factory', ['exports', 'router/handler-info/resolved-handler-info', 'router/handler-info/unresolved-handler-info-by-object', 'router/handler-info/unresolved-handler-info-by-param'], function (exports, _routerHandlerInfoResolvedHandlerInfo, _routerHandlerInfoUnresolvedHandlerInfoByObject, _routerHandlerInfoUnresolvedHandlerInfoByParam) { - 'use strict'; handlerInfoFactory.klasses = { - resolved: _routerHandlerInfoResolvedHandlerInfo["default"], - param: _routerHandlerInfoUnresolvedHandlerInfoByParam["default"], - object: _routerHandlerInfoUnresolvedHandlerInfoByObject["default"] + resolved: _routerHandlerInfoResolvedHandlerInfo.default, + param: _routerHandlerInfoUnresolvedHandlerInfoByParam.default, + object: _routerHandlerInfoUnresolvedHandlerInfoByObject.default }; function handlerInfoFactory(name, props) { var Ctor = handlerInfoFactory.klasses[name], handlerInfo = new Ctor(props || {}); handlerInfo.factory = handlerInfoFactory; return handlerInfo; } - exports["default"] = handlerInfoFactory; + exports.default = handlerInfoFactory; }); enifed('router/handler-info/resolved-handler-info', ['exports', '../handler-info', 'router/utils', 'rsvp/promise'], function (exports, _handlerInfo, _routerUtils, _rsvpPromise) { - 'use strict'; - var ResolvedHandlerInfo = _routerUtils.subclass(_handlerInfo["default"], { + var ResolvedHandlerInfo = _routerUtils.subclass(_handlerInfo.default, { resolve: function (shouldContinue, payload) { // A ResolvedHandlerInfo just resolved with itself. if (payload && payload.resolvedModels) { payload.resolvedModels[this.name] = this.context; } - return _rsvpPromise["default"].resolve(this, this.promiseLabel("Resolve")); + return _rsvpPromise.default.resolve(this, this.promiseLabel('Resolve')); }, getUnresolved: function () { return this.factory('param', { name: this.name, @@ -52982,19 +47727,18 @@ }, isResolved: true }); - exports["default"] = ResolvedHandlerInfo; + exports.default = ResolvedHandlerInfo; }); enifed('router/handler-info/unresolved-handler-info-by-object', ['exports', '../handler-info', 'router/utils', 'rsvp/promise'], function (exports, _handlerInfo, _routerUtils, _rsvpPromise) { - 'use strict'; - var UnresolvedHandlerInfoByObject = _routerUtils.subclass(_handlerInfo["default"], { + var UnresolvedHandlerInfoByObject = _routerUtils.subclass(_handlerInfo.default, { getModel: function (payload) { - this.log(payload, this.name + ": resolving provided model"); - return _rsvpPromise["default"].resolve(this.context); + this.log(payload, this.name + ': resolving provided model'); + return _rsvpPromise.default.resolve(this.context); }, initialize: function (props) { this.names = props.names || []; this.context = props.context; @@ -53036,17 +47780,16 @@ } return object; } }); - exports["default"] = UnresolvedHandlerInfoByObject; + exports.default = UnresolvedHandlerInfoByObject; }); enifed('router/handler-info/unresolved-handler-info-by-param', ['exports', '../handler-info', 'router/utils'], function (exports, _handlerInfo, _routerUtils) { - 'use strict'; // Generated by URL transitions and non-dynamic route segments in named Transitions. - var UnresolvedHandlerInfoByParam = _routerUtils.subclass(_handlerInfo["default"], { + var UnresolvedHandlerInfoByParam = _routerUtils.subclass(_handlerInfo.default, { initialize: function (props) { this.params = props.params || {}; }, getModel: function (payload) { @@ -53062,14 +47805,13 @@ return this.runSharedModelHook(payload, hookName, [fullParams]); } }); - exports["default"] = UnresolvedHandlerInfoByParam; + exports.default = UnresolvedHandlerInfoByParam; }); enifed('router/router', ['exports', 'route-recognizer', 'rsvp/promise', './utils', './transition-state', './transition', './transition-intent/named-transition-intent', './transition-intent/url-transition-intent', './handler-info'], function (exports, _routeRecognizer, _rsvpPromise, _utils, _transitionState, _transition, _transitionIntentNamedTransitionIntent, _transitionIntentUrlTransitionIntent, _handlerInfo) { - 'use strict'; var pop = Array.prototype.pop; function Router(_options) { var options = _options || {}; @@ -53080,11 +47822,11 @@ this.willTransition = options.willTransition || this.willTransition; this.delegate = options.delegate || this.delegate; this.triggerEvent = options.triggerEvent || this.triggerEvent; this.log = options.log || this.log; - this.recognizer = new _routeRecognizer["default"](); + this.recognizer = new _routeRecognizer.default(); this.reset(); } function getTransitionByIntent(intent, isIntermediate) { var wasTransitioning = !!this.activeTransition; @@ -53125,11 +47867,11 @@ // Transition promises by default resolve with resolved state. // For our purposes, swap out the promise to resolve // after the transition has been finalized. newTransition.promise = newTransition.promise.then(function (result) { return finalizeTransition(newTransition, result.state); - }, null, _utils.promiseLabel("Settle transition promise when transition is finalized")); + }, null, _utils.promiseLabel('Settle transition promise when transition is finalized')); if (!wasTransitioning) { notifyExistingHandlers(this, newState, newTransition); } @@ -53191,11 +47933,11 @@ updateURL(newTransition, oldState, true); if (router.didTransition) { router.didTransition(router.currentHandlerInfos); } return result; - }, null, _utils.promiseLabel("Transition complete")); + }, null, _utils.promiseLabel('Transition complete')); return newTransition; } }, // NOTE: this doesn't really belong here, but here @@ -53220,11 +47962,11 @@ var handler = handlerInfo.handler; _utils.callHook(handler, 'exit'); }); } - this.state = new _transitionState["default"](); + this.state = new _transitionState.default(); this.currentHandlerInfos = null; }, activeTransition: null, @@ -53251,11 +47993,11 @@ /** Hook point for updating the URL. @param {String} url a URL to update to */ updateURL: function () { - throw new Error("updateURL is not implemented"); + throw new Error('updateURL is not implemented'); }, /** Hook point for replacing the current URL, i.e. with replaceState By default this behaves the same as `updateURL` @@ -53286,12 +48028,12 @@ for (var i = 0, len = handlerInfos.length; i < len; ++i) { var handlerInfo = handlerInfos[i]; params[handlerInfo.name] = handlerInfo.params || {}; } - _utils.log(this, "Starting a refresh transition"); - var intent = new _transitionIntentNamedTransitionIntent["default"]({ + _utils.log(this, 'Starting a refresh transition'); + var intent = new _transitionIntentNamedTransitionIntent.default({ name: handlerInfos[handlerInfos.length - 1].name, pivotHandler: pivotHandler || handlerInfos[0].handler, contexts: [], // TODO collect contexts...? queryParams: this._changedQueryParams || state.queryParams || {} }); @@ -53323,11 +48065,11 @@ suppliedParams = partitionedArgs[0], queryParams = partitionedArgs[1]; // Construct a TransitionIntent with the provided params // and apply it to the present state of the router. - var intent = new _transitionIntentNamedTransitionIntent["default"]({ name: handlerName, contexts: suppliedParams }); + var intent = new _transitionIntentNamedTransitionIntent.default({ name: handlerName, contexts: suppliedParams }); var state = intent.applyToState(this.state, this.recognizer, this.getHandler); var params = {}; for (var i = 0, len = state.handlerInfos.length; i < len; ++i) { var handlerInfo = state.handlerInfos[i]; @@ -53338,11 +48080,11 @@ return this.recognizer.generate(handlerName, params); }, applyIntent: function (handlerName, contexts) { - var intent = new _transitionIntentNamedTransitionIntent["default"]({ + var intent = new _transitionIntentNamedTransitionIntent.default({ name: handlerName, contexts: contexts }); var state = this.activeTransition && this.activeTransition.state || this.state; @@ -53378,15 +48120,15 @@ if (index === recogHandlers.length) { // The provided route name isn't even in the route hierarchy. return false; } - var testState = new _transitionState["default"](); + var testState = new _transitionState.default(); testState.handlerInfos = targetHandlerInfos.slice(0, index + 1); recogHandlers = recogHandlers.slice(0, index + 1); - var intent = new _transitionIntentNamedTransitionIntent["default"]({ + var intent = new _transitionIntentNamedTransitionIntent.default({ name: targetHandler, contexts: contexts }); var newState = intent.applyToHandlers(testState, recogHandlers, this.getHandler, targetHandler, true, true); @@ -53682,11 +48424,11 @@ to update the router's array of `currentHandlerInfos`. */ function finalizeTransition(transition, newState) { try { - _utils.log(transition.router, transition.sequence, "Resolved all models on destination route; finalizing transition."); + _utils.log(transition.router, transition.sequence, 'Resolved all models on destination route; finalizing transition.'); var router = transition.router, handlerInfos = newState.handlerInfos, seq = transition.sequence; @@ -53695,11 +48437,11 @@ // Check if a redirect occurred in enter/setup if (transition.isAborted) { // TODO: cleaner way? distinguish b/w targetHandlerInfos? router.state.handlerInfos = router.currentHandlerInfos; - return _rsvpPromise["default"].reject(_transition.logAbort(transition)); + return _rsvpPromise.default.reject(_transition.logAbort(transition)); } updateURL(transition, newState, transition.intent.url); transition.isActive = false; @@ -53709,11 +48451,11 @@ if (router.didTransition) { router.didTransition(router.currentHandlerInfos); } - _utils.log(router, transition.sequence, "TRANSITION COMPLETE."); + _utils.log(router, transition.sequence, 'TRANSITION COMPLETE.'); // Resolve with the final handler. return handlerInfos[handlerInfos.length - 1].handler; } catch (e) { if (!(e instanceof _transition.TransitionAborted)) { @@ -53749,28 +48491,28 @@ } var intent; if (args.length === 0) { - _utils.log(router, "Updating query params"); + _utils.log(router, 'Updating query params'); // A query param update is really just a transition // into the route you're already on. var handlerInfos = router.state.handlerInfos; - intent = new _transitionIntentNamedTransitionIntent["default"]({ + intent = new _transitionIntentNamedTransitionIntent.default({ name: handlerInfos[handlerInfos.length - 1].name, contexts: [], queryParams: queryParams }); } else if (name.charAt(0) === '/') { - _utils.log(router, "Attempting URL transition to " + name); - intent = new _transitionIntentUrlTransitionIntent["default"]({ url: name }); + _utils.log(router, 'Attempting URL transition to ' + name); + intent = new _transitionIntentUrlTransitionIntent.default({ url: name }); } else { - _utils.log(router, "Attempting transition to " + name); - intent = new _transitionIntentNamedTransitionIntent["default"]({ + _utils.log(router, 'Attempting transition to ' + name); + intent = new _transitionIntentNamedTransitionIntent.default({ name: args[0], contexts: _utils.slice.call(args, 1), queryParams: queryParams }); } @@ -53867,14 +48609,13 @@ if (router.willTransition) { router.willTransition(oldHandlers, newState.handlerInfos, newTransition); } } - exports["default"] = Router; + exports.default = Router; }); enifed('router/transition-intent', ['exports', './utils'], function (exports, _utils) { - 'use strict'; function TransitionIntent(props) { this.initialize(props); // TODO: wat @@ -53884,16 +48625,14 @@ TransitionIntent.prototype = { initialize: null, applyToState: null }; - exports["default"] = TransitionIntent; + exports.default = TransitionIntent; }); enifed('router/transition-intent/named-transition-intent', ['exports', '../transition-intent', '../transition-state', '../handler-info/factory', '../utils'], function (exports, _transitionIntent, _transitionState, _handlerInfoFactory, _utils) { - 'use strict'; - - exports["default"] = _utils.subclass(_transitionIntent["default"], { + exports.default = _utils.subclass(_transitionIntent.default, { name: null, pivotHandler: null, contexts: null, queryParams: null, @@ -53917,11 +48656,11 @@ }, applyToHandlers: function (oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive) { var i, len; - var newState = new _transitionState["default"](); + var newState = new _transitionState.default(); var objects = this.contexts.slice(0); var invalidateIndex = handlers.length; // Pivot handlers are provided for refresh transitions @@ -53985,11 +48724,11 @@ newState.handlerInfos.unshift(handlerToUse); } if (objects.length > 0) { - throw new Error("More context objects were passed than there are dynamic segments for the route: " + targetRouteName); + throw new Error('More context objects were passed than there are dynamic segments for the route: ' + targetRouteName); } if (!isIntermediate) { this.invalidateChildren(newState.handlerInfos, invalidateIndex); } @@ -54036,11 +48775,11 @@ //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(', ') + "]"); return oldHandlerInfo; } } - return _handlerInfoFactory["default"]('object', { + return _handlerInfoFactory.default('object', { name: name, handler: handler, context: objectToUse, names: names }); @@ -54057,65 +48796,63 @@ var oldParams = oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params || {}; var peek = objects[objects.length - 1]; var paramName = names[numNames]; if (_utils.isParam(peek)) { - params[paramName] = "" + objects.pop(); + params[paramName] = '' + objects.pop(); } else { // If we're here, this means only some of the params // were string/number params, so try and use a param // value from a previous handler. if (oldParams.hasOwnProperty(paramName)) { params[paramName] = oldParams[paramName]; } else { - throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route " + name); + throw new Error('You didn\'t provide enough string/numeric parameters to satisfy all of the dynamic segments for route ' + name); } } } - return _handlerInfoFactory["default"]('param', { + return _handlerInfoFactory.default('param', { name: name, handler: handler, params: params }); } }); }); enifed('router/transition-intent/url-transition-intent', ['exports', '../transition-intent', '../transition-state', '../handler-info/factory', '../utils', './../unrecognized-url-error'], function (exports, _transitionIntent, _transitionState, _handlerInfoFactory, _utils, _unrecognizedUrlError) { - 'use strict'; - - exports["default"] = _utils.subclass(_transitionIntent["default"], { + exports.default = _utils.subclass(_transitionIntent.default, { url: null, initialize: function (props) { this.url = props.url; }, applyToState: function (oldState, recognizer, getHandler) { - var newState = new _transitionState["default"](); + var newState = new _transitionState.default(); var results = recognizer.recognize(this.url), queryParams = {}, i, len; if (!results) { - throw new _unrecognizedUrlError["default"](this.url); + throw new _unrecognizedUrlError.default(this.url); } var statesDiffer = false; for (i = 0, len = results.length; i < len; ++i) { var result = results[i]; var name = result.handler; var handler = getHandler(name); if (handler.inaccessibleByURL) { - throw new _unrecognizedUrlError["default"](this.url); + throw new _unrecognizedUrlError.default(this.url); } - var newHandlerInfo = _handlerInfoFactory["default"]('param', { + var newHandlerInfo = _handlerInfoFactory.default('param', { name: name, handler: handler, params: result.params }); @@ -54133,11 +48870,10 @@ return newState; } }); }); enifed('router/transition-state', ['exports', './handler-info', './utils', 'rsvp/promise'], function (exports, _handlerInfo, _utils, _rsvpPromise) { - 'use strict'; function TransitionState(other) { this.handlerInfos = []; this.queryParams = {}; this.params = {}; @@ -54154,11 +48890,11 @@ if (targetName !== '') { targetName += '.'; } targetName += handlerInfo.name; }); - return _utils.promiseLabel("'" + targetName + "': " + label); + return _utils.promiseLabel('\'' + targetName + '\': ' + label); }, resolve: function (shouldContinue, payload) { var self = this; // First, calculate params for this state. This is useful @@ -54173,28 +48909,28 @@ var currentState = this; var wasAborted = false; // The prelude RSVP.resolve() asyncs us into the promise land. - return _rsvpPromise["default"].resolve(null, this.promiseLabel("Start transition")).then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); + return _rsvpPromise.default.resolve(null, this.promiseLabel('Start transition')).then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); function innerShouldContinue() { - return _rsvpPromise["default"].resolve(shouldContinue(), currentState.promiseLabel("Check if should continue"))['catch'](function (reason) { + return _rsvpPromise.default.resolve(shouldContinue(), currentState.promiseLabel('Check if should continue'))['catch'](function (reason) { // We distinguish between errors that occurred // during resolution (e.g. beforeModel/model/afterModel), // and aborts due to a rejecting promise from shouldContinue(). wasAborted = true; - return _rsvpPromise["default"].reject(reason); - }, currentState.promiseLabel("Handle abort")); + return _rsvpPromise.default.reject(reason); + }, currentState.promiseLabel('Handle abort')); } function handleError(error) { // This is the only possible // reject value of TransitionState#resolve var handlerInfos = currentState.handlerInfos; var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ? handlerInfos.length - 1 : payload.resolveIndex; - return _rsvpPromise["default"].reject({ + return _rsvpPromise.default.reject({ error: error, handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler, wasAborted: wasAborted, state: currentState }); @@ -54236,14 +48972,13 @@ return handlerInfo.resolve(innerShouldContinue, payload).then(proceed, null, currentState.promiseLabel('Proceed')); } } }; - exports["default"] = TransitionState; + exports.default = TransitionState; }); enifed('router/transition', ['exports', 'rsvp/promise', './handler-info', './utils'], function (exports, _rsvpPromise, _handlerInfo, _utils) { - 'use strict'; /** @private A Transition is a thennable (a promise-like object) that represents @@ -54260,11 +48995,11 @@ this.data = this.intent && this.intent.data || {}; this.resolvedModels = {}; this.queryParams = {}; if (error) { - this.promise = _rsvpPromise["default"].reject(error); + this.promise = _rsvpPromise.default.reject(error); this.error = error; return; } if (state) { @@ -54288,25 +49023,25 @@ } this.sequence = Transition.currentSequence++; this.promise = state.resolve(checkForAbort, this)['catch'](function (result) { if (result.wasAborted || transition.isAborted) { - return _rsvpPromise["default"].reject(logAbort(transition)); + return _rsvpPromise.default.reject(logAbort(transition)); } else { transition.trigger('error', result.error, transition, result.handlerWithError); transition.abort(); - return _rsvpPromise["default"].reject(result.error); + return _rsvpPromise.default.reject(result.error); } }, _utils.promiseLabel('Handle Abort')); } else { - this.promise = _rsvpPromise["default"].resolve(this.state); + this.promise = _rsvpPromise.default.resolve(this.state); this.params = {}; } function checkForAbort() { if (transition.isAborted) { - return _rsvpPromise["default"].reject(undefined, _utils.promiseLabel("Transition aborted - reject")); + return _rsvpPromise.default.reject(undefined, _utils.promiseLabel('Transition aborted - reject')); } } } Transition.currentSequence = 0; @@ -54384,12 +49119,12 @@ @param {Function} onRejection @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} */ - "catch": function (onRejection, label) { - return this.promise["catch"](onRejection, label); + catch: function (onRejection, label) { + return this.promise.catch(onRejection, label); }, /** @public Forwards to the internal `promise` property which you can @@ -54399,12 +49134,12 @@ @param {Function} callback @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} */ - "finally": function (callback, label) { - return this.promise["finally"](callback, label); + finally: function (callback, label) { + return this.promise.finally(callback, label); }, /** @public Aborts the Transition. Note you can also implicitly abort a transition @@ -54412,11 +49147,11 @@ */ abort: function () { if (this.isAborted) { return this; } - _utils.log(this.router, this.sequence, this.targetName + ": transition was aborted"); + _utils.log(this.router, this.sequence, this.targetName + ': transition was aborted'); this.intent.preTransitionState = this.router.state; this.isAborted = true; this.isActive = false; this.router.activeTransition = null; return this; @@ -54489,16 +49224,16 @@ var router = this.router; return this.promise['catch'](function (reason) { if (router.activeTransition) { return router.activeTransition.followRedirects(); } - return _rsvpPromise["default"].reject(reason); + return _rsvpPromise.default.reject(reason); }); }, toString: function () { - return "Transition (sequence " + this.sequence + ")"; + return 'Transition (sequence ' + this.sequence + ')'; }, /** @private */ @@ -54514,25 +49249,24 @@ @private Logs and returns a TransitionAborted error. */ function logAbort(transition) { - _utils.log(transition.router, transition.sequence, "detected abort."); + _utils.log(transition.router, transition.sequence, 'detected abort.'); return new TransitionAborted(); } function TransitionAborted(message) { - this.message = message || "TransitionAborted"; - this.name = "TransitionAborted"; + this.message = message || 'TransitionAborted'; + this.name = 'TransitionAborted'; } exports.Transition = Transition; exports.logAbort = logAbort; exports.TransitionAborted = TransitionAborted; }); enifed("router/unrecognized-url-error", ["exports", "./utils"], function (exports, _utils) { - "use strict"; /** Promise reject reasons passed to promise rejection handlers for failed transitions. */ @@ -54542,15 +49276,13 @@ Error.call(this); } UnrecognizedURLError.prototype = _utils.oCreate(Error.prototype); - exports["default"] = UnrecognizedURLError; + exports.default = UnrecognizedURLError; }); enifed('router/utils', ['exports'], function (exports) { - 'use strict'; - exports.extractQueryParams = extractQueryParams; exports.log = log; exports.bind = bind; exports.forEach = forEach; exports.trigger = trigger; @@ -54560,11 +49292,11 @@ var slice = Array.prototype.slice; var _isArray; if (!Array.isArray) { _isArray = function (x) { - return Object.prototype.toString.call(x) === "[object Array]"; + return Object.prototype.toString.call(x) === '[object Array]'; }; } else { _isArray = Array.isArray; } @@ -54630,11 +49362,11 @@ if (!router.log) { return; } if (arguments.length === 3) { - router.log("Transition #" + sequence + ": " + msg); + router.log('Transition #' + sequence + ': ' + msg); } else { msg = sequence; router.log(msg); } } @@ -54647,11 +49379,11 @@ return fn.apply(context, args); }; } function isParam(object) { - return typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number; + return typeof object === 'string' || object instanceof String || typeof object === 'number' || object instanceof Number; } function forEach(array, callback) { for (var i = 0, l = array.length; i < l && false !== callback(array[i]); i++) {} } @@ -54666,11 +49398,11 @@ if (!handlerInfos) { if (ignoreFailure) { return; } - throw new Error("Could not trigger event '" + name + "'. There are no active handlers"); + throw new Error('Could not trigger event \'' + name + '\'. There are no active handlers'); } var eventWasHandled = false; for (var i = handlerInfos.length - 1; i >= 0; i--) { @@ -54685,11 +49417,11 @@ } } } if (!eventWasHandled && !ignoreFailure) { - throw new Error("Nothing handled the event '" + name + "'."); + throw new Error('Nothing handled the event \'' + name + '\'.'); } } function getChangelist(oldObject, newObject) { var key; @@ -54757,11 +49489,11 @@ function resolveHook(obj, hookName) { if (!obj) { return; } - var underscored = "_" + hookName; + var underscored = '_' + hookName; return obj[underscored] && underscored || obj[hookName] && hookName; } function callHook(obj, _hookName, arg1, arg2) { var hookName = resolveHook(obj, _hookName); @@ -54790,14 +49522,13 @@ exports.callHook = callHook; exports.resolveHook = resolveHook; exports.applyHook = applyHook; }); enifed('rsvp', ['exports', './rsvp/promise', './rsvp/events', './rsvp/node', './rsvp/all', './rsvp/all-settled', './rsvp/race', './rsvp/hash', './rsvp/hash-settled', './rsvp/rethrow', './rsvp/defer', './rsvp/config', './rsvp/map', './rsvp/resolve', './rsvp/reject', './rsvp/filter', './rsvp/asap'], function (exports, _rsvpPromise, _rsvpEvents, _rsvpNode, _rsvpAll, _rsvpAllSettled, _rsvpRace, _rsvpHash, _rsvpHashSettled, _rsvpRethrow, _rsvpDefer, _rsvpConfig, _rsvpMap, _rsvpResolve, _rsvpReject, _rsvpFilter, _rsvpAsap) { - 'use strict'; - _rsvpConfig.config.async = _rsvpAsap["default"]; // default async is asap; - var cast = _rsvpResolve["default"]; + _rsvpConfig.config.async = _rsvpAsap.default; // default async is asap; + var cast = _rsvpResolve.default; function async(callback, arg) { _rsvpConfig.config.async(callback, arg); } function on() { @@ -54818,31 +49549,30 @@ } } } exports.cast = cast; - exports.Promise = _rsvpPromise["default"]; - exports.EventTarget = _rsvpEvents["default"]; - exports.all = _rsvpAll["default"]; - exports.allSettled = _rsvpAllSettled["default"]; - exports.race = _rsvpRace["default"]; - exports.hash = _rsvpHash["default"]; - exports.hashSettled = _rsvpHashSettled["default"]; - exports.rethrow = _rsvpRethrow["default"]; - exports.defer = _rsvpDefer["default"]; - exports.denodeify = _rsvpNode["default"]; + exports.Promise = _rsvpPromise.default; + exports.EventTarget = _rsvpEvents.default; + exports.all = _rsvpAll.default; + exports.allSettled = _rsvpAllSettled.default; + exports.race = _rsvpRace.default; + exports.hash = _rsvpHash.default; + exports.hashSettled = _rsvpHashSettled.default; + exports.rethrow = _rsvpRethrow.default; + exports.defer = _rsvpDefer.default; + exports.denodeify = _rsvpNode.default; exports.configure = _rsvpConfig.configure; exports.on = on; exports.off = off; - exports.resolve = _rsvpResolve["default"]; - exports.reject = _rsvpReject["default"]; + exports.resolve = _rsvpResolve.default; + exports.reject = _rsvpReject.default; exports.async = async; - exports.map = _rsvpMap["default"]; - exports.filter = _rsvpFilter["default"]; + exports.map = _rsvpMap.default; + exports.filter = _rsvpFilter.default; }); enifed('rsvp.umd', ['exports', './rsvp'], function (exports, _rsvp) { - 'use strict'; var RSVP = { 'race': _rsvp.race, 'Promise': _rsvp.Promise, 'allSettled': _rsvp.allSettled, @@ -54868,16 +49598,15 @@ enifed(function () { return RSVP; }); } else if (typeof module !== 'undefined' && module['exports']) { module['exports'] = RSVP; - } else if (typeof undefined !== 'undefined') { - undefined['RSVP'] = RSVP; + } else if (typeof this !== 'undefined') { + this['RSVP'] = RSVP; } }); enifed('rsvp/-internal', ['exports', './utils', './instrument', './config'], function (exports, _utils, _instrument, _config) { - 'use strict'; function withOwnPromise() { return new TypeError('A promises callback cannot return that same promise.'); } @@ -54997,11 +49726,11 @@ promise._result = value; promise._state = FULFILLED; if (promise._subscribers.length === 0) { if (_config.config.instrument) { - _instrument["default"]('fulfilled', promise); + _instrument.default('fulfilled', promise); } } else { _config.config.async(publish, promise); } } @@ -55034,11 +49763,11 @@ function publish(promise) { var subscribers = promise._subscribers; var settled = promise._state; if (_config.config.instrument) { - _instrument["default"](settled === FULFILLED ? 'fulfilled' : 'rejected', promise); + _instrument.default(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); } if (subscribers.length === 0) { return; } @@ -55101,21 +49830,19 @@ } else { value = detail; succeeded = true; } - if (promise._state !== PENDING) { - // noop - } else if (hasCallback && succeeded) { - resolve(promise, value); - } else if (failed) { - reject(promise, error); - } else if (settled === FULFILLED) { - fulfill(promise, value); - } else if (settled === REJECTED) { - reject(promise, value); - } + if (promise._state !== PENDING) {} else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === FULFILLED) { + fulfill(promise, value); + } else if (settled === REJECTED) { + reject(promise, value); + } } function initializePromise(promise, resolver) { try { resolver(function resolvePromise(value) { @@ -55139,21 +49866,21 @@ exports.invokeCallback = invokeCallback; exports.FULFILLED = FULFILLED; exports.REJECTED = REJECTED; exports.PENDING = PENDING; }); + +// noop enifed('rsvp/all-settled', ['exports', './enumerator', './promise', './utils'], function (exports, _enumerator, _promise, _utils) { - 'use strict'; + exports.default = allSettled; - exports["default"] = allSettled; - function AllSettled(Constructor, entries, label) { this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); } - AllSettled.prototype = _utils.o_create(_enumerator["default"].prototype); - AllSettled.prototype._superConstructor = _enumerator["default"]; + AllSettled.prototype = _utils.o_create(_enumerator.default.prototype); + AllSettled.prototype._superConstructor = _enumerator.default; AllSettled.prototype._makeResult = _enumerator.makeSettledResult; AllSettled.prototype._validationError = function () { return new Error('allSettled must be called with an array'); }; @@ -55208,18 +49935,16 @@ @return {Promise} promise that is fulfilled with an array of the settled states of the constituent promises. */ function allSettled(entries, label) { - return new AllSettled(_promise["default"], entries, label).promise; + return new AllSettled(_promise.default, entries, label).promise; } }); enifed("rsvp/all", ["exports", "./promise"], function (exports, _promise) { - "use strict"; + exports.default = all; - exports["default"] = all; - /** This is a convenient alias for `RSVP.Promise.all`. @method all @static @@ -55228,17 +49953,15 @@ @param {String} label An optional label. This is useful for tooling. */ function all(array, label) { - return _promise["default"].all(array, label); + return _promise.default.all(array, label); } }); enifed('rsvp/asap', ['exports'], function (exports) { - 'use strict'; - - exports["default"] = asap; + exports.default = asap; var len = 0; function asap(callback, arg) { queue[len] = callback; queue[len + 1] = arg; @@ -55336,17 +50059,16 @@ } else { scheduleFlush = useSetTimeout(); } }); enifed('rsvp/config', ['exports', './events'], function (exports, _events) { - 'use strict'; var config = { instrument: false }; - _events["default"].mixin(config); + _events.default.mixin(config); function configure(name, value) { if (name === 'onerror') { // handle for legacy users that expect the actual // error to be passed to their function added via @@ -55364,14 +50086,12 @@ exports.config = config; exports.configure = configure; }); enifed('rsvp/defer', ['exports', './promise'], function (exports, _promise) { - 'use strict'; + exports.default = defer; - exports["default"] = defer; - /** `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s interface. New code should use the `RSVP.Promise` constructor instead. @@ -55404,21 +50124,19 @@ */ function defer(label) { var deferred = {}; - deferred['promise'] = new _promise["default"](function (resolve, reject) { + deferred['promise'] = new _promise.default(function (resolve, reject) { deferred['resolve'] = resolve; deferred['reject'] = reject; }, label); return deferred; } }); enifed('rsvp/enumerator', ['exports', './utils', './-internal'], function (exports, _utils, _internal) { - 'use strict'; - exports.makeSettledResult = makeSettledResult; function makeSettledResult(state, position, value) { if (state === _internal.FULFILLED) { return { @@ -55469,11 +50187,11 @@ Enumerator.prototype._init = function () { this._result = new Array(this.length); }; - exports["default"] = Enumerator; + exports.default = Enumerator; Enumerator.prototype._enumerate = function () { var length = this.length; var promise = this.promise; var input = this._input; @@ -55529,12 +50247,10 @@ enumerator._settledAt(_internal.REJECTED, i, reason); }); }; }); enifed("rsvp/events", ["exports"], function (exports) { - "use strict"; - function indexOf(callbacks, callback) { for (var i = 0, l = callbacks.length; i < l; i++) { if (callbacks[i] === callback) { return i; } @@ -55554,11 +50270,11 @@ } /** @class RSVP.EventTarget */ - exports["default"] = { + exports.default = { /** `RSVP.EventTarget.mixin` extends an object with EventTarget methods. For Example: ```javascript @@ -55715,14 +50431,12 @@ } } }; }); enifed('rsvp/filter', ['exports', './promise', './utils'], function (exports, _promise, _utils) { - 'use strict'; + exports.default = filter; - exports["default"] = filter; - /** `RSVP.filter` is similar to JavaScript's native `filter` method, except that it waits for all promises to become fulfilled before running the `filterFn` on each item in given to `promises`. `RSVP.filter` returns a promise that will become fulfilled with the result of running `filterFn` on the values the @@ -55806,23 +50520,23 @@ tooling. @return {Promise} */ function filter(promises, filterFn, label) { - return _promise["default"].all(promises, label).then(function (values) { + return _promise.default.all(promises, label).then(function (values) { if (!_utils.isFunction(filterFn)) { - throw new TypeError("You must pass a function as filter's second argument."); + throw new TypeError('You must pass a function as filter\'s second argument.'); } var length = values.length; var filtered = new Array(length); for (var i = 0; i < length; i++) { filtered[i] = filterFn(values[i]); } - return _promise["default"].all(filtered, label).then(function (filtered) { + return _promise.default.all(filtered, label).then(function (filtered) { var results = new Array(length); var newLength = 0; for (var i = 0; i < length; i++) { if (filtered[i]) { @@ -55837,20 +50551,18 @@ }); }); } }); enifed('rsvp/hash-settled', ['exports', './promise', './enumerator', './promise-hash', './utils'], function (exports, _promise, _enumerator, _promiseHash, _utils) { - 'use strict'; + exports.default = hashSettled; - exports["default"] = hashSettled; - function HashSettled(Constructor, object, label) { this._superConstructor(Constructor, object, false, label); } - HashSettled.prototype = _utils.o_create(_promiseHash["default"].prototype); - HashSettled.prototype._superConstructor = _enumerator["default"]; + HashSettled.prototype = _utils.o_create(_promiseHash.default.prototype); + HashSettled.prototype._superConstructor = _enumerator.default; HashSettled.prototype._makeResult = _enumerator.makeSettledResult; HashSettled.prototype._validationError = function () { return new Error('hashSettled must be called with an object'); }; @@ -55956,18 +50668,16 @@ have been settled. @static */ function hashSettled(object, label) { - return new HashSettled(_promise["default"], object, label).promise; + return new HashSettled(_promise.default, object, label).promise; } }); enifed('rsvp/hash', ['exports', './promise', './promise-hash'], function (exports, _promise, _promiseHash) { - 'use strict'; + exports.default = hash; - exports["default"] = hash; - /** `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array for its `promises` argument. Returns a promise that is fulfilled when all the given promises have been @@ -56054,18 +50764,16 @@ @return {Promise} promise that is fulfilled when all properties of `promises` have been fulfilled, or rejected if any of them become rejected. */ function hash(object, label) { - return new _promiseHash["default"](_promise["default"], object, label).promise; + return new _promiseHash.default(_promise.default, object, label).promise; } }); enifed('rsvp/instrument', ['exports', './config', './utils'], function (exports, _config, _utils) { - 'use strict'; + exports.default = instrument; - exports["default"] = instrument; - var queue = []; function scheduleFlush() { setTimeout(function () { var entry; @@ -56095,21 +50803,19 @@ eventName: eventName, detail: promise._result, childId: child && child._id, label: promise._label, timeStamp: _utils.now(), - error: _config.config["instrument-with-stack"] ? new Error(promise._label) : null + error: _config.config['instrument-with-stack'] ? new Error(promise._label) : null } })) { scheduleFlush(); } } }); enifed('rsvp/map', ['exports', './promise', './utils'], function (exports, _promise, _utils) { - 'use strict'; + exports.default = map; - exports["default"] = map; - /** `RSVP.map` is similar to JavaScript's native `map` method, except that it waits for all promises to become fulfilled before running the `mapFn` on each item in given to `promises`. `RSVP.map` returns a promise that will become fulfilled with the result of running `mapFn` on the values the promises @@ -56186,31 +50892,29 @@ The promise will be rejected if any of the given `promises` become rejected. @static */ function map(promises, mapFn, label) { - return _promise["default"].all(promises, label).then(function (values) { + return _promise.default.all(promises, label).then(function (values) { if (!_utils.isFunction(mapFn)) { - throw new TypeError("You must pass a function as map's second argument."); + throw new TypeError('You must pass a function as map\'s second argument.'); } var length = values.length; var results = new Array(length); for (var i = 0; i < length; i++) { results[i] = mapFn(values[i]); } - return _promise["default"].all(results, label); + return _promise.default.all(results, label); }); } }); enifed('rsvp/node', ['exports', './promise', './-internal', './utils'], function (exports, _promise, _internal, _utils) { - 'use strict'; + exports.default = denodeify; - exports["default"] = denodeify; - function Result() { this.value = undefined; } var ERROR = new Result(); @@ -56414,21 +51118,21 @@ if (!promiseInput) { // TODO: clean this up promiseInput = needsPromiseInput(arg); if (promiseInput === GET_THEN_ERROR) { - var p = new _promise["default"](_internal.noop); + var p = new _promise.default(_internal.noop); _internal.reject(p, GET_THEN_ERROR.value); return p; } else if (promiseInput && promiseInput !== true) { arg = wrapThenable(promiseInput, arg); } } args[i] = arg; } - var promise = new _promise["default"](_internal.noop); + var promise = new _promise.default(_internal.noop); args[l] = function (err, val) { if (err) _internal.reject(promise, err);else if (options === undefined) _internal.resolve(promise, val);else if (options === true) _internal.resolve(promise, arrayResult(arguments));else if (_utils.isArray(options)) _internal.resolve(promise, makeObject(arguments, options));else _internal.resolve(promise, val); }; @@ -56451,42 +51155,41 @@ } return promise; } function handlePromiseInput(promise, args, nodeFunc, self) { - return _promise["default"].all(args).then(function (args) { + return _promise.default.all(args).then(function (args) { var result = tryApply(nodeFunc, self, args); if (result === ERROR) { _internal.reject(promise, result.value); } return promise; }); } function needsPromiseInput(arg) { if (arg && typeof arg === 'object') { - if (arg.constructor === _promise["default"]) { + if (arg.constructor === _promise.default) { return true; } else { return getThen(arg); } } else { return false; } } }); enifed('rsvp/promise-hash', ['exports', './enumerator', './-internal', './utils'], function (exports, _enumerator, _internal, _utils) { - 'use strict'; function PromiseHash(Constructor, object, label) { this._superConstructor(Constructor, object, true, label); } - exports["default"] = PromiseHash; + exports.default = PromiseHash; - PromiseHash.prototype = _utils.o_create(_enumerator["default"].prototype); - PromiseHash.prototype._superConstructor = _enumerator["default"]; + PromiseHash.prototype = _utils.o_create(_enumerator.default.prototype); + PromiseHash.prototype._superConstructor = _enumerator.default; PromiseHash.prototype._init = function () { this._result = {}; }; PromiseHash.prototype._validateInput = function (input) { @@ -56520,23 +51223,22 @@ this._eachEntry(result.entry, result.position); } }; }); enifed('rsvp/promise', ['exports', './config', './instrument', './utils', './-internal', './promise/all', './promise/race', './promise/resolve', './promise/reject'], function (exports, _config, _instrument, _utils, _internal, _promiseAll, _promiseRace, _promiseResolve, _promiseReject) { - 'use strict'; var guidKey = 'rsvp_' + _utils.now() + '-'; var counter = 0; function needsResolver() { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); } - exports["default"] = Promise; + exports.default = Promise; /** Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise’s eventual value or the reason @@ -56646,11 +51348,11 @@ this._state = undefined; this._result = undefined; this._subscribers = []; if (_config.config.instrument) { - _instrument["default"]('created', this); + _instrument.default('created', this); } if (_internal.noop !== resolver) { if (!_utils.isFunction(resolver)) { needsResolver(); @@ -56662,15 +51364,15 @@ _internal.initializePromise(this, resolver); } } - Promise.cast = _promiseResolve["default"]; // deprecated - Promise.all = _promiseAll["default"]; - Promise.race = _promiseRace["default"]; - Promise.resolve = _promiseResolve["default"]; - Promise.reject = _promiseReject["default"]; + Promise.cast = _promiseResolve.default; // deprecated + Promise.all = _promiseAll.default; + Promise.race = _promiseRace.default; + Promise.resolve = _promiseResolve.default; + Promise.reject = _promiseReject.default; Promise.prototype = { constructor: Promise, _guidKey: guidKey, @@ -56877,22 +51579,22 @@ var parent = this; var state = parent._state; if (state === _internal.FULFILLED && !onFulfillment || state === _internal.REJECTED && !onRejection) { if (_config.config.instrument) { - _instrument["default"]('chained', this, this); + _instrument.default('chained', this, this); } return this; } parent._onerror = null; var child = new this.constructor(_internal.noop, label); var result = parent._result; if (_config.config.instrument) { - _instrument["default"]('chained', parent, child); + _instrument.default('chained', parent, child); } if (state) { var callback = arguments[state - 1]; _config.config.async(function () { @@ -56991,14 +51693,12 @@ }, label); } }; }); enifed('rsvp/promise/all', ['exports', '../enumerator'], function (exports, _enumerator) { - 'use strict'; + exports.default = all; - exports["default"] = all; - /** `RSVP.Promise.all` accepts an array of promises, and returns a new promise which is fulfilled with an array of fulfillment values for the passed promises, or rejected with the reason of the first passed promise to be rejected. It casts all elements of the passed iterable to promises as it runs this algorithm. @@ -57044,18 +51744,16 @@ fulfilled, or rejected if any of them become rejected. @static */ function all(entries, label) { - return new _enumerator["default"](this, entries, true, /* abort on reject */label).promise; + return new _enumerator.default(this, entries, true, /* abort on reject */label).promise; } }); enifed('rsvp/promise/race', ['exports', '../utils', '../-internal'], function (exports, _utils, _internal) { - 'use strict'; + exports.default = race; - exports["default"] = race; - /** `RSVP.Promise.race` returns a new promise which is settled in the same way as the first passed promise to settle. Example: @@ -57148,14 +51846,12 @@ return promise; } }); enifed('rsvp/promise/reject', ['exports', '../-internal'], function (exports, _internal) { - 'use strict'; + exports.default = reject; - exports["default"] = reject; - /** `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. It is shorthand for the following: ```javascript @@ -57197,14 +51893,12 @@ _internal.reject(promise, reason); return promise; } }); enifed('rsvp/promise/resolve', ['exports', '../-internal'], function (exports, _internal) { - 'use strict'; + exports.default = resolve; - exports["default"] = resolve; - /** `RSVP.Promise.resolve` returns a promise that will become resolved with the passed `value`. It is shorthand for the following: ```javascript @@ -57248,14 +51942,12 @@ _internal.resolve(promise, object); return promise; } }); enifed('rsvp/race', ['exports', './promise'], function (exports, _promise) { - 'use strict'; + exports.default = race; - exports["default"] = race; - /** This is a convenient alias for `RSVP.Promise.race`. @method race @static @@ -57264,18 +51956,16 @@ @param {String} label An optional label. This is useful for tooling. */ function race(array, label) { - return _promise["default"].race(array, label); + return _promise.default.race(array, label); } }); enifed('rsvp/reject', ['exports', './promise'], function (exports, _promise) { - 'use strict'; + exports.default = reject; - exports["default"] = reject; - /** This is a convenient alias for `RSVP.Promise.reject`. @method reject @static @@ -57285,18 +51975,16 @@ Useful for tooling. @return {Promise} a promise rejected with the given `reason`. */ function reject(reason, label) { - return _promise["default"].reject(reason, label); + return _promise.default.reject(reason, label); } }); enifed('rsvp/resolve', ['exports', './promise'], function (exports, _promise) { - 'use strict'; + exports.default = resolve; - exports["default"] = resolve; - /** This is a convenient alias for `RSVP.Promise.resolve`. @method resolve @static @@ -57307,14 +51995,15 @@ @return {Promise} a promise that will become fulfilled with the given `value` */ function resolve(value, label) { - return _promise["default"].resolve(value, label); + return _promise.default.resolve(value, label); } }); enifed("rsvp/rethrow", ["exports"], function (exports) { + exports.default = rethrow; /** `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event loop in order to aid debugging. Promises A+ specifies that any exceptions that occur with a promise must be @@ -57351,23 +52040,18 @@ @for RSVP @param {Error} reason reason the promise became rejected. @throws Error @static */ - "use strict"; - exports["default"] = rethrow; - function rethrow(reason) { setTimeout(function () { throw reason; }); throw reason; } }); enifed('rsvp/utils', ['exports'], function (exports) { - 'use strict'; - exports.objectOrFunction = objectOrFunction; exports.isFunction = isFunction; exports.isMaybeThenable = isMaybeThenable; function objectOrFunction(x) { \ No newline at end of file